
/* ============ TOKENS ============ */
:root{
  --bg:#F5F2F7;
  --surface:#FFFFFF;
  --surface-2:#ECE7F1;
  --ink:#241B33;
  --muted:#756B89;
  --border:#E4DCEB;
  --brand:#E24E75;
  --brand-ink:#B6335A;
  --brand-soft:#FBE3EB;
  --ribbon:#3F8E7A;
  --ribbon-soft:#E1F1EC;
  --green:#3E9B6E;
  --green-soft:#E3F5EA;
  --amber:#D9A441;
  --amber-soft:#FBF0DD;
  --orange:#DB7B3E;
  --orange-soft:#FBE8DC;
  --red:#D14343;
  --red-soft:#FBE3E1;
  --shadow: 0 2px 4px rgba(60,40,70,0.05), 0 14px 32px rgba(60,40,70,0.09);
  --radius: 20px;
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}
html[data-theme="dark"]{
  --bg:#1B1524;
  --surface:#241C2E;
  --surface-2:#2E2438;
  --ink:#F3EEF7;
  --muted:#A79BB8;
  --border:#392E45;
  --brand:#F17B99;
  --brand-ink:#F9A6BB;
  --brand-soft:#3A2130;
  --ribbon:#5FBFA4;
  --ribbon-soft:#1D3833;
  --green:#59C48D;
  --green-soft:#1C3A2C;
  --amber:#E8BE6B;
  --amber-soft:#3A2F14;
  --orange:#E8965F;
  --orange-soft:#3A2614;
  --red:#E87979;
  --red-soft:#3D1F1F;
  --shadow: 0 2px 4px rgba(0,0,0,0.25), 0 16px 36px rgba(0,0,0,0.35);
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font-body);
  -webkit-font-smoothing:antialiased;
  transition:background .25s ease, color .25s ease;
}
h1,h2,h3,.display{ font-family:var(--font-display); letter-spacing:-0.01em; }
.mono{ font-family:var(--font-mono); }
a{color:inherit;}
button{font-family:inherit;}
::selection{ background:var(--brand-soft); color:var(--brand-ink); }
:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }

/* ============ UTILITIES ============ */
.container{ max-width:1180px; margin:0 auto; padding:0 24px; }
.hidden{ display:none !important; }
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:11px 20px; border-radius:12px; border:1px solid transparent;
  font-size:14.5px; font-weight:600; cursor:pointer; transition:all .15s ease;
  white-space:nowrap;
}
.btn-primary{ background:var(--brand); color:#fff; }
.btn-primary:hover{ background:var(--brand-ink); }
.btn-ghost{ background:transparent; color:var(--ink); border-color:var(--border); }
.btn-ghost:hover{ background:var(--surface-2); }
.btn-sm{ padding:7px 12px; font-size:13px; border-radius:8px; }
.btn-danger{ background:transparent; color:var(--red); border-color:var(--red); }
.btn-danger:hover{ background:var(--red-soft); }
.pill{ display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:99px; font-size:12.5px; font-weight:600; }

/* ============ LANDING ============ */
.nav{
  position:sticky; top:0; z-index:50; background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:blur(10px); border-bottom:1px solid var(--border);
}
.nav-inner{ display:flex; align-items:center; justify-content:space-between; height:72px; }
.logo{ display:flex; align-items:center; gap:9px; font-weight:700; font-size:20px; white-space:nowrap; }
.logo-mark{ width:30px; height:30px; border-radius:10px 10px 10px 3px; background:var(--brand); position:relative; flex-shrink:0; }
.logo-mark::after{
  content:''; position:absolute; inset:7px; border:2px solid #fff; border-radius:2px 2px 2px 0;
}
.nav-links{ display:flex; align-items:center; gap:28px; font-size:14.5px; font-weight:500; color:var(--muted); }
.nav-links a:hover{ color:var(--ink); }
.nav-actions{ display:flex; align-items:center; gap:12px; }
.theme-toggle{
  width:38px; height:38px; border-radius:9px; border:1px solid var(--border); background:var(--surface);
  display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:16px;
}

.hero{ padding:90px 0 60px; }
.hero-grid{ display:grid; grid-template-columns:1.1fr 0.9fr; gap:56px; align-items:center; }
.eyebrow{
  display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:600; color:var(--brand-ink);
  background:var(--brand-soft); padding:6px 12px; border-radius:99px; margin-bottom:22px;
}
.eyebrow::before{ content:''; width:6px; height:6px; border-radius:50%; background:var(--brand); }
.hero h1{ font-size:52px; line-height:1.05; font-weight:600; margin:0 0 20px; }
.hero h1 em{ font-style:normal; color:var(--brand); }
.hero p.lede{ font-size:18px; line-height:1.6; color:var(--muted); max-width:480px; margin:0 0 32px; }
.hero-ctas{ display:flex; gap:14px; margin-bottom:36px; }
.hero-stats{ display:flex; gap:32px; }
.hero-stat b{ display:block; font-family:var(--font-display); font-size:26px; }
.hero-stat span{ font-size:13px; color:var(--muted); }

/* signature element: tear-off desk calendar */
.calendar-wrap{ display:flex; align-items:center; justify-content:center; position:relative; height:400px; }
.cal-page{
  position:absolute; width:246px; height:288px; background:var(--surface); border:1px solid var(--border);
  border-radius:20px; box-shadow:var(--shadow);
}
.cal-page.back1{ transform:rotate(7deg) translateY(8px); opacity:.65; }
.cal-page.back2{ transform:rotate(-9deg) translateY(14px); opacity:.35; }
.cal-page.front{
  display:flex; flex-direction:column; align-items:center; text-align:center; padding:28px 22px 24px;
  animation: pageIn .65s cubic-bezier(.16,1.6,.4,1) .25s both;
}
@keyframes pageIn{
  0%{ transform:translateY(-30px) rotate(-4deg); opacity:0; }
  100%{ transform:translateY(0) rotate(0deg); opacity:1; }
}
@media (prefers-reduced-motion: reduce){ .cal-page.front{ animation:none; } }
.cal-page.front::after{
  content:''; position:absolute; right:0; bottom:0; width:28px; height:28px;
  background:linear-gradient(135deg, transparent 50%, var(--bg) 50%);
  border-radius:0 0 20px 0;
}
.cal-ring{ display:flex; gap:20px; margin-bottom:16px; }
.cal-ring span{ width:9px; height:9px; border-radius:50%; background:var(--ribbon); }
.cal-month{ font-family:var(--font-mono); font-size:12.5px; letter-spacing:.16em; color:var(--brand); font-weight:700; }
.cal-daynum{ font-family:var(--font-display); font-size:92px; line-height:1; font-weight:600; margin:4px 0 0; }
.cal-weekday{ font-size:14px; color:var(--muted); margin:2px 0 18px; }
.cal-pill{
  margin-top:auto; background:var(--brand-soft); color:var(--brand-ink); font-size:12.5px; font-weight:600;
  padding:9px 16px; border-radius:99px;
}

.logos-strip{ padding:36px 0 24px; border-top:1px solid var(--border); }
.logos-strip p{ text-align:center; font-size:12.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; margin:0 0 20px; }
.logos-row{ display:flex; justify-content:center; gap:44px; flex-wrap:wrap; font-family:var(--font-mono); font-size:13px; color:var(--muted); }
.warranty-note-wrap{ padding-bottom:36px; border-bottom:1px solid var(--border); }
.warranty-note{ text-align:center; font-size:13.5px; color:var(--muted); margin:0; }

/* reassurance band: "cadastre uma vez só" */
.reassure{ padding:0 24px 56px; }
.reassure-card{
  max-width:1180px; margin:0 auto; background:var(--brand-soft); border:1px solid var(--border);
  border-radius:var(--radius); padding:38px 42px; display:flex; align-items:center; justify-content:space-between;
  gap:36px; flex-wrap:wrap;
}
.reassure-text{ max-width:440px; }
.reassure-tag{ font-size:12.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--brand-ink); margin-bottom:10px; }
.reassure-text h3{ font-size:24px; margin:0 0 10px; font-weight:600; line-height:1.2; }
.reassure-text p{ margin:0; color:var(--ink); opacity:.75; font-size:14.5px; line-height:1.6; }
.reassure-steps{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.reassure-step{ background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:14px 18px; text-align:center; min-width:112px; }
.reassure-step .n{ font-family:var(--font-mono); font-size:11px; color:var(--muted); }
.reassure-step .l{ font-weight:600; font-size:13.5px; margin-top:3px; white-space:nowrap; }
.reassure-arrow{ color:var(--brand-ink); font-size:18px; opacity:.6; }
@media (max-width:720px){
  .reassure-card{ padding:28px; }
  .reassure-steps{ width:100%; justify-content:space-between; }
  .reassure-arrow{ display:none; }
}

.section{ padding:88px 0; }
.section-head{ max-width:600px; margin:0 0 48px; }
.section-head .eyebrow{ margin-bottom:16px; }
.section-head h2{ font-size:34px; margin:0 0 14px; font-weight:600; }
.section-head p{ color:var(--muted); font-size:16px; line-height:1.6; margin:0; }

.timeline{ display:flex; gap:10px; overflow-x:auto; padding-bottom:8px; margin:0 0 8px; }
.timeline-step{
  flex:1; min-width:118px; background:var(--surface); border:1px solid var(--border); border-radius:12px;
  padding:16px 14px; text-align:center;
}
.timeline-step .t{ font-family:var(--font-mono); font-weight:600; font-size:15px; }
.timeline-step .d{ font-size:11.5px; color:var(--muted); margin-top:2px; }
.timeline-step.now{ border-color:var(--brand); background:var(--brand-soft); }
.timeline-step.now .t{ color:var(--brand-ink); }

.features-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.feature-card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:26px; }
.feature-card .icon{ width:40px; height:40px; border-radius:10px; background:var(--brand-soft); color:var(--brand-ink); display:flex; align-items:center; justify-content:center; font-size:18px; margin-bottom:16px; }
.feature-card h3{ font-size:17px; margin:0 0 8px; font-weight:600; }
.feature-card p{ font-size:14px; color:var(--muted); line-height:1.55; margin:0; }

.cta-band{ background:var(--ink); color:var(--bg); border-radius:20px; padding:56px; display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap; }
html[data-theme="dark"] .cta-band{ background:var(--surface-2); }
.cta-band h2{ margin:0; font-size:28px; font-weight:600; color:#fff; }
html[data-theme="dark"] .cta-band h2{ color:var(--ink); }
.cta-band p{ margin:6px 0 0; color:#B9C0BC; font-size:14.5px; }
html[data-theme="dark"] .cta-band p{ color:var(--muted); }

.footer{ border-top:1px solid var(--border); padding:40px 0; color:var(--muted); font-size:13px; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; }

/* ============ APP SHELL ============ */
#app-shell{ display:none; min-height:100vh; }
#app-shell.active{ display:flex; }
.sidebar{
  width:230px; flex-shrink:0; background:var(--surface); border-right:1px solid var(--border);
  padding:22px 16px; display:flex; flex-direction:column; gap:4px; position:sticky; top:0; height:100vh;
}
.sidebar .logo{ padding:6px 8px 22px; font-size:17px; }
.side-link{
  display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:9px; font-size:14px; font-weight:500;
  color:var(--muted); cursor:pointer; border:none; background:none; text-align:left; width:100%;
}
.side-link .ic{ width:18px; text-align:center; }
.side-link:hover{ background:var(--surface-2); color:var(--ink); }
.side-link.active{ background:var(--brand-soft); color:var(--brand-ink); }
.sidebar-foot{ margin-top:auto; border-top:1px solid var(--border); padding-top:14px; }
.user-chip{ display:flex; align-items:center; gap:10px; padding:8px; border-radius:9px; }
.avatar{ width:32px; height:32px; border-radius:50%; background:var(--brand); color:#fff; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; flex-shrink:0; }
.user-chip .who{ font-size:13px; line-height:1.3; }
.user-chip .who b{ display:block; font-weight:600; }
.user-chip{ min-width:0; }
.user-chip .who{ min-width:0; overflow:hidden; }
.user-chip .who b, .user-chip .who span{ display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.user-chip .who span{ color:var(--muted); font-size:11.5px; }

.main{ flex:1; min-width:0; padding:28px 34px 60px; }
.topbar{ display:flex; align-items:center; justify-content:space-between; margin-bottom:26px; gap:16px; flex-wrap:wrap; }
.topbar h1{ font-size:24px; margin:0; font-weight:600; }
.topbar-actions{ display:flex; gap:10px; align-items:center; }

.cards-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:26px; }
.stat-card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:20px; }
.stat-card .top{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:14px; }
.stat-card .label{ font-size:13px; color:var(--muted); font-weight:500; }
.stat-card .ic{ width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; }
.stat-card .num{ font-family:var(--font-display); font-size:30px; font-weight:600; }
.stat-card.c1 .ic{ background:var(--brand-soft); color:var(--brand-ink); }
.stat-card.c2 .ic{ background:var(--amber-soft); color:var(--amber); }
.stat-card.c3 .ic{ background:var(--red-soft); color:var(--red); }
.stat-card.c4 .ic{ background:var(--green-soft); color:var(--green); }

.panel{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.panel-head{ display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--border); gap:14px; flex-wrap:wrap; }
.panel-head h2{ font-size:15.5px; margin:0; font-weight:600; }
.filters{ display:flex; gap:8px; flex-wrap:wrap; }
.chip{ padding:6px 13px; border-radius:99px; font-size:12.5px; font-weight:600; border:1px solid var(--border); background:var(--surface); cursor:pointer; color:var(--muted); }
.chip.active{ background:var(--ink); color:var(--bg); border-color:var(--ink); }
.search-box{ position:relative; }
.search-box input{
  padding:8px 12px 8px 32px; border-radius:9px; border:1px solid var(--border); background:var(--bg);
  font-size:13.5px; width:200px; color:var(--ink);
}
.search-box::before{ content:'⌕'; position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--muted); font-size:14px; }

table{ width:100%; border-collapse:collapse; }
th{ text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); padding:12px 20px; border-bottom:1px solid var(--border); font-weight:600; }
td{ padding:14px 20px; border-bottom:1px solid var(--border); font-size:14px; vertical-align:middle; }
tbody tr:last-child td{ border-bottom:none; }
tbody tr:hover{ background:var(--bg); }
.doc-name{ font-weight:600; }
.doc-sub{ color:var(--muted); font-size:12.5px; margin-top:1px; }
.status-dot{ width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:7px; }
.row-actions{ display:flex; gap:6px; opacity:1; transition:opacity .12s; }
tr:hover .row-actions{ opacity:1; }
.icon-btn{ width:28px; height:28px; border-radius:7px; border:1px solid var(--border); background:var(--surface); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; font-size:13px; color:var(--muted); }
.icon-btn:hover{ background:var(--surface-2); color:var(--ink); }
.empty-state{ padding:60px 20px; text-align:center; color:var(--muted); }
.empty-state .big{ font-size:34px; margin-bottom:10px; }

/* calendar */
.cal-head{ display:flex; justify-content:space-between; align-items:center; padding:16px 20px; border-bottom:1px solid var(--border); }
.cal-grid{ display:grid; grid-template-columns:repeat(7,1fr); }
.cal-dow{ text-align:center; font-size:11.5px; font-weight:600; color:var(--muted); padding:10px 0; border-bottom:1px solid var(--border); text-transform:uppercase; }
.cal-cell{ min-height:96px; border-right:1px solid var(--border); border-bottom:1px solid var(--border); padding:8px; position:relative; }
.cal-cell:nth-child(7n){ border-right:none; }
.cal-cell .dn{ font-size:12px; color:var(--muted); font-family:var(--font-mono); }
.cal-cell.out{ background:var(--bg); opacity:.5; }
.cal-cell.today .dn{ background:var(--ink); color:var(--bg); width:20px; height:20px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; }
.cal-ev{ margin-top:5px; font-size:10.5px; padding:3px 6px; border-radius:5px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.legend{ display:flex; gap:16px; padding:14px 20px; font-size:12.5px; color:var(--muted); flex-wrap:wrap; }
.legend span{ display:inline-flex; align-items:center; gap:6px; }
.legend i{ width:9px; height:9px; border-radius:50%; display:inline-block; }

/* notifications */
.notif-item{ display:flex; gap:14px; padding:16px 20px; border-bottom:1px solid var(--border); align-items:flex-start; }
.notif-item:last-child{ border-bottom:none; }
.notif-ic{ width:34px; height:34px; border-radius:9px; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:14px; }
.notif-body b{ font-size:14px; }
.notif-body p{ margin:2px 0 0; font-size:12.5px; color:var(--muted); }
.notif-meta{ font-size:11.5px; color:var(--muted); white-space:nowrap; font-family:var(--font-mono); }

/* modal */
.modal-bg{ position:fixed; inset:0; background:rgba(10,14,15,.5); display:none; align-items:center; justify-content:center; z-index:200; padding:20px; }
.modal-bg.active{ display:flex; }
.modal{ background:var(--surface); border-radius:16px; width:100%; max-width:520px; max-height:88vh; overflow-y:auto; box-shadow:var(--shadow); }
.modal-head{ display:flex; justify-content:space-between; align-items:center; padding:20px 22px; border-bottom:1px solid var(--border); }
.modal-head h3{ margin:0; font-size:17px; font-weight:600; }
.modal-body{ padding:22px; display:flex; flex-direction:column; gap:14px; }
.modal-foot{ padding:16px 22px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; }
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:12.5px; font-weight:600; color:var(--muted); }
.field input, .field select, .field textarea{
  padding:10px 12px; border-radius:9px; border:1px solid var(--border); background:var(--bg); color:var(--ink);
  font-size:14px; font-family:inherit;
}
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.close-x{ width:30px; height:30px; border-radius:8px; border:none; background:var(--surface-2); cursor:pointer; font-size:15px; color:var(--muted); }

/* attachment field + viewer modals */
.field input[type="file"]{ padding:8px 10px; font-size:13px; }
.anexo-preview{ display:flex; align-items:center; gap:12px; margin-top:6px; }
.anexo-preview img{ width:64px; height:64px; object-fit:cover; border-radius:8px; border:1px solid var(--border); }
.obs-doc-name{ font-weight:600; font-size:14px; margin-bottom:4px; }
.obs-text{ font-size:14px; color:var(--muted); line-height:1.6; white-space:pre-wrap; margin:0; }
.anexo-empty{ text-align:center; padding:30px 10px; color:var(--muted); font-size:14px; }
.anexo-img-view{ width:100%; border-radius:12px; border:1px solid var(--border); display:block; }

/* toast */
#toast{ position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px); background:var(--ink); color:var(--bg); padding:12px 20px; border-radius:10px; font-size:13.5px; font-weight:500; opacity:0; transition:all .25s ease; z-index:300; pointer-events:none; box-shadow:var(--shadow); }
#toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

/* mobile */
.hamburger{ display:none; }
@media (max-width:960px){
  .hero-grid{ grid-template-columns:1fr; }
  .calendar-wrap{ height:300px; }
  .cal-page{ width:210px; height:250px; }
  .cal-daynum{ font-size:74px; }
  .features-grid{ grid-template-columns:1fr; }
  .cards-row{ grid-template-columns:1fr 1fr; }
  .nav-links{ display:none; }
  #app-shell.active{ flex-direction:column; }
  .sidebar{ width:100%; height:auto; position:relative; flex-direction:row; overflow-x:auto; padding:10px 12px; }
  .sidebar .logo{ display:none; }
  .sidebar-foot{ display:none; }
  .side-link{ width:auto; white-space:nowrap; }
  .main{ padding:20px 16px 60px; }
  .cal-cell{ min-height:60px; }
  .search-box input{ width:140px; }
}
@media (max-width:600px){
  .cards-row{ grid-template-columns:1fr; }
  .hero h1{ font-size:38px; }
}

/* ============ ADIÇÕES DA VERSÃO PHP ============ */
a{ text-decoration:none; }
a.logo{ color:var(--ink); }
.logo{ white-space:nowrap; }
.stack{ display:flex; flex-direction:column; gap:14px; }
.hint{ font-size:12.5px; color:var(--muted); }
.opt{ font-weight:400; color:var(--muted); }
.small{ font-size:12.5px; }
.empty-cell{ text-align:center; color:var(--muted); padding:30px; }
.th-actions{ width:1%; }
.table-scroll{ overflow-x:auto; }
.badge{ margin-left:auto; background:var(--brand); color:#fff; border-radius:99px; font-size:11px; font-weight:700; padding:2px 7px; }
a.side-link{ text-decoration:none; }
.sidebar form{ margin:0; }

/* mensagens */
.flash-wrap{ position:fixed; top:16px; left:50%; transform:translateX(-50%); z-index:400; display:flex; flex-direction:column; gap:8px; width:min(520px, calc(100% - 32px)); }
.flash{ padding:12px 16px; border-radius:12px; font-size:14px; font-weight:500; border:1px solid var(--border); background:var(--surface); box-shadow:var(--shadow); }
.flash-inline{ box-shadow:none; margin-bottom:16px; }
.flash-success{ background:var(--green-soft); border-color:var(--green); color:var(--ink); }
.flash-error{ background:var(--red-soft); border-color:var(--red); color:var(--ink); }
.flash-info{ background:var(--brand-soft); border-color:var(--brand); color:var(--ink); }

/* telas de acesso */
.auth-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:32px 16px; }
.auth-card{ width:100%; max-width:440px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); padding:34px; }
.auth-card .logo{ margin-bottom:22px; font-size:19px; }
.auth-title{ font-size:26px; margin:0 0 6px; font-weight:600; }
.auth-sub{ color:var(--muted); font-size:14.5px; line-height:1.55; margin:0 0 22px; }
.auth-links{ display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:20px; font-size:13.5px; }
.auth-links a{ color:var(--brand-ink); font-weight:600; }

/* formulários */
.field input, .field select, .field textarea{ width:100%; min-width:0; }
.field input[type="file"]{ padding:9px 10px; font-size:13px; }
.field input[type="checkbox"]{ width:auto; }
.form-panel{ max-width:760px; }
.form-pad{ padding:22px; }
.form-actions{ display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; margin-top:4px; }
.check{ display:flex; align-items:center; gap:9px; font-size:14px; cursor:pointer; }
.check input{ width:17px; height:17px; accent-color:var(--brand); }
.check-big{ font-weight:600; }
.check-grid{ display:grid; grid-template-columns:repeat(2, 1fr); gap:10px 18px; }
.anexo-current{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; font-size:13.5px; padding:10px 12px; background:var(--bg); border:1px solid var(--border); border-radius:10px; }
.anexo-current a{ color:var(--brand-ink); font-weight:600; }
.anexo-preview img{ max-width:180px; max-height:140px; border-radius:10px; border:1px solid var(--border); object-fit:cover; margin-top:8px; }
.settings-grid{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:20px; align-items:start; }
.danger-zone{ border-color:var(--red); }
.danger-zone .panel-head h2{ color:var(--red); }
.err-list{ margin:0; padding-left:18px; font-size:13px; color:var(--red); line-height:1.7; }
.hint-list{ margin:0; padding-left:18px; font-size:13.5px; color:var(--muted); line-height:1.7; }

/* listas e status */
.filters-bar{ padding:12px 20px; border-bottom:1px solid var(--border); }
.chip{ text-decoration:none; display:inline-block; }
.status-dot.s-verde{ background:var(--green); }
.status-dot.s-amarelo{ background:var(--amber); }
.status-dot.s-laranja{ background:var(--orange); }
.status-dot.s-vermelho{ background:var(--red); }
.row-actions{ align-items:center; }
.row-actions form{ margin:0; }
.row-actions.always{ opacity:1; }
.icon-btn{ text-decoration:none; }
.icon-btn.is-empty{ opacity:.45; }
tr.unread td:first-child{ box-shadow:inset 3px 0 0 var(--brand); }
.pill-lido, .pill-enviado{ background:var(--green-soft); color:var(--green); }
.pill-enviado{ background:var(--amber-soft); color:var(--amber); }
.pill-falhou{ background:var(--red-soft); color:var(--red); }
.pill-pendente{ background:var(--amber-soft); color:var(--amber); }
.pill-desativado{ background:var(--surface-2); color:var(--muted); }
.pill-lido{ background:var(--green-soft); color:var(--green); }
.pill{ display:inline-flex; }

/* calendário */
.cal-head h2{ font-weight:600; font-size:15px; margin:0; }
.cal-ev{ display:block; text-decoration:none; }
.s-bg-verde{ background:var(--green-soft); color:var(--green); }
.s-bg-amarelo{ background:var(--amber-soft); color:var(--amber); }
.s-bg-laranja{ background:var(--orange-soft); color:var(--orange); }
.s-bg-vermelho{ background:var(--red-soft); color:var(--red); }
.legend i.s-verde{ background:var(--green); }
.legend i.s-amarelo{ background:var(--amber); }
.legend i.s-laranja{ background:var(--orange); }
.legend i.s-vermelho{ background:var(--red); }

/* gráficos */
.charts-row{ display:grid; grid-template-columns:1.4fr 1fr; gap:16px; margin-bottom:26px; }
.bars{ display:flex; align-items:flex-end; gap:6px; height:170px; padding:16px 18px 12px; }
.bar-col{ flex:1; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:4px; min-width:0; }
.bar{ width:100%; max-width:34px; background:var(--brand); border-radius:6px 6px 2px 2px; min-height:2px; }
.bar-val{ font-size:11px; font-weight:700; color:var(--ink); min-height:14px; }
.bar-lbl{ font-size:10px; color:var(--muted); white-space:nowrap; font-family:var(--font-mono); }
.hbars{ padding:16px 20px; display:flex; flex-direction:column; gap:12px; }
.hbar-row{ display:grid; grid-template-columns:96px 1fr 28px; align-items:center; gap:10px; font-size:13px; }
.hbar-track{ background:var(--surface-2); border-radius:99px; height:10px; overflow:hidden; }
.hbar{ background:var(--ribbon); height:100%; border-radius:99px; }
.hbar-n{ text-align:right; font-weight:600; }

/* impressão / PDF */
body.plain{ background:#fff; color:#111; }
.print-page{ max-width:980px; margin:0 auto; padding:28px 20px; }
.print-page h1{ font-size:22px; margin:0 0 4px; }
.print-bar{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:20px; }
.print-table th, .print-table td{ border:1px solid #ccc; padding:7px 9px; font-size:12.5px; }
.print-table th{ background:#f2f2f2; }
@media print{ .no-print{ display:none !important; } .print-page{ padding:0; } }

@media (hover:none){ .row-actions{ opacity:1; } }
@media (max-width:960px){
  .charts-row, .settings-grid{ grid-template-columns:1fr; }
  .sidebar form{ display:contents; }
  .sidebar .side-link .badge{ margin-left:6px; }
}
@media (max-width:600px){
  .check-grid, .field-row{ grid-template-columns:1fr; }
  .auth-card{ padding:24px; }
  .bar-lbl{ font-size:8px; }
}
@media (prefers-reduced-motion: reduce){ *{ transition:none !important; } }

/* ícones */
.icon{ width:18px; height:18px; display:block; }
.side-link .ic{ width:18px; height:18px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-card .ic .icon{ width:16px; height:16px; }

/* listas no celular: cada documento vira um cartão */
@media (max-width:720px){
  .doc-table thead{ display:none; }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td{ display:block; }
  .doc-table tr{ padding:14px 16px; border-bottom:1px solid var(--border); }
  .doc-table td{ padding:2px 0; border:0; }
  .doc-table td:nth-child(2){ display:none; }
  .doc-table td:nth-child(3), .doc-table td:nth-child(4){ display:inline-block; margin-right:14px; font-size:13px; }
  .doc-table td:nth-child(5){ margin-top:10px; }
  .row-actions{ flex-wrap:wrap; opacity:1; }
  .panel-head{ padding:14px 16px; }
  .filters-bar{ padding:10px 16px; }
}
@media (max-width:600px){
  .cards-row{ grid-template-columns:1fr 1fr; gap:10px; }
  .stat-card{ padding:14px; }
  .stat-card .num{ font-size:24px; }
  .bar-col:nth-child(even) .bar-lbl{ visibility:hidden; }
}
