/* TrairiObras 3.36.24.93.33 · 9365
   Interface moderna cumulativa + temas Verde/Azul/Escuro.
   Preserva a semântica dos componentes existentes e moderniza apenas apresentação. */
:root{
  --brand-950:#062b24;--brand-900:#07382e;--brand-800:#0a4a3b;--brand-700:#0f654f;
  --brand-600:#13805f;--brand-500:#1b966e;--brand-100:#dff3e9;--brand-50:#f3fbf7;
  --surface-0:#f3f7f4;--surface-1:#ffffff;--surface-2:#f8faf9;--surface-3:#eef4f0;
  --text-1:#14221b;--text-2:#526159;--text-3:#7b8780;--stroke:#d8e2dc;--stroke-strong:#c4d2ca;
  --accent:#13795b;--accent-hover:#0d654b;--accent-soft:#e7f5ee;--success:#147a50;--warning:#a66b00;--danger:#b42318;
  --shadow-soft:0 10px 30px rgba(18,43,31,.06);--shadow-card:0 16px 40px rgba(15,40,28,.08);
  --radius-sm:9px;--radius-md:14px;--radius-lg:18px;--sidebar-w:264px;
}

html[data-theme="verde"]{color-scheme:light}
html[data-theme="azul"]{color-scheme:light}
html[data-theme="escuro"]{color-scheme:dark}
html[data-theme="azul"]{
  --brand-950:#071b35;--brand-900:#0d2748;--brand-800:#12365f;--brand-700:#174978;--brand-600:#1769a8;--brand-500:#2486cb;--brand-100:#e3f1fb;--brand-50:#f3f8fd;
  --surface-0:#f2f6fb;--surface-1:#fff;--surface-2:#f8fafc;--surface-3:#edf3f8;--text-1:#142033;--text-2:#56657a;--text-3:#7d8999;--stroke:#d9e2ec;--stroke-strong:#c6d3e0;
  --accent:#1769a8;--accent-hover:#12588d;--accent-soft:#e7f2fa;--shadow-soft:0 10px 30px rgba(18,44,76,.06);--shadow-card:0 16px 40px rgba(15,45,78,.08);
}
html[data-theme="escuro"]{
  --brand-950:#090b0d;--brand-900:#0e1114;--brand-800:#15191d;--brand-700:#1e2429;--brand-600:#2b3339;--brand-500:#3b464d;--brand-100:#1f2a25;--brand-50:#141a17;
  --surface-0:#0f1214;--surface-1:#171b1e;--surface-2:#1b2024;--surface-3:#22282d;--text-1:#f4f7f5;--text-2:#b2bcb6;--text-3:#88938d;--stroke:#2e363b;--stroke-strong:#3a444a;
  --accent:#61d19d;--accent-hover:#7de0b2;--accent-soft:#163c2d;--success:#61d19d;--warning:#e6b64e;--danger:#ff8378;
  --shadow-soft:0 10px 30px rgba(0,0,0,.20);--shadow-card:0 18px 46px rgba(0,0,0,.28);
}

/* Mapeia os tokens legados para o novo sistema visual. */
:root,html[data-theme]{
  --bg:var(--surface-0);--panel:var(--surface-1);--ink:var(--text-1);--muted:var(--text-2);--line:var(--stroke);
  --nav:var(--brand-950);--nav2:var(--brand-800);--soft:var(--accent-soft);--shadow:var(--shadow-soft);
}

html,body{background:var(--surface-0);color:var(--text-1)}
body{font-feature-settings:"ss01" 1,"cv02" 1;-webkit-font-smoothing:antialiased}
.app-shell{background:var(--surface-0)}
.sidebar{width:var(--sidebar-w)!important;background:linear-gradient(180deg,var(--brand-950),var(--brand-900) 62%,color-mix(in srgb,var(--brand-900) 86%,#000))!important;padding:18px 14px!important;border-right:1px solid rgba(255,255,255,.04);box-shadow:12px 0 32px rgba(0,0,0,.08)}
.main{margin-left:var(--sidebar-w)!important;width:calc(100% - var(--sidebar-w))!important;min-width:0}
.brand{padding:2px 8px 18px!important;gap:12px!important}.brand-logo{width:45px;height:45px;object-fit:cover;border-radius:13px;background:#fff;padding:2px;box-shadow:0 5px 15px rgba(0,0,0,.16)}
.brand strong{font-size:15px!important;letter-spacing:-.01em}.brand span{color:rgba(235,245,239,.66)!important;line-height:1.35}
.sidebar nav{gap:3px!important}.sidebar nav a{color:rgba(232,242,236,.78)!important;padding:10px 11px!important;border-radius:10px!important;font-size:13px!important;transition:.15s ease;background:transparent}
.sidebar nav a:hover{background:rgba(255,255,255,.07)!important;color:#fff!important;transform:translateX(1px)}.sidebar nav a.active{background:rgba(255,255,255,.12)!important;color:#fff!important;box-shadow:inset 3px 0 0 var(--accent)}
.nav-section{color:rgba(219,233,225,.43)!important;font-size:8.5px!important;letter-spacing:.14em!important;padding:17px 11px 6px!important}
.sidebar nav em{background:rgba(255,255,255,.10)!important;color:#e9f5ee!important}.sidebar-foot{border-top-color:rgba(255,255,255,.10)!important;background:transparent!important}.sidebar-foot small{color:rgba(232,242,236,.66)!important}
.sidebar-history-seal{margin:9px 4px 0;padding:9px 10px;border:1px solid rgba(255,255,255,.10);border-radius:10px;color:rgba(237,245,240,.62);font-size:9px;line-height:1.4}.sidebar-history-seal b{display:block;color:#fff;font-size:10px;margin-bottom:2px}

.topbar{min-height:78px!important;padding:16px 30px!important;background:color-mix(in srgb,var(--surface-1) 94%,transparent)!important;border-bottom:1px solid var(--stroke)!important;backdrop-filter:blur(16px);box-shadow:0 1px 0 rgba(12,35,22,.03)!important}
.topbar h1{font-size:21px!important;letter-spacing:-.02em;color:var(--text-1)}.topbar p{color:var(--text-2)!important}.top-actions{align-items:center!important;flex-wrap:wrap!important;justify-content:flex-end}
.content{padding:24px 30px 52px!important;max-width:1760px!important}

.global-search{display:flex;align-items:center;min-width:250px;max-width:390px;flex:1}.global-search input{height:38px;border-radius:11px 0 0 11px!important;border-right:0!important;background:var(--surface-2)!important}.global-search button{height:38px;border-radius:0 11px 11px 0!important;padding:0 12px!important}
.theme-switcher{display:flex;align-items:center;gap:3px;padding:3px;border:1px solid var(--stroke);border-radius:11px;background:var(--surface-2);box-shadow:0 4px 14px rgba(0,0,0,.03)}
.theme-switcher button{appearance:none;border:0;background:transparent;color:var(--text-2);min-width:32px;height:30px;border-radius:8px;padding:0 8px;font-size:11px;font-weight:800;cursor:pointer}.theme-switcher button:hover{background:var(--surface-3)}.theme-switcher button.active{background:var(--surface-1);color:var(--text-1);box-shadow:0 2px 8px rgba(0,0,0,.08)}

.btn{border-color:var(--stroke)!important;background:var(--surface-1)!important;color:var(--text-1)!important;border-radius:10px!important;box-shadow:0 1px 0 rgba(0,0,0,.02);transition:.15s ease}.btn:hover{border-color:var(--stroke-strong)!important;background:var(--surface-2)!important;transform:translateY(-1px)}.btn.primary{background:var(--accent)!important;border-color:var(--accent)!important;color:#fff!important}.btn.primary:hover{background:var(--accent-hover)!important}
input,select,textarea{background:var(--surface-1)!important;color:var(--text-1)!important;border-color:var(--stroke)!important;border-radius:10px!important}input::placeholder,textarea::placeholder{color:var(--text-3)}input:focus,select:focus,textarea:focus{border-color:var(--accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)!important}

.panel,.metric,.module-card,.req-action-card,.process-summary,.list-item,.ad-card{border-color:var(--stroke)!important;background:var(--surface-1)!important;box-shadow:var(--shadow-soft)!important}.panel,.metric,.module-card,.req-action-card{border-radius:var(--radius-md)!important}.panel{padding:19px!important;margin-bottom:18px!important}.panel-head{margin-bottom:14px!important}.panel h2,.panel-head h2{color:var(--text-1)!important;font-size:16px!important;letter-spacing:-.01em}.panel-head p,.muted,.identity-source,.identity-fallback,.applicant-select-note{color:var(--text-2)!important}
.metric{padding:17px!important;position:relative;overflow:hidden}.metric:after{content:"";position:absolute;right:-16px;top:-24px;width:90px;height:90px;border-radius:50%;background:color-mix(in srgb,var(--accent) 9%,transparent)}.metric strong{font-size:30px!important;letter-spacing:-.04em}.metric span,.metric small{position:relative;z-index:1}
.status{background:var(--surface-3)!important;color:var(--text-2)!important;border:1px solid var(--stroke);font-weight:800!important}.status.aprovado,.status.deferido{background:color-mix(in srgb,var(--success) 13%,var(--surface-1))!important;color:var(--success)!important;border-color:color-mix(in srgb,var(--success) 25%,var(--stroke))!important}.status.em-analise{background:color-mix(in srgb,var(--accent) 10%,var(--surface-1))!important;color:var(--accent)!important}.status.com-pendencia,.status.devolutiva-emitida{background:color-mix(in srgb,var(--warning) 12%,var(--surface-1))!important;color:var(--warning)!important}
.table-wrap{border:1px solid var(--stroke);border-radius:12px;overflow:auto;background:var(--surface-1)}table{background:var(--surface-1)}th{background:var(--surface-2);color:var(--text-2)!important;border-bottom-color:var(--stroke)!important;padding:11px 12px!important}td{border-bottom-color:color-mix(in srgb,var(--stroke) 70%,transparent)!important;padding:12px!important}tbody tr:hover td{background:color-mix(in srgb,var(--accent) 3.5%,var(--surface-1))}
.list-item{border-bottom-color:var(--stroke)!important}.module-card:hover{border-color:color-mix(in srgb,var(--accent) 45%,var(--stroke))!important;transform:translateY(-2px);box-shadow:var(--shadow-card)!important}.module-card>span{background:var(--accent-soft)!important;color:var(--accent)!important}
.alert.warning{background:color-mix(in srgb,var(--warning) 9%,var(--surface-1))!important;color:var(--warning)!important;border-color:color-mix(in srgb,var(--warning) 25%,var(--stroke))!important}.alert.danger{background:color-mix(in srgb,var(--danger) 9%,var(--surface-1))!important;color:var(--danger)!important;border-color:color-mix(in srgb,var(--danger) 25%,var(--stroke))!important}.report-success,.dashboard-delete-success{background:color-mix(in srgb,var(--success) 10%,var(--surface-1))!important;color:var(--success)!important;border-color:color-mix(in srgb,var(--success) 25%,var(--stroke))!important}

/* Dashboard 9365 */
.dashboard-hero{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(300px,.8fr);gap:18px;margin-bottom:18px}.hero-overview{background:linear-gradient(135deg,var(--brand-900),var(--brand-700));color:#fff;border-radius:18px;padding:22px;min-height:170px;box-shadow:var(--shadow-card);position:relative;overflow:hidden}.hero-overview:after{content:"";position:absolute;width:240px;height:240px;border-radius:50%;right:-80px;top:-90px;background:rgba(255,255,255,.07)}.hero-overview .kicker{font-size:10px;font-weight:900;letter-spacing:.13em;text-transform:uppercase;color:rgba(255,255,255,.66)}.hero-overview h2{font-size:24px;margin:8px 0 7px;letter-spacing:-.03em}.hero-overview p{max-width:680px;margin:0;color:rgba(255,255,255,.75);font-size:12px;line-height:1.55}.hero-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}.hero-actions .btn{background:rgba(255,255,255,.96)!important;color:var(--brand-900)!important;border-color:transparent!important}.hero-actions .btn.secondary{background:rgba(255,255,255,.10)!important;color:#fff!important;border-color:rgba(255,255,255,.20)!important}
.dashboard-map-preview{position:relative;border:1px solid var(--stroke);border-radius:18px;background:var(--surface-1);box-shadow:var(--shadow-soft);overflow:hidden;min-height:170px}.dashboard-map-preview img{width:100%;height:100%;min-height:170px;object-fit:cover;filter:saturate(.75) contrast(.96);opacity:.85}.dashboard-map-preview:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,transparent 36%,rgba(4,25,18,.82))}.dashboard-map-caption{position:absolute;z-index:2;left:15px;right:15px;bottom:13px;color:#fff;display:flex;align-items:flex-end;justify-content:space-between;gap:10px}.dashboard-map-caption strong{display:block;font-size:14px}.dashboard-map-caption span{display:block;font-size:10px;opacity:.75;margin-top:2px}.dashboard-map-caption a{color:#fff;font-size:11px;font-weight:800}
.dashboard-metrics{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:12px!important;margin-bottom:18px!important}.metric-icon{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent);font-size:14px;font-weight:900;margin-bottom:11px}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(310px,.65fr);gap:18px}.dashboard-side{display:grid;align-content:start;gap:18px}.dashboard-side .panel{margin-bottom:0!important}.movement-grid{display:grid;gap:12px}.movement-row{display:grid;grid-template-columns:130px minmax(80px,1fr) 44px;align-items:center;gap:10px}.movement-row span{font-size:11px;color:var(--text-2);font-weight:750}.movement-bar{height:8px;background:var(--surface-3);border-radius:999px;overflow:hidden}.movement-bar i{display:block;height:100%;background:var(--accent);border-radius:999px}.movement-row.warn .movement-bar i{background:var(--warning)}.movement-row.ok .movement-bar i{background:var(--success)}.movement-row b{text-align:right;font-size:12px}.attention-list{display:grid;gap:9px}.attention-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px;border:1px solid var(--stroke);border-radius:11px;background:var(--surface-2);color:inherit}.attention-item:hover{border-color:color-mix(in srgb,var(--accent) 38%,var(--stroke))}.attention-dot{width:9px;height:9px;border-radius:50%;background:var(--warning);box-shadow:0 0 0 4px color-mix(in srgb,var(--warning) 12%,transparent)}.attention-item strong{font-size:12px;display:block}.attention-item small{font-size:10px;color:var(--text-2);display:block;margin-top:2px}.attention-item b{font-size:10px;color:var(--accent)}.recent-activity{display:grid;gap:10px}.recent-activity-item{display:grid;grid-template-columns:30px 1fr;gap:10px}.recent-activity-icon{width:30px;height:30px;border-radius:9px;background:var(--surface-3);display:grid;place-items:center;color:var(--accent);font-size:11px;font-weight:900}.recent-activity-item strong{display:block;font-size:11px}.recent-activity-item span{display:block;font-size:10px;color:var(--text-2);margin-top:2px}

/* Requerentes / Processos */
.priority-kicker{color:var(--accent)!important}.req-action-card{min-height:150px!important;transition:.16s ease}.req-action-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-card)!important;border-color:color-mix(in srgb,var(--accent) 30%,var(--stroke))!important}.req-action-card h3{color:var(--text-1)!important}.req-action-card p{color:var(--text-2)!important}.document-first-help,.process-owner-box{background:var(--surface-2)!important;border-color:var(--stroke)!important}
.proc-tabs{padding:4px;border:1px solid var(--stroke);background:var(--surface-2);border-radius:12px;display:inline-flex!important;max-width:100%}.proc-tab{border:0!important;background:transparent!important;color:var(--text-2)!important;border-radius:9px!important}.proc-tab.active{background:var(--surface-1)!important;color:var(--text-1)!important;box-shadow:0 2px 8px rgba(0,0,0,.07)}.proc-tab b{background:var(--surface-3)!important;color:var(--text-2)!important}.process-table-actions{display:flex;gap:6px;justify-content:flex-end}.process-table-actions a{font-size:11px;font-weight:800}.archive-badge{border-color:var(--stroke)!important}.archive-badge.complete{background:color-mix(in srgb,var(--success) 10%,var(--surface-1))!important;color:var(--success)}.archive-badge.missing{background:color-mix(in srgb,var(--warning) 10%,var(--surface-1))!important;color:var(--warning)}

/* Tema escuro: neutraliza fundos brancos hardcoded dos componentes mais usados. */
html[data-theme="escuro"] .panel,html[data-theme="escuro"] .metric,html[data-theme="escuro"] .module-card,html[data-theme="escuro"] .req-action-card,html[data-theme="escuro"] .process-summary>div,html[data-theme="escuro"] .ad-card,html[data-theme="escuro"] .list-item,html[data-theme="escuro"] .applicant-delete-form,html[data-theme="escuro"] .mobile-cards tr,html[data-theme="escuro"] .auto-mobile-cards tr{background:var(--surface-1)!important;color:var(--text-1)!important}
html[data-theme="escuro"] .collapsible-summary,html[data-theme="escuro"] .check-row:hover,html[data-theme="escuro"] .panel-section h3,html[data-theme="escuro"] .switch-line,html[data-theme="escuro"] .backup-includes>div,html[data-theme="escuro"] .backup-runtime-grid>div{background:var(--surface-2)!important;color:var(--text-1)!important}
html[data-theme="escuro"] table,html[data-theme="escuro"] th,html[data-theme="escuro"] td{color:var(--text-1)}

/* Login 9365 */
.login-body{background:radial-gradient(circle at 18% 10%,color-mix(in srgb,var(--brand-700) 80%,#fff),var(--brand-950) 58%)!important}.login-card{background:var(--surface-1)!important;border:1px solid color-mix(in srgb,var(--stroke) 60%,transparent);box-shadow:0 30px 90px rgba(0,0,0,.30)!important}.login-card .login-note{margin-top:18px;padding:10px 12px;border:1px solid var(--stroke);border-radius:10px;background:var(--surface-2);color:var(--text-2);font-size:11px;line-height:1.5}

@media(max-width:1250px){.dashboard-metrics{grid-template-columns:repeat(3,minmax(0,1fr))!important}.dashboard-grid{grid-template-columns:1fr}.dashboard-side{grid-template-columns:1fr 1fr}}
@media(max-width:980px){.dashboard-hero{grid-template-columns:1fr}.dashboard-map-preview{min-height:190px}.global-search{display:none}.theme-switcher button{padding:0 7px}}
@media(max-width:760px){.sidebar{width:100%!important}.main{margin-left:0!important;width:100%!important}.content{padding:16px!important}.topbar{padding:13px 16px!important;min-height:68px!important}.dashboard-metrics{grid-template-columns:1fr 1fr!important}.dashboard-side{grid-template-columns:1fr}.movement-row{grid-template-columns:105px minmax(70px,1fr) 36px}.theme-switcher button span{display:none}.theme-switcher button{min-width:30px;padding:0 6px}}
@media(max-width:460px){.dashboard-metrics{grid-template-columns:1fr!important}.dashboard-hero{gap:12px}.hero-overview{padding:18px}.hero-overview h2{font-size:21px}.proc-tabs{display:flex!important;width:100%;overflow-x:auto}.proc-tab{flex:0 0 auto}}
