/* ============================================================
   AgroPrime — Gestão de Crédito Rural
   Tema: luxo escuro · dourado · esmeralda
   ============================================================ */

:root{
  --bg:        #0a0e0c;
  --bg-soft:   #0e1411;
  --panel:     #121a16;
  --panel-2:   #17211c;
  --panel-3:   #1d2922;
  --line:      rgba(212,175,55,.14);
  --line-soft: rgba(255,255,255,.06);
  --gold:      #d4af37;
  --gold-2:    #f0d77b;
  --gold-dim:  rgba(212,175,55,.55);
  --green:     #34a06d;
  --green-2:   #5ec795;
  --text:      #ece9dd;
  --muted:     #97a39a;
  --faint:     #6b766e;
  --red:       #e07070;
  --blue:      #74a8e0;
  --orange:    #e0a35c;
  --shadow:    0 14px 40px rgba(0,0,0,.45);
  --radius:    14px;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-disp: 'Playfair Display', Georgia, serif;
}

*{ box-sizing:border-box; margin:0; padding:0 }

html,body{ height:100% }
body{
  font-family:var(--font-body);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(212,175,55,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(52,160,109,.07), transparent 60%),
    var(--bg);
  color:var(--text);
  font-size:14.5px;
  -webkit-font-smoothing:antialiased;
}

::selection{ background:rgba(212,175,55,.3) }

/* scrollbars */
::-webkit-scrollbar{ width:10px; height:10px }
::-webkit-scrollbar-track{ background:transparent }
::-webkit-scrollbar-thumb{ background:#243029; border-radius:8px; border:2px solid var(--bg) }
::-webkit-scrollbar-thumb:hover{ background:#33453b }

/* ============ LAYOUT ============ */
#app{ display:flex; min-height:100vh }

#sidebar{
  width:248px; flex-shrink:0;
  background:linear-gradient(180deg,#0d1310 0%, #0a0e0c 100%);
  border-right:1px solid var(--line);
  display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh;
}

.brand{
  display:flex; align-items:center; gap:12px;
  padding:26px 22px 22px;
  border-bottom:1px solid var(--line);
}
.brand-mark{
  width:42px; height:42px; border-radius:12px;
  display:grid; place-items:center;
  font-size:20px; color:#0a0e0c;
  background:linear-gradient(135deg,var(--gold-2),var(--gold) 60%,#9a7b1e);
  box-shadow:0 4px 18px rgba(212,175,55,.35);
}
.brand-name{
  display:block; font-family:var(--font-disp);
  font-size:19px; font-weight:700; letter-spacing:.4px;
  background:linear-gradient(90deg,var(--gold-2),var(--gold));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:150px;
}
.brand-sub{
  display:block; font-size:10.5px; letter-spacing:2.6px; text-transform:uppercase;
  color:var(--muted); margin-top:2px;
}

#nav{ padding:16px 12px; display:flex; flex-direction:column; gap:3px; flex:1; overflow-y:auto }
.nav-label{
  font-size:10px; letter-spacing:2.2px; text-transform:uppercase;
  color:var(--faint); padding:14px 12px 6px;
}
.nav-btn{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px; border-radius:10px;
  background:none; border:1px solid transparent;
  color:var(--muted); font-family:inherit; font-size:14px; font-weight:500;
  cursor:pointer; text-align:left; width:100%;
  transition:all .18s ease;
}
.nav-btn svg{ width:18px; height:18px; flex-shrink:0; stroke:currentColor }
.nav-btn:hover{ color:var(--text); background:rgba(255,255,255,.04) }
.nav-btn.active{
  color:var(--gold-2);
  background:linear-gradient(90deg, rgba(212,175,55,.13), rgba(212,175,55,.03));
  border-color:rgba(212,175,55,.22);
}

.sidebar-foot{ padding:18px 22px 22px }
.foot-line{ height:1px; background:var(--line); margin-bottom:14px }
.sidebar-foot p{ font-size:11.5px; color:var(--faint); line-height:1.6 }
.sidebar-foot b{ color:var(--muted) }

#main{ flex:1; min-width:0; padding:28px 34px 60px }

#topbar{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:16px; margin-bottom:26px; flex-wrap:wrap;
}
#view-title{
  font-family:var(--font-disp); font-size:30px; font-weight:600; letter-spacing:.3px;
}
#view-sub{ color:var(--muted); margin-top:4px; font-size:13.5px }
#topbar-actions{ display:flex; gap:10px; flex-wrap:wrap }

/* ============ COMPONENTES ============ */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 18px; border-radius:10px;
  font-family:inherit; font-size:13.5px; font-weight:600;
  cursor:pointer; transition:all .18s ease;
  border:1px solid var(--line-soft);
  background:var(--panel-2); color:var(--text);
  white-space:nowrap;
}
.btn:hover{ background:var(--panel-3); transform:translateY(-1px) }
.btn.gold{
  background:linear-gradient(135deg,var(--gold-2),var(--gold) 70%);
  color:#161104; border:none;
  box-shadow:0 4px 16px rgba(212,175,55,.28);
}
.btn.gold:hover{ box-shadow:0 6px 22px rgba(212,175,55,.4) }
.btn.ghost{ background:transparent; border-color:var(--line); color:var(--gold-dim) }
.btn.ghost:hover{ color:var(--gold-2); border-color:var(--gold-dim) }
.btn.danger{ color:var(--red) }
.btn.sm{ padding:6px 12px; font-size:12.5px; border-radius:8px }

.icon-btn{
  width:30px; height:30px; border-radius:8px; display:inline-grid; place-items:center;
  background:transparent; border:1px solid transparent; color:var(--muted);
  cursor:pointer; font-size:14px; transition:all .15s;
}
.icon-btn:hover{ background:var(--panel-3); color:var(--gold-2); border-color:var(--line) }
.icon-btn.danger:hover{ color:var(--red); border-color:rgba(224,112,112,.3) }

.card{
  background:linear-gradient(160deg, var(--panel) 0%, var(--bg-soft) 100%);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card-pad{ padding:22px }
.card-title{
  font-family:var(--font-disp); font-size:17px; font-weight:600;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-bottom:16px;
}
.card-title small{ font-family:var(--font-body); font-size:12px; color:var(--muted); font-weight:400 }

/* toolbar de filtros */
.toolbar{
  display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:18px;
}
.toolbar .spacer{ flex:1 }

input,select,textarea{
  font-family:inherit; font-size:13.5px; color:var(--text);
  background:var(--bg-soft); border:1px solid var(--line-soft);
  border-radius:10px; padding:10px 13px; outline:none;
  transition:border .15s, box-shadow .15s;
}
input:focus,select:focus,textarea:focus{
  border-color:var(--gold-dim); box-shadow:0 0 0 3px rgba(212,175,55,.12);
}
input::placeholder{ color:var(--faint) }
select{ cursor:pointer }
select option{ background:#141c17; color:var(--text) }

.search{ min-width:240px; background:var(--bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2397a39a' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 12px center; padding-left:38px }

/* tabelas */
.table-wrap{ overflow-x:auto; border-radius:var(--radius) }
table{ width:100%; border-collapse:collapse; min-width:640px }
thead th{
  text-align:left; font-size:10.5px; letter-spacing:1.6px; text-transform:uppercase;
  color:var(--faint); font-weight:600;
  padding:13px 14px; border-bottom:1px solid var(--line);
  white-space:nowrap;
}
tbody td{
  padding:13px 14px; border-bottom:1px solid var(--line-soft);
  vertical-align:middle;
}
tbody tr{ transition:background .12s }
tbody tr:hover{ background:rgba(212,175,55,.04) }
tbody tr:last-child td{ border-bottom:none }
td.num, th.num{ text-align:right; font-variant-numeric:tabular-nums }
td.actions{ text-align:right; white-space:nowrap }
.row-click{ cursor:pointer }
.cell-main{ font-weight:600 }
.cell-sub{ font-size:12px; color:var(--muted); margin-top:2px }

/* badges */
.badge{
  display:inline-block; padding:4px 11px; border-radius:999px;
  font-size:11px; font-weight:600; letter-spacing:.4px; white-space:nowrap;
  font-family:inherit; background:none;
}
.badge.green { background:rgba(52,160,109,.16); color:var(--green-2); border:1px solid rgba(52,160,109,.35) }
.badge.gold  { background:rgba(212,175,55,.13); color:var(--gold-2);  border:1px solid rgba(212,175,55,.35) }
.badge.blue  { background:rgba(116,168,224,.13); color:var(--blue);   border:1px solid rgba(116,168,224,.3) }
.badge.orange{ background:rgba(224,163,92,.13);  color:var(--orange); border:1px solid rgba(224,163,92,.3) }
.badge.red   { background:rgba(224,112,112,.13); color:var(--red);    border:1px solid rgba(224,112,112,.3) }
.badge.grey  { background:rgba(255,255,255,.06); color:var(--muted);  border:1px solid var(--line-soft) }

.bank-chip{
  display:inline-flex; align-items:center; gap:6px;
  font-size:11.5px; font-weight:700; letter-spacing:.6px;
  padding:3px 10px; border-radius:7px;
}
.bank-BB      { background:rgba(240,215,123,.12); color:#f0d77b }
.bank-BASA    { background:rgba(94,199,149,.12);  color:#5ec795 }
.bank-SICREDI { background:rgba(116,168,224,.12); color:#74a8e0 }
.bank-OUTRO   { background:rgba(255,255,255,.07); color:var(--muted) }

/* tabs */
.tabs{ display:flex; gap:6px; flex-wrap:wrap }
.tab{
  padding:8px 16px; border-radius:999px; cursor:pointer;
  font-size:13px; font-weight:600; color:var(--muted);
  background:transparent; border:1px solid var(--line-soft);
  font-family:inherit; transition:all .15s;
}
.tab:hover{ color:var(--text) }
.tab.active{
  color:#161104; border-color:transparent;
  background:linear-gradient(135deg,var(--gold-2),var(--gold));
}

/* ============ DASHBOARD ============ */
.kpi-grid{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(215px,1fr));
  gap:16px; margin-bottom:22px;
}
.kpi{
  position:relative; overflow:hidden;
  padding:20px 22px;
}
.kpi::after{
  content:''; position:absolute; inset:auto -30px -40px auto;
  width:110px; height:110px; border-radius:50%;
  background:radial-gradient(circle, rgba(212,175,55,.12), transparent 70%);
}
.kpi .k-label{ font-size:11px; letter-spacing:1.8px; text-transform:uppercase; color:var(--muted) }
.kpi .k-value{
  font-family:var(--font-disp); font-size:30px; font-weight:700;
  margin-top:8px; color:var(--text); line-height:1.1;
}
.kpi .k-value.gold{ background:linear-gradient(90deg,var(--gold-2),var(--gold)); -webkit-background-clip:text; background-clip:text; color:transparent }
.kpi .k-value.green{ color:var(--green-2) }
.kpi .k-value.orange{ color:var(--orange) }
.kpi .k-foot{ font-size:12px; color:var(--faint); margin-top:6px }

.dash-grid{ display:grid; grid-template-columns:1.1fr .9fr; gap:16px; margin-bottom:16px }
.dash-grid-3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px }
@media (max-width:1100px){ .dash-grid,.dash-grid-3{ grid-template-columns:1fr } }

/* donut + legenda */
.donut-wrap{ display:flex; align-items:center; gap:26px; flex-wrap:wrap }
.donut-hole-label{ font-family:var(--font-disp); font-size:26px; font-weight:700; fill:var(--text) }
.donut-hole-sub{ font-size:10px; letter-spacing:1.5px; fill:var(--muted); text-transform:uppercase }
.legend{ display:flex; flex-direction:column; gap:9px; flex:1; min-width:180px }
.legend-item{ display:flex; align-items:center; gap:10px; font-size:13px }
.legend-dot{ width:10px; height:10px; border-radius:3px; flex-shrink:0 }
.legend-item b{ margin-left:auto; font-variant-numeric:tabular-nums }
.legend-item span{ color:var(--muted) }

/* barras horizontais */
.hbar{ margin-bottom:14px }
.hbar .hb-top{ display:flex; justify-content:space-between; font-size:12.5px; margin-bottom:6px }
.hbar .hb-top span{ color:var(--muted) }
.hbar .hb-top b{ font-variant-numeric:tabular-nums }
.hbar .hb-track{ height:8px; border-radius:99px; background:rgba(255,255,255,.05); overflow:hidden }
.hbar .hb-fill{ height:100%; border-radius:99px; background:linear-gradient(90deg,var(--gold),var(--gold-2)) ; transition:width .6s ease }
.hbar .hb-fill.green{ background:linear-gradient(90deg,#1f7a4f,var(--green-2)) }

.mini-list{ display:flex; flex-direction:column }
.mini-item{
  display:flex; align-items:center; gap:12px;
  padding:11px 2px; border-bottom:1px solid var(--line-soft);
}
.mini-item:last-child{ border-bottom:none }
.mini-item .mi-text{ flex:1; min-width:0 }
.mini-item .mi-name{ font-weight:600; font-size:13.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.mini-item .mi-sub{ font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.mini-item .mi-end{ font-size:12px; color:var(--faint); white-space:nowrap }

/* ============ KANBAN ============ */

/* barra de scroll no TOPO — espelha a do wrap */
.kanban-top-scroll{
  overflow-x:auto; overflow-y:hidden;
  height:14px; margin-bottom:6px;
  border-radius:6px;
}
.kanban-top-scroll::-webkit-scrollbar{ height:8px }
.kanban-top-scroll::-webkit-scrollbar-track{ background:rgba(255,255,255,.04); border-radius:6px }
.kanban-top-scroll::-webkit-scrollbar-thumb{ background:#2e3e36; border-radius:6px }
.kanban-top-scroll::-webkit-scrollbar-thumb:hover{ background:#3e5648 }

/* wrapper do kanban — scrollbar na base oculta (o drag já funciona; a de cima é a principal) */
.kanban-wrap{
  overflow-x:auto; padding-bottom:6px;
}
.kanban-wrap::-webkit-scrollbar{ height:8px }
.kanban-wrap::-webkit-scrollbar-track{ background:rgba(255,255,255,.04); border-radius:6px }
.kanban-wrap::-webkit-scrollbar-thumb{ background:#2e3e36; border-radius:6px }

.kanban{
  display:flex; gap:14px; align-items:start;
  min-width:max-content; padding-bottom:4px;
}
.kcol{
  background:var(--bg-soft); border:1px solid var(--line-soft);
  border-radius:var(--radius); padding:12px;
  min-width:250px; flex-shrink:0;
}
.kcol.dragover{ border-color:var(--gold-dim); background:rgba(212,175,55,.05) }
.kcol-head{
  display:flex; align-items:center; gap:8px; padding:4px 6px 12px;
}
.kcol-head .icon-btn{ opacity:0; transition:opacity .15s }
.kcol:hover .kcol-head .icon-btn{ opacity:1 }
.kcol-head .kc-dot{ width:8px; height:8px; border-radius:50% }
.kcol-head .kc-name{ font-size:12px; font-weight:700; letter-spacing:1.4px; text-transform:uppercase; color:var(--muted) }
.kcol-head .kc-count{
  margin-left:auto; font-size:11px; font-weight:700; color:var(--faint);
  background:rgba(255,255,255,.06); padding:2px 9px; border-radius:99px;
}
.kcard{
  background:var(--panel-2); border:1px solid var(--line-soft);
  border-radius:11px; padding:13px 14px; margin-bottom:10px;
  cursor:grab; transition:all .15s;
}
.kcard:hover{ border-color:var(--gold-dim); transform:translateY(-1px) }
.kcard:active{ cursor:grabbing }
.kcard .kc-client{ font-weight:600; font-size:13.5px; margin-bottom:4px }
.kcard .kc-line{ font-size:11.5px; color:var(--muted); margin-bottom:8px }
.kcard .kc-bottom{ display:flex; justify-content:space-between; align-items:center; gap:8px }
.kcard .kc-value{ font-weight:700; font-size:13px; color:var(--gold-2); font-variant-numeric:tabular-nums }
.kcard .kc-num{ font-size:11px; color:var(--faint) }
.kcard .kc-occ{ margin-top:8px; font-size:11px; color:var(--orange) }
.kcol-foot{
  padding:8px 6px 2px; font-size:12px; color:var(--faint);
  display:flex; justify-content:space-between; border-top:1px dashed var(--line-soft);
}
.kcol-foot b{ color:var(--muted) }

/* ============ MODAL ============ */
#modal-root:empty{ display:none }
.modal-backdrop{
  position:fixed; inset:0; z-index:90;
  background:rgba(4,6,5,.72); backdrop-filter:blur(6px);
  display:flex; align-items:flex-start; justify-content:center;
  padding:5vh 18px 18px; overflow-y:auto;
  animation:fadeIn .18s ease;
}
.modal{
  width:100%; max-width:560px;
  background:linear-gradient(160deg,#141d18, #0e1411);
  border:1px solid var(--line); border-radius:18px;
  box-shadow:0 30px 80px rgba(0,0,0,.6);
  animation:slideUp .22s ease;
}
.modal.wide{ max-width:880px }
.modal.preview{ max-width:1000px }
.modal.preview .modal-body{ padding:12px 16px }
.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:20px 24px; border-bottom:1px solid var(--line);
}
.modal-head h2{ font-family:var(--font-disp); font-size:20px; font-weight:600 }
.modal-body{ padding:22px 24px }
.modal-foot{
  display:flex; justify-content:flex-end; gap:10px;
  padding:16px 24px 22px;
}
@keyframes fadeIn{ from{opacity:0} }
@keyframes slideUp{ from{ opacity:0; transform:translateY(14px) } }

/* formulários */
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px }
.form-grid .full{ grid-column:1 / -1 }
@media (max-width:640px){ .form-grid{ grid-template-columns:1fr } }
.field label{
  display:block; font-size:11px; letter-spacing:1.4px; text-transform:uppercase;
  color:var(--muted); margin-bottom:6px; font-weight:600;
}
.field input,.field select,.field textarea{ width:100% }
.field textarea{ resize:vertical; min-height:70px }

.pass-wrap{ display:flex; gap:8px; align-items:center }
.pass-wrap input{ flex:1 }

/* detalhe do cliente */
.detail-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; margin-bottom:6px }
.detail-item .d-label{ font-size:10.5px; letter-spacing:1.5px; text-transform:uppercase; color:var(--faint); margin-bottom:3px }
.detail-item .d-value{ font-size:14px; font-weight:600 }
.section-label{
  font-size:11px; letter-spacing:2px; text-transform:uppercase; color:var(--gold-dim);
  margin:20px 0 10px; display:flex; align-items:center; gap:10px;
}
.section-label::after{ content:''; flex:1; height:1px; background:var(--line) }

/* itens da fatura */
.inv-items{ width:100% }
.inv-items th{ padding:8px 8px }
.inv-items td{ padding:6px 5px; border-bottom:none }
.inv-items input,.inv-items select{ width:100%; padding:8px 10px }
.inv-items .col-qty{ width:64px }
.inv-items .col-price{ width:120px }
.inv-items .col-sub{ width:110px; text-align:right; font-variant-numeric:tabular-nums; font-weight:600 }
.inv-items .col-x{ width:36px }
.inv-totals{
  margin-top:14px; padding-top:14px; border-top:1px solid var(--line);
  display:flex; flex-direction:column; gap:7px; align-items:flex-end;
}
.inv-totals .line{ display:flex; gap:24px; font-size:13.5px; color:var(--muted) }
.inv-totals .line b{ min-width:130px; text-align:right; color:var(--text); font-variant-numeric:tabular-nums }
.inv-totals .grand{ font-size:17px }
.inv-totals .grand b{ color:var(--gold-2); font-family:var(--font-disp); font-size:21px }

/* ============ TOAST ============ */
#toast-root{
  position:fixed; bottom:24px; right:24px; z-index:200;
  display:flex; flex-direction:column; gap:10px;
}
.toast{
  background:#16211b; border:1px solid var(--line);
  border-left:3px solid var(--gold);
  padding:13px 18px; border-radius:11px; font-size:13.5px;
  box-shadow:var(--shadow); min-width:230px;
  animation:slideUp .25s ease;
}
.toast.err{ border-left-color:var(--red) }

.empty{
  text-align:center; padding:46px 20px; color:var(--faint);
}
.empty .e-icon{ font-size:30px; margin-bottom:10px; opacity:.5 }

/* ============ DOCUMENTO (FATURA) ============ */
.doc{
  background:#fdfcf8; color:#1c1a14;
  border-radius:6px; padding:44px 48px;
  font-family:'Inter','Segoe UI',sans-serif; font-size:13px;
  max-width:800px; margin:0 auto;
}
.doc-head{
  display:flex; justify-content:space-between; gap:20px; align-items:flex-start;
  padding-bottom:20px; border-bottom:3px solid #b8962e;
}
.doc-co-name{ font-family:'Playfair Display',Georgia,serif; font-size:25px; font-weight:700; color:#8a6d1d }
.doc-co-sub{ font-size:12px; color:#6d6a5e; margin-top:3px }
.doc-co-info{ font-size:11.5px; color:#6d6a5e; margin-top:8px; line-height:1.6 }
.doc-meta{ text-align:right }
.doc-type{ font-size:11px; letter-spacing:2.5px; text-transform:uppercase; color:#6d6a5e }
.doc-number{ font-family:'Playfair Display',Georgia,serif; font-size:22px; font-weight:700; color:#1c1a14; margin-top:4px }
.doc-dates{ font-size:12px; color:#6d6a5e; margin-top:8px; line-height:1.7 }
.doc-section{
  font-size:10.5px; letter-spacing:2px; text-transform:uppercase; color:#8a6d1d;
  font-weight:700; margin:24px 0 8px;
}
.doc-client{ line-height:1.7 }
.doc-client b{ font-size:15px }
.doc table{ width:100%; border-collapse:collapse; min-width:0; margin-top:6px }
.doc thead th{
  background:#f3eedd; color:#5d5640; font-size:10.5px; letter-spacing:1.2px;
  padding:10px 12px; border-bottom:2px solid #d8cba0;
}
.doc tbody td{ padding:10px 12px; border-bottom:1px solid #e7e2d2; color:#1c1a14 }
.doc tbody tr:hover{ background:none }
.doc .t-num{ text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap }
.doc-totals{ margin-top:16px; display:flex; flex-direction:column; align-items:flex-end; gap:5px }
.doc-totals .line{ display:flex; gap:30px; font-size:13px; color:#5d5640 }
.doc-totals .line b{ min-width:120px; text-align:right; color:#1c1a14 }
.doc-totals .grand{
  margin-top:6px; padding:10px 16px; background:#f3eedd; border-radius:8px;
  font-size:15px; color:#5d5640;
}
.doc-totals .grand b{ color:#8a6d1d; font-size:19px; font-family:'Playfair Display',Georgia,serif }
.doc-status{
  display:inline-block; margin-top:6px; padding:5px 14px; border-radius:99px;
  font-size:11px; font-weight:700; letter-spacing:1px;
}
.doc-status.pago{ background:#e2f0e4; color:#247a3d; border:1px solid #9fcbaa }
.doc-status.pendente{ background:#fbf0dc; color:#a16c14; border:1px solid #e3c98f }
.doc-obs{ margin-top:18px; font-size:12px; color:#5d5640; line-height:1.7 }
.doc-sign{
  display:flex; gap:60px; margin-top:56px;
}
.doc-sign .s-line{ flex:1; text-align:center; font-size:11.5px; color:#6d6a5e }
.doc-sign .s-line::before{ content:''; display:block; border-top:1px solid #1c1a14; margin-bottom:7px }
.doc-foot{
  margin-top:34px; padding-top:14px; border-top:1px solid #e7e2d2;
  font-size:10.5px; color:#9a9587; text-align:center; line-height:1.6;
}

/* preview do documento dentro do modal */
.doc-preview-wrap{ background:#2a2a26; padding:18px; border-radius:12px; max-height:62vh; overflow-y:auto }

/* ============ IMPRESSÃO ============ */
#print-root{ display:none }
@media print{
  body{ background:#fff }
  #app, #modal-root, #toast-root{ display:none !important }
  #print-root{ display:block !important }
  #print-root .doc{ max-width:none; padding:10mm 6mm; border-radius:0 }
  @page{ margin:12mm }
}

/* ============ RESPONSIVO ============ */
@media (max-width:900px){
  #app{ flex-direction:column }
  #sidebar{ width:100%; height:auto; position:static; flex-direction:row; align-items:center; flex-wrap:wrap }
  .brand{ border-bottom:none }
  #nav{ flex-direction:row; flex-wrap:wrap; padding:10px }
  .nav-label,.sidebar-foot{ display:none }
  #main{ padding:20px 16px 50px }
}

/* ── Login overlay ── */
#login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 36px;
  width: 360px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.login-brand .brand-name { font-family: 'Playfair Display', serif; font-size: 18px; color: var(--gold-1); }
.login-brand .brand-sub  { font-size: 11px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
#login-form { display: flex; flex-direction: column; gap: 8px; }
#login-form input[type=password] {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  width: 100%;
  box-sizing: border-box;
}
#login-form input[type=password]:focus {
  outline: none;
  border-color: var(--gold-1);
  box-shadow: 0 0 0 2px rgba(212,175,55,.2);
}
