:root{
--red:#E10600;
--blue:#0047B3;
--dark:#0B1F4D;
--bg:#F5F7FA;
--text:#1F2937;
--blueElegant:#2563eb;
--blueSoft:#60a5fa;
--blueDark:#0f4cbd;
}

*{box-sizing:border-box}

html,body{
width:100%;
max-width:100%;
min-height:100%;
overflow-x:hidden;
}

body{
margin:0;
font-family:Arial,Helvetica,sans-serif;
background:
linear-gradient(rgba(2,12,40,.82),rgba(2,12,40,.82)),
url('../img/world-bg.jpg');
background-size:cover;
background-position:center;
background-attachment:fixed;
color:var(--text);
}

/* ALERTAS */
.alert{
padding:16px 18px;
border-radius:16px;
margin-bottom:20px;
font-weight:900;
line-height:1.7;
}

.alert.success,
.success{
background:#16a34a22;
border:1px solid #16a34a;
color:#fff;
}

.alert.deleted,
.deleted,
.alert.error,
.error{
background:#dc262622;
border:1px solid #dc2626;
color:#ff8a8a;
}

.alert a{
color:#60a5fa;
font-weight:900;
}

/* LOGIN */
.login-page{
min-height:100vh;
background:
radial-gradient(circle at top left,rgba(0,71,179,.55),transparent 38%),
linear-gradient(135deg,#0B1F4D,#050816);
display:flex;
align-items:center;
justify-content:center;
padding:40px 20px;
}

.login-wrap{
width:min(1180px,100%);
display:grid;
grid-template-columns:1fr 430px;
gap:34px;
align-items:center;
}

.login-brand{color:#fff;min-width:0}

.login-logo{
width:100%;
max-width:520px;
height:auto;
display:block;
margin:0 0 28px;
object-fit:contain;
filter:drop-shadow(0 18px 42px rgba(0,0,0,.35));
border-radius:8px;
}

.login-brand h1{
font-size:clamp(38px,5vw,64px);
line-height:1;
margin:0 0 12px;
letter-spacing:-1px;
color:#fff;
}

.login-brand p{
font-size:20px;
line-height:1.5;
color:#dce8ff;
max-width:650px;
margin:0;
}

.login-card{
width:100%;
background:rgba(255,255,255,.96);
backdrop-filter:blur(20px);
border-radius:30px;
padding:36px;
box-shadow:0 30px 90px rgba(0,0,0,.38);
border:1px solid rgba(255,255,255,.35);
}

.login-card h2{
margin:0 0 8px;
font-size:30px;
color:var(--dark);
}

.login-card p{
margin:0 0 22px;
color:#64748b;
}

.login-card label{
display:block;
font-weight:800;
margin:14px 0 6px;
color:#111827;
}

/* SIDEBAR */
.crm-layout{
display:flex;
width:100%;
max-width:100%;
min-height:100vh;
overflow-x:hidden;
}

.sidebar{
position:fixed;
left:0;
top:0;
bottom:0;
width:270px;
background:#07152f;
color:#fff;
padding:24px;
overflow-y:auto;
z-index:10;
}

.logo{
width:100%;
max-width:220px;
height:auto;
margin:0 auto 30px;
display:block;
object-fit:contain;
background:#fff;
padding:8px;
border-radius:8px;
}

.slogan{
font-size:16px;
font-weight:900;
line-height:1.45;
margin-bottom:35px;
text-transform:uppercase;
letter-spacing:.4px;
max-width:230px;
color:#fff;
}

.red{color:#ff1717}
.blue{color:#2f7dff}

.menu,
.sidebar nav{
display:flex;
flex-direction:column;
gap:10px;
}

.menu a,
.sidebar nav a{
display:block;
color:#dbe7ff;
text-decoration:none;
padding:14px 16px;
border-radius:14px;
background:rgba(255,255,255,.05);
border:1px solid rgba(255,255,255,.08);
font-weight:900;
transition:.25s ease;
}

.menu a.active,
.menu a:hover,
.sidebar nav a.active,
.sidebar nav a:hover{
background:linear-gradient(135deg,#0f4cbd,#2563eb,#6ba7ff);
color:#fff;
transform:translateX(4px);
}

/* MAIN */
.main{
margin-left:270px;
width:calc(100% - 270px);
max-width:calc(100% - 270px);
min-height:100vh;
padding:70px 38px 45px;
overflow-x:hidden;
}

.topbar,
.top{
display:flex;
justify-content:space-between;
align-items:center;
gap:16px;
margin-bottom:28px;
}

.topbar h1,
.top h1{
font-size:clamp(32px,4vw,46px);
margin:0;
color:#fff;
}

.user{
background:linear-gradient(135deg,#114ed1,#2563eb,#6ba7ff);
padding:14px 22px;
border-radius:16px;
font-weight:900;
color:#fff;
white-space:nowrap;
}

/* PAINÉIS */
.card,
.panel{
background:rgba(9,43,104,.78);
backdrop-filter:blur(18px);
border:1px solid rgba(255,255,255,.08);
border-radius:28px;
padding:28px;
box-shadow:0 20px 50px rgba(0,0,0,.25);
max-width:100%;
overflow:hidden;
}

.panel{
margin-bottom:28px;
}

.panel h2{
margin-top:0;
color:#fff;
font-size:28px;
}

.panel p{color:#fff}

.cards{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
gap:18px;
margin-bottom:22px;
}

.card span{
display:block;
color:#c9d7ff;
font-weight:800;
margin-bottom:12px;
}

.card strong{
display:block;
font-size:clamp(34px,5vw,62px);
font-weight:900;
letter-spacing:-2px;
margin-top:10px;
color:#fff;
}

/* FORMULÁRIOS */
.login-card input,
.grid-form input,
.grid-form textarea,
.grid-form select,
.upload-form input{
width:100%;
padding:14px;
border:1px solid #d9e0ea;
border-radius:14px;
background:#fff;
transition:.3s;
font-size:15px;
outline:none;
}

.login-card input:focus,
.grid-form input:focus,
.grid-form textarea:focus,
.grid-form select:focus,
.upload-form input:focus{
border-color:#2563eb;
box-shadow:0 0 0 4px rgba(37,99,235,.15);
}

.login-card button,
.grid-form button,
.upload-form button{
width:100%;
padding:15px;
border:0;
border-radius:16px;
background:linear-gradient(135deg,#114ed1,#2563eb,#6ba7ff);
color:#fff;
font-weight:900;
cursor:pointer;
box-shadow:0 10px 25px rgba(37,99,235,.35);
transition:.3s ease;
font-size:15px;
}

.login-card button:hover,
.grid-form button:hover,
.upload-form button:hover{
transform:translateY(-2px);
box-shadow:0 14px 35px rgba(37,99,235,.45);
}

.grid-form{
display:grid;
grid-template-columns:repeat(3,1fr);
gap:14px;
}

.grid-form textarea{
grid-column:span 2;
min-height:110px;
}

.upload-form{
display:grid;
grid-template-columns:1fr 1fr auto;
gap:12px;
align-items:center;
}

/* UPLOAD PREMIUM */
.upload-box{
display:flex;
align-items:center;
justify-content:center;
width:100%;
min-height:48px;
padding:14px 18px;
border-radius:14px;
background:linear-gradient(135deg,#114ed1,#2563eb,#6ba7ff);
color:#fff;
cursor:pointer;
font-weight:900;
text-align:center;
box-shadow:0 10px 25px rgba(37,99,235,.35);
transition:.25s ease;
}

.upload-box:hover{
transform:translateY(-2px);
filter:brightness(1.08);
box-shadow:0 14px 35px rgba(37,99,235,.45);
}

.upload-box input[type=file]{
display:none;
}

/* TABELAS */
.table-wrap{
width:100%;
overflow-x:auto;
border-radius:18px;
}

table{
width:100%;
border-collapse:collapse;
background:#fff;
border-radius:18px;
overflow:hidden;
}

th{
background:#f8fafc;
color:#0B1F4D;
font-weight:900;
}

th,td{
text-align:left;
padding:14px;
border-bottom:1px solid #e5e7eb;
color:#111827;
vertical-align:middle;
}

td{
font-size:14px;
}

/* BOTÕES */
.btn-whats,
.btn-portal,
.btn-del,
.btn-delete,
.btn-pdf,
.action,
.download{
display:inline-flex;
align-items:center;
justify-content:center;
padding:10px 14px;
border-radius:12px;
color:#fff !important;
text-decoration:none;
font-weight:900;
margin-right:6px;
margin-bottom:6px;
border:none;
cursor:pointer;
font-size:13px;
line-height:1;
white-space:nowrap;
transition:.25s ease;
}

.btn-whats:hover,
.btn-portal:hover,
.btn-del:hover,
.btn-delete:hover,
.btn-pdf:hover,
.action:hover,
.download:hover{
transform:translateY(-2px);
filter:brightness(1.08);
}

.btn-whats{background:linear-gradient(135deg,#16a34a,#22c55e)}
.btn-portal{background:linear-gradient(135deg,#7c3aed,#a855f7)}
.btn-del,
.btn-delete{background:linear-gradient(135deg,#dc2626,#ef4444)}
.btn-pdf,
.download{background:linear-gradient(135deg,#114ed1,#2563eb,#6ba7ff)}

/* BADGE */
.badge{
display:inline-block;
padding:6px 10px;
border-radius:999px;
background:rgba(255,255,255,.12);
margin-top:6px;
font-size:12px;
font-weight:900;
color:#fff;
}

/* LISTAS */
.item{
padding:14px 0;
border-bottom:1px solid rgba(255,255,255,.08);
color:#fff;
}

.item:last-child{
border-bottom:none;
}

/* KANBAN */
.kanban{
display:grid;
grid-template-columns:repeat(6,260px);
gap:14px;
overflow-x:auto;
padding-bottom:10px;
}

.lane{
background:#fff;
border-radius:20px;
padding:14px;
min-height:400px;
box-shadow:0 10px 30px #0b1f4d14;
}

.lane h3{
font-size:14px;
color:var(--dark);
}

.lead-card{
background:#f6f8ff;
border-left:4px solid var(--blue);
border-radius:14px;
padding:12px;
margin:10px 0;
}

.lead-card span,
.lead-card small{
display:block;
color:#64748b;
margin-top:4px;
}

.grid2,
.grid3{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
gap:18px;
}

.hero,
.chart-box{
max-width:100%;
overflow:hidden;
}

.chart-box{
width:100%;
height:320px;
}

canvas{
max-width:100%!important;
}

/* RESPONSIVO */
@media(max-width:1100px){
.login-wrap{
grid-template-columns:1fr;
max-width:720px;
}

.login-brand{text-align:center}

.login-logo{
margin:0 auto 24px;
max-width:460px;
}

.login-card{
max-width:460px;
margin:0 auto;
}

.sidebar{
position:relative;
width:100%;
height:auto;
}

.main{
margin-left:0;
width:100%;
max-width:100%;
padding:25px;
}

.crm-layout{
flex-direction:column;
}
}

@media(max-width:900px){
.login-page{padding:28px 16px}

.login-card{
padding:28px 22px;
border-radius:24px;
}

.login-brand h1{font-size:42px}
.login-brand p{font-size:17px}

.top,
.topbar{
flex-direction:column;
align-items:flex-start;
}

.grid-form,
.upload-form{
grid-template-columns:1fr;
}

.grid-form textarea{
grid-column:span 1;
}

.kanban{
grid-template-columns:repeat(2,260px);
}
}

@media(max-width:600px){
.login-logo{max-width:320px}

.login-brand h1{font-size:34px}
.login-card h2{font-size:25px}

.main{padding:18px}
.sidebar{padding:20px}

.card,
.panel{
padding:22px;
border-radius:22px;
}

.kanban{
grid-template-columns:260px;
}

.btn-whats,
.btn-portal,
.btn-del,
.btn-delete,
.btn-pdf,
.action,
.download{
width:100%;
margin-right:0;
}

.upload-box{
width:100%;
}
}

.notification-bell{
position:relative;
font-size:28px;
text-decoration:none;
color:#fff;
display:inline-block;
margin-right:15px;
}

.notification-count{
position:absolute;
top:-10px;
right:-12px;
background:#ef4444;
color:#fff;
font-size:12px;
padding:4px 8px;
border-radius:999px;
font-weight:900;
min-width:22px;
text-align:center;
}

/* Upload Premium */

.file-upload{
    position:relative;
    overflow:hidden;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,#114ed1,#2563eb,#6ba7ff);
    color:#fff;
    border-radius:16px;
    padding:16px 24px;
    font-weight:700;
    min-height:56px;
    transition:.3s;
    box-shadow:0 6px 20px rgba(37,99,235,.35);
}

.file-upload:hover{
    transform:translateY(-2px);
    box-shadow:0 10px 25px rgba(37,99,235,.45);
}

.file-upload input[type=file]{
    position:absolute;
    left:0;
    top:0;
    width:100%;
    height:100%;
    opacity:0;
    cursor:pointer;
}

table{
    width:100%;
    border-collapse:collapse;
    table-layout:auto;
}

td:last-child{
    min-width:180px;
}

.btn-success,
.btn-warning,
.btn-danger{
    display:inline-block;
    margin:3px;
    white-space:nowrap;
}


/* =====================================================
   CORREÇÃO FINAL - FINANCEIRO / TABELAS RESPONSIVAS
   Evita cortar a coluna Ações e melhora leitura
===================================================== */

.table-wrap{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    border-radius:18px;
}

.panel{
    overflow-x:auto;
}

.panel table{
    width:100%;
    min-width:980px;
    border-collapse:collapse;
    table-layout:auto;
}

.panel th,
.panel td{
    white-space:nowrap;
    vertical-align:middle;
}

.panel td:nth-child(1){
    min-width:220px;
}

.panel td:nth-child(2){
    min-width:180px;
}

.panel td:last-child{
    min-width:230px;
}

.btn-success,
.btn-warning,
.btn-danger{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:110px;
    margin:3px;
    white-space:nowrap;
    text-align:center;
}

@media(max-width:900px){
    .panel table{
        min-width:980px;
    }

    .table-wrap{
        overflow-x:auto;
    }
}

/* =======================================
   FINANCEIRO - BOTÕES COMPACTOS
======================================= */

.finance-actions{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-width:110px;
}

.finance-icon-btn{
    width:42px;
    height:42px;
    display:flex !important;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    text-decoration:none;
    font-size:18px;
    font-weight:700;
    transition:.25s;
    box-shadow:0 4px 12px rgba(0,0,0,.15);
}

.finance-icon-btn:hover{
    transform:translateY(-2px);
}

.btn-success.finance-icon-btn{
    background:#22c55e;
    color:#fff;
}

.btn-warning.finance-icon-btn{
    background:#f59e0b;
    color:#fff;
}

.btn-danger.finance-icon-btn{
    background:#ef4444;
    color:#fff;
}

/* TABELA FINANCEIRO */

.finance-table-wrap{
    width:100%;
    overflow-x:auto;
    border-radius:18px;
}

.finance-table{
    width:100%;
    border-collapse:collapse;
}

.finance-table th{
    background:#f8fafc;
    font-weight:700;
    white-space:nowrap;
}

.finance-table td{
    white-space:nowrap;
    vertical-align:middle;
}

.finance-table td:first-child{
    min-width:240px;
}

.finance-table td:nth-child(2){
    min-width:180px;
}

.finance-table td:last-child{
    min-width:130px;
}

/* PRIME CRM ENTERPRISE 2.0 OVERRIDES */
body{
    background:linear-gradient(180deg,#061225 0%,#081b38 48%,#07111f 100%) !important;
}
.sidebar{
    background:linear-gradient(180deg,#020617,#07152f 45%,#020617) !important;
    border-right:1px solid rgba(96,165,250,.12);
}
.menu a,.sidebar nav a{
    color:#dbeafe !important;
}
.menu a.active,.sidebar nav a.active{
    background:linear-gradient(135deg,#0f4cbd,#2563eb,#60a5fa) !important;
    box-shadow:0 14px 34px rgba(37,99,235,.28);
}
.panel,.card{
    background:linear-gradient(135deg,rgba(9,43,104,.88),rgba(8,20,45,.84)) !important;
    border:1px solid rgba(96,165,250,.18) !important;
    box-shadow:0 24px 65px rgba(0,0,0,.25) !important;
}
.panel:hover,.card:hover{
    border-color:rgba(96,165,250,.38) !important;
}
input,textarea,select{
    color:#0f172a !important;
}
table{
    background:#fff !important;
}
th,td{
    color:#0B1F4D !important;
}
th{
    background:#f8fafc !important;
}
tr:hover td{
    background:#eef5ff !important;
}
::selection{
    background:#2563eb;
    color:#ffffff;
}
@media(max-width:900px){
    .sidebar{position:relative !important;width:100% !important;}
    .main{margin-left:0 !important;width:100% !important;max-width:100% !important;padding:24px !important;}
    .crm-layout{flex-direction:column !important;}
}
