:root{
    --azul-principal:#002A54;
    --azul-secundario:#00A7EC;
    --off-white:#F1EDE8;
    --preto:#171717;
    --cinza:#A69D9D;
    --dourado:#FFCB87;
    --fundo:#f5f7fb;
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:"Segoe UI", Arial, sans-serif;
    background:var(--fundo);
    color:#111827;
}

a{
    text-decoration:none;
}

/* LOGIN */

body.pagina-login{
    background:linear-gradient(135deg,#001b36,#002A54);
}

.inx-login-page{
    min-height:100vh;
    min-height:100dvh;
    display:flex;
    background:linear-gradient(135deg,#001b36,#002A54);
    color:white;
}

.inx-brand{
    width:52%;
    padding:80px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    background:radial-gradient(circle at 30% 80%, rgba(0,167,236,.35), transparent 30%),
        linear-gradient(135deg,#001b36,#002A54);
}

.inx-brand h1{
    font-size:62px;
    font-weight:900;
    letter-spacing:4px;
    margin:0 0 12px;
}

.inx-brand h4{
    font-size:18px;
    font-weight:400;
    color:var(--azul-secundario);
    margin:0 0 20px;
}

.inx-brand p{
    color:#b7dfff;
    font-size:15px;
    line-height:1.7;
    max-width:400px;
}

.inx-login-area{
    width:48%;
    display:flex;
    align-items:center;
    justify-content:center;
}

.inx-card{
    background:white;
    color:#111827;
    width:430px;
    border-radius:24px;
    padding:38px;
    box-shadow:0 24px 70px rgba(0,0,0,.28);
}

.inx-card h3{
    font-size:22px;
    font-weight:700;
    color:var(--azul-principal);
    margin:0 0 6px;
}

.inx-subtitle{
    color:#64748b;
    font-size:14px;
    margin:0 0 24px;
}

.inx-alert{
    background:#fef2f2;
    color:#b91c1c;
    border:1px solid #fecaca;
    border-radius:10px;
    padding:10px 14px;
    font-size:14px;
    margin-bottom:18px;
}

.inx-form-group{
    margin-bottom:16px;
}

.inx-form-group label{
    display:block;
    font-size:13px;
    font-weight:600;
    color:#374151;
    margin-bottom:6px;
}

.inx-form-group input{
    width:100%;
    padding:11px 14px;
    border:1.5px solid #d1d5db;
    border-radius:10px;
    font-size:15px;
    outline:none;
    transition:.2s;
    font-family:inherit;
    color:#111827;
}

.inx-form-group input:focus{
    border-color:var(--azul-secundario);
    box-shadow:0 0 0 3px rgba(0,167,236,.15);
}

.inx-login-button{
    width:100%;
    padding:13px;
    background:var(--azul-principal);
    color:white;
    border:none;
    border-radius:12px;
    font-size:16px;
    font-weight:700;
    cursor:pointer;
    margin-top:8px;
    transition:.2s;
    font-family:inherit;
    letter-spacing:.3px;
}

.inx-login-button:hover{
    background:#003d7a;
    transform:translateY(-1px);
    box-shadow:0 6px 20px rgba(0,42,84,.3);
}

/* SIDEBAR */

.sidebar{
    position:fixed;
    left:0;
    top:0;
    width:260px;
    height:100vh;
    height:100dvh;
    background:linear-gradient(180deg,#002A54,#001b36);
    color:white;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    z-index:1000;
    transition:transform .25s ease;
}

.brand{
    flex:0 0 auto;
    padding:22px 18px 16px;
    border-bottom:1px solid rgba(255,255,255,.12);
}

.brand h2{
    font-size:28px;
    margin:0;
    font-weight:900;
    letter-spacing:2px;
}

.brand h2 span{
    color:var(--azul-secundario);
}

.brand small{
    color:#b7dfff;
    font-size:11px;
}

.sidebar-scroll{
    flex:1 1 auto;
    overflow-y:auto;
    overflow-x:hidden;
    padding:10px 12px;
}

.sidebar-scroll::-webkit-scrollbar{
    width:6px;
}

.sidebar-scroll::-webkit-scrollbar-track{
    background:transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.25);
    border-radius:20px;
}

.sidebar-section{
    color:#b7dfff;
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.8px;
    margin:14px 10px 6px;
}

.sidebar a{
    display:flex;
    align-items:center;
    gap:10px;
    color:white;
    padding:10px 12px;
    margin:4px 0;
    border-radius:10px;
    font-weight:500;
    font-size:14px;
    transition:.2s ease;
}

.sidebar a i{
    font-size:16px;
    width:20px;
    text-align:center;
}

.sidebar a:hover,
.sidebar a.active{
    background:var(--azul-secundario);
    color:white;
}

.sidebar-footer{
    flex:0 0 auto;
    padding:12px;
    border-top:1px solid rgba(255,255,255,.12);
    background:rgba(0,0,0,.12);
}

.user-mini{
    display:flex;
    gap:10px;
    align-items:center;
    margin-bottom:10px;
}

.user-mini .avatar{
    width:34px;
    height:34px;
    border-radius:50%;
    background:var(--azul-secundario);
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
}

.user-mini strong{
    display:block;
    font-size:13px;
    color:white;
}

.user-mini small{
    display:block;
    font-size:11px;
    color:#b7dfff;
}

.logout-link{
    background:rgba(255,255,255,.08);
}

.logout-link:hover{
    background:#d9534f !important;
}
.user-link{
    display:flex;
    gap:10px;
    align-items:center;
    margin-bottom:10px;
    text-decoration:none;
    padding:8px;
    border-radius:8px;
    transition:.2s;
    color:white;
}

.user-link:hover{
    background:rgba(255,255,255,.08);
    color:white;
}


/* MENU MODULAR COLAPSAVEL */

.mod-header{
    display:flex;
    align-items:center;
    gap:9px;
    padding:8px 10px;
    border-radius:9px;
    cursor:pointer;
    transition:.15s ease;
    margin:2px 0;
    user-select:none;
    text-decoration:none;
}

.mod-header:hover{
    background:rgba(255,255,255,.07);
}

.mod-header.mod-open{
    background:rgba(0,167,236,.15);
}

.mod-icon{
    width:28px;
    height:28px;
    border-radius:7px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    flex-shrink:0;
}

.mod-label{
    font-size:12px;
    font-weight:700;
    color:white;
    flex:1;
    letter-spacing:.02em;
}

.mod-chevron{
    font-size:12px;
    color:rgba(255,255,255,.35);
    transition:transform .2s ease;
    line-height:1;
}

.mod-header.mod-open .mod-chevron{
    transform:rotate(90deg);
    color:rgba(255,255,255,.6);
}

.mod-items{
    padding-left:10px;
    border-left:1px solid rgba(255,255,255,.08);
    margin:2px 0 4px 23px;
    overflow:hidden;
    max-height:0;
    transition:max-height .25s ease;
}

.mod-items.mod-open{
    max-height:1200px;
}

.mod-items a{
    display:flex;
    align-items:center;
    gap:8px;
    color:rgba(255,255,255,.65);
    padding:6px 10px;
    margin:1px 0;
    border-radius:7px;
    font-weight:500;
    font-size:12px;
    transition:.15s ease;
    text-decoration:none;
}

.mod-items a i{
    font-size:13px;
    width:16px;
    text-align:center;
}

.mod-items a:hover{
    color:white;
    background:rgba(255,255,255,.08);
}

.mod-items a.active{
    color:white;
    background:var(--azul-secundario);
}

.nav-single{
    display:flex;
    align-items:center;
    gap:9px;
    color:rgba(255,255,255,.85);
    padding:8px 10px;
    margin:2px 0;
    border-radius:9px;
    font-weight:600;
    font-size:12px;
    transition:.15s ease;
    text-decoration:none;
}

.nav-single i{
    font-size:15px;
    width:20px;
    text-align:center;
}

.nav-single:hover{
    background:rgba(255,255,255,.07);
    color:white;
}

.nav-single.active{
    background:var(--azul-secundario);
    color:white;
}

.nav-divider{
    height:1px;
    background:rgba(255,255,255,.07);
    margin:6px 0;
}

/* MAIN */

.main{
    margin-left:260px;
    min-height:100vh;
    min-height:100dvh;
    transition:margin-left .25s ease;
}

.topbar{
    height:72px;
    background:white;
    border-bottom:1px solid #e8edf5;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 28px;
}

.content{
    padding:28px;
}

/* Botao hamburguer -- escondido no desktop, so aparece no mobile
   (ver bloco @media no final do arquivo) */
.btn-hamburguer{
    display:none;
}

/* Overlay escuro atras do menu no mobile -- escondido por padrao */
.sidebar-overlay{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.5);
    z-index:9998;
}

.sidebar-overlay.ativo{
    display:block;
}

/* TITULOS */

.page-title{
    font-weight:800;
    color:var(--azul-principal);
}

.page-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
    gap:16px;
}

.page-header h1{
    margin:0;
    font-size:26px;
    color:var(--azul-principal);
}

.page-header p{
    margin:5px 0 0;
    color:#666;
}

.header-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

/* CARDS */

.card,
.card-inx{
    background:white;
    border-radius:12px;
    padding:18px;
    margin-bottom:18px;
    box-shadow:0 2px 8px rgba(0,0,0,0.06);
    border:1px solid #edf1f7;
}

.card h2{
    font-size:18px;
    color:var(--azul-principal);
    margin:0 0 16px;
}

.kpi{
    background:white;
    border-radius:18px;
    border:1px solid #edf1f7;
    box-shadow:0 8px 28px rgba(0,42,84,.08);
    padding:22px;
}

.kpi .number{
    font-size:34px;
    font-weight:900;
    color:var(--azul-principal);
}

.kpi .label{
    color:#64748b;
}

.kpi-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:16px;
    margin-bottom:18px;
}

.kpi-card{
    background:#fff;
    border-radius:12px;
    padding:18px;
    box-shadow:0 2px 8px rgba(0,0,0,0.06);
    border-left:5px solid var(--azul-principal);
}

.kpi-card span{
    display:block;
    font-size:13px;
    color:#667085;
    margin-bottom:8px;
}

.kpi-card strong{
    display:block;
    font-size:22px;
    color:var(--azul-principal);
}

/* FORMULARIOS */

.form-label{
    font-weight:700;
    color:var(--azul-principal);
}

.filter-bar{
    display:flex;
    gap:16px;
    align-items:end;
    flex-wrap:wrap;
}

.form-group{
    display:flex;
    flex-direction:column;
    min-width:220px;
}

.form-group label{
    font-size:13px;
    font-weight:600;
    margin-bottom:6px;
    color:#333;
}

.form-group input,
.form-group select,
.form-group textarea{
    padding:8px 10px;
    border:1px solid #d8dce3;
    border-radius:8px;
    font-family:inherit;
    font-size:14px;
}

.form-group input,
.form-group select{
    height:38px;
}

.form-group textarea{
    resize:vertical;
}

.form-group.full{
    grid-column:1 / -1;
}

.form-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.form-footer{
    display:flex;
    gap:10px;
    justify-content:flex-end;
    margin-bottom:30px;
    flex-wrap:wrap;
}

/* GRIDS */

.grid-2,
.grid-3,
.grid-4{
    display:grid;
    gap:16px;
}

.grid-2{
    grid-template-columns:repeat(2,1fr);
}

.grid-3{
    grid-template-columns:repeat(3,1fr);
}

.grid-4{
    grid-template-columns:repeat(4,1fr);
}

/* TABELAS */

.table-responsive{
    width:100%;
    overflow-x:auto;
}

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

.table thead th,
.table th{
    background:#f5f7fb;
    color:var(--azul-principal);
    text-align:left;
    font-size:13px;
    padding:12px;
    border-bottom:1px solid #e3e6ea;
}

.table td{
    padding:12px;
    border-bottom:1px solid #eef0f3;
    font-size:14px;
}

.table tfoot th{
    background:#f5f7fb;
    color:var(--azul-principal);
    padding:12px;
    border-top:2px solid #d8dce3;
}

.actions{
    display:flex;
    gap:6px;
    flex-wrap:wrap;
}

.text-center{
    text-align:center;
}

/* BOTOES */

.btn{
    display:inline-block;
    padding:9px 14px;
    border-radius:8px;
    text-decoration:none;
    border:none;
    cursor:pointer;
    font-size:14px;
}

.btn-sm{
    padding:6px 10px;
    font-size:12px;
}

.btn-primary,
.btn-inx{
    background:var(--azul-principal) !important;
    color:#fff !important;
}

.btn-primary:hover,
.btn-inx:hover{
    background:var(--azul-secundario) !important;
}

.btn-secondary{
    background:var(--azul-secundario);
    color:#fff;
}

.btn-light{
    background:#f1f1f1;
    color:#333;
}

.btn-info{
    background:var(--azul-secundario);
    color:#fff;
}

.btn-warning{
    background:var(--dourado);
    color:#171717;
}

.btn-danger{
    background:#d9534f;
    color:#fff;
}

/* BADGES */

.badge{
    display:inline-block;
    padding:5px 9px;
    border-radius:20px;
    font-size:12px;
    font-weight:600;
}

.badge-success{
    background:#dff5e1;
    color:#207a32;
}

.badge-warning{
    background:#fff4d6;
    color:#946200;
}

.badge-danger{
    background:#fde2e2;
    color:#b3261e;
}

.badge-secondary{
    background:#e5e7eb;
    color:#374151;
}

.badge-status{
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}

.status-ABERTA,
.status-ESTOQUE{
    background:#e8f2ff;
    color:#0055a6;
}

.status-AGUARDANDO_ENVIO{
    background:#fff6df;
    color:#946200;
}

.status-RECEBIDA,
.status-ANALISE{
    background:#fff1dc;
    color:#a85500;
}

.status-REPARO,
.status-TESTE{
    background:#ffe3e3;
    color:#a50000;
}

.status-FINALIZADA,
.status-CAMPO,
.status-ATIVO{
    background:#ddf8e7;
    color:#087333;
}

.status-DESCARTE{
    background:#e5e7eb;
    color:#374151;
}

.status-INATIVO{
    background:#ffe3e3;
    color:#a50000;
}

/* ALERTAS */

.alert{
    padding:12px 14px;
    border-radius:8px;
    margin-bottom:18px;
    font-size:14px;
}

.alert-success{
    background:#dff5e1;
    color:#207a32;
    border:1px solid #a8e6b0;
}

.alert-danger{
    background:#fde2e2;
    color:#b3261e;
    border:1px solid #f5b5b5;
}

.alert-warning{
    background:#fff4d6;
    color:#946200;
    border:1px solid #ffe1a3;
}

/* DETALHES */

.summary-card{
    background:var(--azul-principal);
    color:#fff;
    border-radius:14px;
    padding:18px;
    margin-bottom:18px;
    display:grid;
    grid-template-columns:1fr 2fr auto;
    gap:16px;
    align-items:center;
}

.summary-label{
    display:block;
    font-size:12px;
    opacity:.8;
    margin-bottom:4px;
}

.quick-actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-bottom:18px;
}

.detail-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.detail-list div,
.detail-grid div{
    background:#f8fafc;
    border:1px solid #eef0f3;
    border-radius:10px;
    padding:12px;
}

.detail-list span,
.detail-grid span{
    display:block;
    font-size:12px;
    color:#667085;
    margin-bottom:5px;
}

.detail-list strong,
.detail-grid strong{
    display:block;
    font-size:14px;
    color:#171717;
    word-break:break-word;
}

.detail-grid .full,
.grid-4 .full{
    grid-column:1 / -1;
}

.map-box{
    width:100%;
    overflow:hidden;
    border-radius:12px;
}

/* TIMELINE */

.timeline{
    border-left:3px solid var(--azul-secundario);
    padding-left:18px;
}

.timeline-item{
    margin-bottom:18px;
    position:relative;
}

.timeline-item:before{
    content:"";
    position:absolute;
    left:-27px;
    top:4px;
    width:14px;
    height:14px;
    background:var(--azul-secundario);
    border-radius:50%;
}

/* TOOLTIPS (3 variantes usadas em telas diferentes do sistema) */

.tooltip-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    cursor: help;
}

.tooltip-help i {
    color: #00A7EC;
    font-size: 14px;
}

.tooltip-help .tooltip-text {
    visibility: hidden;
    opacity: 0;
    transition: opacity .2s ease;
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: #002A54;
    color: white;
    padding: 10px 12px;
    border-radius: 8px;
    width: 240px;
    font-size: 12px;
    line-height: 1.4;
    z-index: 9999;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.tooltip-help:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.help-tip{
    position:relative;
    display:inline-flex;
    align-items:center;
    margin-left:6px;
    cursor:help;
}

.help-tip i{
    color:#00A7EC;
    font-size:14px;
}

.help-text{
    display:none;
    position:absolute;
    left:22px;
    top:50%;
    transform:translateY(-50%);
    background:#002A54;
    color:#fff;
    padding:10px 12px;
    border-radius:8px;
    width:240px;
    font-size:12px;
    line-height:1.4;
    z-index:99999;
    box-shadow:0 4px 14px rgba(0,0,0,.25);
}

.help-tip:hover .help-text{
    display:block;
}

/* =============================================
   RESPONSIVO MOBILE -- bloco unico e consolidado
   (antes estava espalhado e duplicado em varios
   lugares do arquivo, causando conflito)
   ============================================= */

@media (max-width:1000px){
    .grid-4{ grid-template-columns:repeat(2,1fr); }
    .grid-3{ grid-template-columns:repeat(2,1fr); }
}

@media (max-width:900px){
    .kpi-grid{ grid-template-columns:1fr; }
}

@media (max-width:800px){
    .summary-card{ grid-template-columns:1fr; }
    .header-actions{ width:100%; flex-wrap:wrap; }
}

@media (max-width:768px){

    /* Login */
    .inx-login-page{ flex-direction:column; }
    .inx-brand{ width:100%; padding:32px 24px 20px; }
    .inx-brand h1{ font-size:36px; }
    .inx-brand h4{ font-size:15px; }
    .inx-brand p{ display:none; }
    .inx-login-area{ width:100%; padding:24px; flex:1; }
    .inx-card{ width:100%; padding:28px 24px; border-radius:18px; }
    .inx-form-group input{ font-size:16px; padding:13px 14px; }
    .inx-login-button{ padding:15px; min-height:48px; }

    /* Sidebar escondida por padrao, desliza pra dentro quando .aberta */
    .sidebar{
        transform:translateX(-100%);
        width:260px;
        z-index:9999;
    }

    .sidebar.aberta{
        transform:translateX(0);
    }

    .sidebar-overlay{
        z-index:9998;
    }

    /* Conteudo ocupa a tela toda, sem reservar espaco pra sidebar */
    .main{
        margin-left:0;
    }

    /* Topbar com botao hamburguer visivel */
    .topbar{
        padding:0 16px;
        height:56px;
        position:sticky;
        top:0;
        z-index:100;
        font-size:13px;
    }

    .btn-hamburguer{
        display:flex;
        align-items:center;
        justify-content:center;
        width:38px;
        height:38px;
        background:none;
        border:none;
        cursor:pointer;
        font-size:22px;
        color:var(--azul-principal);
        margin-right:10px;
        padding:0;
    }

    .content{
        padding:16px;
    }

    .kpi-grid,
    .grid-2,
    .grid-3,
    .grid-4{
        grid-template-columns:1fr;
    }

    .page-header{
        flex-direction:column;
        align-items:flex-start;
        gap:10px;
    }

    .form-footer,
    .form-actions{
        flex-direction:column;
    }

    /* Rede de seguranca pra tabelas que nao tem o wrapper
       table-responsive -- sem isso, uma tabela larga forcaria a
       pagina inteira a rolar de lado. Assim, so a tabela rola. */
    table{
        display:block;
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
        white-space:nowrap;
    }

    .table-responsive table{
        white-space:normal;
    }

    .table-responsive,
    .card-inx,
    .card{
        overflow-x:auto;
    }
}

@media (max-width:380px){
    .inx-brand{ padding:24px 18px 16px; }
    .inx-brand h1{ font-size:30px; }
    .inx-card{ padding:22px 18px; }
}


/* =========================================================
   CORREÇÃO GLOBAL — SEM ROLAGEM HORIZONTAL + RESPIRO DO MENU
   ========================================================= */

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

body{
    min-width:0;
}

/* Sidebar tem 260px. O respiro cria o espaço branco entre menu e conteúdo. */
.main{
    margin-left:276px; /* 260px do menu + 16px de respiro */
    width:auto;
    max-width:calc(100vw - 276px);
    min-width:0;
    overflow-x:hidden;
    transition:margin-left .25s ease;
}

.content{
    width:100%;
    max-width:100%;
    min-width:0;
}

.topbar{
    width:100%;
    max-width:100%;
    min-width:0;
    border-radius:0 0 0 12px;
}

.page-header,
.header-actions,
.card,
.card-inx,
.kpi-grid,
.grid-2,
.grid-3,
.grid-4,
.filter-bar,
.summary-card,
.detail-grid,
.detail-list{
    min-width:0;
    max-width:100%;
}

.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.kpi-grid > *{
    min-width:0;
}

img,
svg,
canvas,
iframe{
    max-width:100%;
}

.table-responsive{
    display:block;
    width:100%;
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

.table-responsive .table{
    width:100%;
    max-width:none;
}

@media (max-width:768px){
    .main{
        width:100%;
        max-width:100vw;
        margin-left:0;
    }

    .content{
        width:100%;
        max-width:100vw;
        overflow-x:hidden;
    }

    .topbar{
        width:100%;
        max-width:100vw;
        border-radius:0;
    }
}
