/* Gestão A&L — tema claro ("papel") e escuro ("grafite").
   Cor tem função: vermelho = prazo fatal, âmbar = prazo próximo, azul = processo administrativo, violeta = judicial. */
:root {
  --bg: #f3f4f1; --panel: #ffffff; --panel2: #eceee9; --ink: #17202a; --muted: #5d6872; --line: #d9dcd5;
  --primary: #6b0e14; --primary-ink: #ffffff; --primary-soft: #f4e5e5; --gold: #c9a45c; --side: #57070b;
  --adm: #2b5fa8; --adm-soft: #e1ebf8; --jud: #7b3f98; --jud-soft: #efe3f6;
  --danger: #bb2d2d; --danger-soft: #f8e1e1; --warn: #8f5a00; --warn-soft: #f9ecd0; --ok: #2e7d4f; --ok-soft: #dff1e6;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 8px 24px rgba(20, 30, 40, .08);
  --radius: 8px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #11161c; --panel: #1a2129; --panel2: #222b35; --ink: #e8ecef; --muted: #98a4af; --line: #2d3843;
  --primary: #dcbc7c; --primary-ink: #2a0507; --primary-soft: #35191c; --gold: #dcbc7c; --side: #57070b;
  --adm: #7aa6e6; --adm-soft: #1a2b45; --jud: #c196dc; --jud-soft: #2d1f3a;
  --danger: #f07a7a; --danger-soft: #3a1d1f; --warn: #e3aa4a; --warn-soft: #3a2c12; --ok: #66c48d; --ok-soft: #17301f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -.005em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); border-right: 1px solid #3f0509; color: #f3ece0; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-family: var(--serif); font-size: 18px; font-weight: 700; padding: 6px 10px 16px; line-height: 1.2; color: #f3ece0; }
.brand img { display: block; width: 100%; height: auto; }
.brand .sub { display: block; font-family: var(--sans); font-weight: 400; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-top: 8px; text-align: center; }
.brand small { display: block; font-family: var(--sans); font-weight: 400; font-size: 12px; color: #d8c7a6; margin-top: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: #f3ece0; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.nav a[aria-current="page"] { background: rgba(220, 188, 124, .18); color: #f2d9a0; }
.nav .count { margin-left: auto; background: #e8c987; color: #57070b; font-weight: 700; font-size: 11px; border-radius: 10px; padding: 0 7px; min-width: 20px; text-align: center; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .14); margin: 10px 4px; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 20; }
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search input { width: 100%; padding-left: 34px; border-radius: 20px; }
.topbar .search .icon { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-right: auto; }

/* ---------- Componentes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--panel2); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel2); }
.btn.sm { padding: 3px 9px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { padding: 6px; border-radius: 6px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted); display: inline-flex; }
.icon-btn:hover { background: var(--panel2); color: var(--ink); }

input, select, textarea { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
label.field { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
label.field .err { color: var(--danger); font-weight: 400; font-size: 12.5px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.banner { padding: 10px 12px; border-radius: 6px; background: var(--danger-soft); color: var(--danger); margin-bottom: 12px; }
.banner.info { background: var(--primary-soft); color: var(--primary); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card > h2, .card > .card-head { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h2, .card-head h3 { margin-right: auto; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1fr) 340px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.chip.adm { background: var(--adm-soft); color: var(--adm); }
.chip.jud { background: var(--jud-soft); color: var(--jud); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: none; padding: 9px 14px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type="search"], .toolbar input[type="text"] { width: 240px; }
.toolbar select { width: auto; max-width: 200px; }

table.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 9px 12px; background: var(--panel2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--panel2); }
.tbl td.actions { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty p { margin: 0 0 12px; }

/* ---------- Tipo de processo ---------- */
.kind-adm { border-left: 4px solid var(--adm); }
.kind-jud { border-left: 4px solid var(--jud); }

/* ---------- Painel ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12.5px; }
.kpi .value { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
.bar { height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.bar.warn > span { background: var(--warn); }

/* Régua de prazos: os próximos 15 dias de uma olhada */
.ruler { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); margin-bottom: 18px; }
.ruler .day { padding: 8px 4px 10px; text-align: center; border-right: 1px solid var(--line); min-height: 76px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ruler .day:last-child { border-right: none; }
.ruler .day.weekend { background: var(--panel2); color: var(--muted); }
.ruler .day.today { box-shadow: inset 0 3px 0 var(--primary); font-weight: 700; }
.ruler .dow { font-size: 11.5px; color: var(--muted); }
.ruler .dom { font-family: var(--serif); font-size: 19px; line-height: 1; font-variant-numeric: tabular-nums; }
.ruler .marks { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; margin-top: auto; }
.ruler .mark { min-width: 20px; height: 20px; border-radius: 10px; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; color: #fff; padding: 0 5px; }
.ruler .mark.fatal { background: var(--danger); }
.ruler .mark.due { background: var(--warn); }
.ruler .mark.ev { background: var(--adm); }
.ruler .day.overdue-col { background: var(--danger-soft); }

.work-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.work-item:last-child { border-bottom: none; }
.work-item .title { font-weight: 600; }
.work-item .meta { grid-column: 2; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.work-item.done .title { text-decoration: line-through; color: var(--muted); }
.list-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.group-title { font-family: var(--serif); font-size: 15px; font-weight: 600; margin: 18px 0 6px; display: flex; gap: 8px; align-items: center; }
.group-title .chip { font-family: var(--sans); }

.rank { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 0; }
.rank .pos { font-family: var(--serif); font-size: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank .bar { grid-column: 2 / 4; }

/* ---------- Calendário ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.cal .dow { padding: 6px; text-align: center; font-size: 12.5px; color: var(--muted); background: var(--panel2); border-bottom: 1px solid var(--line); }
.cal .cell { min-height: 104px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal .cell:nth-child(7n) { border-right: none; }
.cal .cell.other { background: var(--panel2); color: var(--muted); }
.cal .cell.today .dnum { background: var(--primary); color: var(--primary-ink); }
.cal .cell.sel { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal .dnum { align-self: flex-start; font-size: 12.5px; font-weight: 600; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal .it { font-size: 11.5px; padding: 1px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; border: none; cursor: pointer; width: 100%; }
.cal .it.ev { background: var(--adm-soft); color: var(--adm); }
.cal .it.fatal { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.cal .it.due { background: var(--warn-soft); color: var(--warn); }
.cal .more { font-size: 11.5px; color: var(--muted); padding-left: 5px; }
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 12.5px; }
.mini-cal .dow { color: var(--muted); padding: 2px 0; }
.mini-cal .d { position: relative; padding: 5px 0; border-radius: 6px; font-variant-numeric: tabular-nums; }
.mini-cal .d.other { color: var(--muted); opacity: .5; }
.mini-cal .d.today { background: var(--primary); color: var(--primary-ink); font-weight: 700; }
.mini-cal .d.has::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--danger); }

/* ---------- Kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--panel2); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.col.over { outline: 2px dashed var(--primary); }
.col h3 { font-family: var(--sans); font-size: 13.5px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.col h3 .chip { background: var(--panel); }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; margin-bottom: 8px; cursor: grab; }
.kcard:hover { border-color: var(--primary); }
.kcard.dragging { opacity: .4; }
.kcard .t { font-weight: 600; margin-bottom: 4px; }
.kcard .m { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- Linha do tempo e detalhes ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 16px; border-left: 2px solid var(--line); position: relative; margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--muted); }
.timeline li.fase::before { border-color: var(--primary); background: var(--primary); }
.timeline li.andamento::before { border-color: var(--adm); }
.timeline .when { font-size: 12.5px; color: var(--muted); }
.timeline .text { white-space: pre-wrap; overflow-wrap: anywhere; }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Modal, toast, lookup ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(8, 12, 16, .55); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; z-index: 100; }
.modal { background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); width: 100%; max-width: 560px; border: 1px solid var(--line); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin-right: auto; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel2); border-radius: 0 0 10px 10px; }
.modal-foot .left { margin-right: auto; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 360px; }
.toast.error { background: var(--danger); color: #fff; }
.lookup { position: relative; }
.lookup .results { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; margin-top: 2px; }
.lookup .results button { display: block; width: 100%; text-align: left; padding: 7px 10px; border: none; background: none; cursor: pointer; }
.lookup .results button:hover, .lookup .results button:focus { background: var(--panel2); }
.lookup .sel { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); }
.lookup .sel span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--side); }
.auth-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.auth-logo { width: 240px; max-width: 70%; height: auto; display: block; }
.auth .card { width: 100%; max-width: 400px; padding: 28px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); border-top: 3px solid var(--gold); }
.auth h1 { margin-bottom: 4px; }
.auth form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .pair { display: flex; gap: 3px; align-items: flex-end; width: 100%; height: 100%; justify-content: center; }
.bars .pair span { flex: 1; max-width: 22px; border-radius: 3px 3px 0 0; min-height: 2px; }
.bars .in { background: var(--ok); } .bars .out { background: var(--danger); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
code.token { background: var(--panel2); padding: 6px 8px; border-radius: 6px; display: block; overflow-wrap: anywhere; font-size: 12.5px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .grid.main-side { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; width: 250px; transform: translateX(-100%); transition: transform .18s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .topbar { padding: 10px 14px; }
  .topbar .spacer { display: none; }
  .topbar .search { max-width: none; }
  .form-grid, .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .ruler { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cal .cell { min-height: 70px; }
  .cal .it { font-size: 10.5px; }
  .toolbar input[type="search"], .toolbar input[type="text"], .toolbar select { width: 100%; max-width: none; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .sidebar, .topbar, .btn, .toasts { display: none !important; } .shell { display: block; } body { background: #fff; } }

/* ---------- Menu suspenso ---------- */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 210px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; z-index: 50; }
.menu button, .menu a { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; background: none; text-align: left; border-radius: 6px; cursor: pointer; color: var(--ink); font-weight: 500; }
.menu button:hover, .menu a:hover { background: var(--panel2); text-decoration: none; }
.menu hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; }

/* Botão Adicionar e sino de avisos */
.add-btn { gap: 8px; }
.bell { position: relative; }
.bell-dot { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #d93025; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.menu.notif { width: 340px; max-width: calc(100vw - 24px); padding: 0; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 380px; overflow: auto; }
.menu .notif-item { flex-direction: column; align-items: flex-start; gap: 2px; border-radius: 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.menu .notif-item.unread { background: var(--primary-soft); font-weight: 600; }
@media (max-width: 760px) { .hello { display: none; } .add-btn { padding: 8px 10px; } .menu.notif { position: fixed; left: 12px; right: 12px; top: 56px; width: auto; } }
.menu.add-menu, .dropdown .menu { min-width: 250px; }
.menu.notif { min-width: 0; }

/* Avisos em destaque e avatar */
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.avatar.sys { background: var(--muted); }
.notif-row { display: flex; gap: 10px; align-items: flex-start; }
.pop-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-pop { position: fixed; top: 72px; right: 16px; z-index: 210; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.notif-pop .pop-clear { align-self: flex-end; }
.pop-card { position: relative; display: flex; gap: 10px; align-items: center; padding: 12px 28px 12px 12px; background: var(--ink); color: var(--bg); border-radius: 10px; box-shadow: var(--shadow); text-decoration: none; }
.pop-card .muted { color: inherit; opacity: .7; }
.pop-x { position: absolute; top: 4px; right: 8px; background: none; border: 0; color: inherit; font-size: 18px; cursor: pointer; }

.notice { background: var(--primary-soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }

/* Janela da tarefa (formato Advbox) */
.modal.tv-modal { max-width: 1040px; width: calc(100vw - 32px); }
.tv { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 0; }
.tv-main { padding-right: 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tv-side { border-left: 1px solid var(--line); padding-left: 22px; display: flex; flex-direction: column; gap: 16px; }
.tv-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.tv-bar .btn svg, .tv-bar .btn .icon { margin-right: 4px; }
.tv-title { margin: 6px 0 0; font-size: 22px; }
.tv-text { margin: 0; line-height: 1.55; }
.tv-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 34px; }
.tv-val { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tv-person { display: inline-flex; gap: 8px; align-items: center; }
.danger-text { color: var(--danger, #b3261e); }
.tv-panel { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.tv-form { display: flex; flex-direction: column; gap: 10px; }
.tv-line { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; align-items: center; }
.tv-chip { display: inline-flex; gap: 6px; align-items: center; padding: 2px 8px 2px 2px; border: 1px solid var(--line); border-radius: 999px; }
.tv-x { border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--muted); }
.tv-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tv-actions input[type=date], .tv-actions input[type=time], .tv-actions select { width: auto; }
.tv-priv { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.tv-hist h4 { margin: 8px 0; }
.tv-c { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.tv-c.sys { opacity: .75; }
.tv-blk .row { gap: 6px; }
@media (max-width: 800px) { .tv { grid-template-columns: 1fr; } .tv-main { padding-right: 0; } .tv-side { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; margin-top: 14px; } .tv-row { grid-template-columns: 100px minmax(0, 1fr); } }
.tv-line .row.wrap select { width: auto; min-width: 150px; }

.tv-pts { margin-left: 10px; font-size: 14px; font-weight: 400; color: var(--muted); font-family: inherit; }
.tv-when { display: inline-flex; gap: 8px; align-items: center; }

/* Tela de entrada animada (some para quem prefere menos movimento) */
.auth { position: relative; overflow: hidden; background: radial-gradient(1200px 700px at 20% 10%, rgba(201, 168, 106, .10), transparent 60%), radial-gradient(900px 600px at 85% 90%, rgba(201, 168, 106, .08), transparent 60%), var(--side); }
.auth::before, .auth::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; filter: blur(60px); opacity: .5; }
.auth::before { width: 420px; height: 420px; left: -120px; top: -100px; background: rgba(201, 168, 106, .22); animation: auth-float-a 18s ease-in-out infinite alternate; }
.auth::after { width: 360px; height: 360px; right: -100px; bottom: -120px; background: rgba(160, 40, 50, .28); animation: auth-float-b 22s ease-in-out infinite alternate; }
.auth-box { position: relative; z-index: 1; }
.auth-logo { animation: auth-logo-in 1s cubic-bezier(.2, .7, .2, 1) both; }
.auth .card { animation: auth-card-in .8s .25s cubic-bezier(.2, .7, .2, 1) both; position: relative; overflow: hidden; }
.auth .card::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 3px; background: linear-gradient(90deg, transparent, #f2dba3, transparent); animation: auth-shine 4.5s 1.2s ease-in-out infinite; }
.auth form > * { animation: auth-field-in .6s both; }
.auth form > *:nth-child(1) { animation-delay: .55s; } .auth form > *:nth-child(2) { animation-delay: .65s; } .auth form > *:nth-child(3) { animation-delay: .75s; }
.auth form > *:nth-child(4) { animation-delay: .85s; } .auth form > *:nth-child(5) { animation-delay: .95s; } .auth form > *:nth-child(6) { animation-delay: 1.05s; }
@keyframes auth-logo-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes auth-card-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes auth-field-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes auth-shine { 0% { left: -60%; } 55%, 100% { left: 130%; } }
@keyframes auth-float-a { to { transform: translate(140px, 90px) scale(1.15); } }
@keyframes auth-float-b { to { transform: translate(-120px, -80px) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .auth::before, .auth::after, .auth .card::after { animation: none; } .auth-logo, .auth .card, .auth form > * { animation: none; } }
