/* ProduJus - Gestão de reclamações */
:root {
  --ink: #1d2b4f;
  --ink-2: #283a66;
  --ink-3: #3a4f80;
  --gold: #f2b33d;
  --gold-soft: #fdf1d8;
  --paper: #f3f4f8;
  --card: #ffffff;
  --line: #e1e4ed;
  --text: #1d2433;
  --muted: #646c80;
  --red: #c23a31;
  --red-soft: #fbe7e5;
  --green: #1c7f63;
  --green-soft: #ddf2ea;
  --blue: #3462c9;
  --blue-soft: #e4ecfb;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(29, 43, 79, .06), 0 6px 18px rgba(29, 43, 79, .05);
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--paper); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.ic { flex-shrink: 0; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.mt { margin-top: 16px; }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Logo em CSS ---------- */
.logo { display: flex; align-items: center; gap: 11px; color: #fff; }
.logo-mark { position: relative; width: 42px; height: 42px; border-radius: 11px; background: var(--ink-2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); flex-shrink: 0; }
.logo-mark i { position: absolute; display: block; }
.lm-post { left: 20px; top: 9px; width: 2px; height: 22px; background: #fff; border-radius: 2px; }
.lm-knob { left: 18px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.lm-beam { left: 8px; top: 13px; width: 26px; height: 2.5px; background: var(--gold); border-radius: 2px; transform-origin: 50% 50%; transition: transform .6s cubic-bezier(.5,1.6,.4,1); }
.lm-pan { top: 15px; width: 12px; height: 12px;
  background:
    linear-gradient(to top left, transparent calc(50% - .7px), rgba(255,255,255,.8) 50%, transparent calc(50% + .7px)) left top / 50% 7px no-repeat,
    linear-gradient(to top right, transparent calc(50% - .7px), rgba(255,255,255,.8) 50%, transparent calc(50% + .7px)) right top / 50% 7px no-repeat; }
.lm-pan::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: 0; height: 5px; background: #fff; border-radius: 0 0 8px 8px; }
.lm-l { left: 3px; transition: transform .6s cubic-bezier(.5,1.6,.4,1); }
.lm-r { right: 3px; transition: transform .6s cubic-bezier(.5,1.6,.4,1); }
.lm-base { left: 13px; bottom: 7px; width: 16px; height: 3px; background: #fff; border-radius: 2px; }
.logo:hover .lm-beam { transform: rotate(-9deg); }
.logo:hover .lm-l { transform: translateY(2px); }
.logo:hover .lm-r { transform: translateY(-2px); }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text b { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.logo-text b span { color: var(--gold); font-style: italic; }
.logo-text small { font-size: 11px; opacity: .7; margin-top: 2px; }
.logo.dark { color: var(--ink); }
.logo.dark .logo-mark { background: var(--ink); }
.logo.big .logo-mark { transform: scale(1.25); transform-origin: left center; margin-right: 10px; }
.logo.big .logo-text b { font-size: 30px; }

/* ---------- Estrutura ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 248px; background: var(--ink); color: #cfd6e8; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40; transition: transform .25s; }
.sidebar .logo { padding: 20px 20px 18px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.nav-group { margin-top: 16px; }
.nav-group > span { display: block; font-size: 11.5px; color: #8e9abb; padding: 0 10px 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 6px; color: #d9dfee; font-size: 14px; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.sidebar nav a.active { background: rgba(242,179,61,.14); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.sidebar nav a .count { margin-left: auto; background: var(--gold); color: var(--ink); font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.side-user { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; display: flex; gap: 10px; align-items: center; }
.side-user b { color: #fff; display: block; font-size: 13.5px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

.main { flex: 1; margin-left: 248px; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px; background: rgba(243,244,248,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-family: var(--serif); font-size: 21px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: transparent; border: 0; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: #e6e9f1; text-decoration: none; }
.badge-dot { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--paper); }
.menu-toggle { display: none; }
.content { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(29,43,79,.16); padding: 6px; display: none; z-index: 50; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; width: 100%; gap: 9px; align-items: center; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--paper); text-decoration: none; }
.notif-menu { width: 340px; max-height: 420px; overflow-y: auto; }
.notif-item { display: block !important; border-bottom: 1px solid var(--line); border-radius: 0 !important; }
.notif-item b { display: block; font-size: 13.5px; }
.notif-item span { font-size: 12.5px; color: var(--muted); }
.notif-item.unread { background: var(--gold-soft); }

/* ---------- Componentes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 16px; font-weight: 650; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 20px 0; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border-radius: 6px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--ink); color: #fff; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: var(--ink-2); text-decoration: none; }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn.gold:hover { background: #e9a624; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--paper); }
.btn.danger { background: #fff; color: var(--red); border-color: #efc9c5; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.link { background: none; color: var(--blue); padding: 0; border: 0; font-weight: 500; }
.btn[disabled] { opacity: .6; cursor: wait; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: inline; }

.alert { padding: 11px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; border-left: 4px solid; }
.alert.success { background: var(--green-soft); border-color: var(--green); }
.alert.error { background: var(--red-soft); border-color: var(--red); }
.alert.info { background: var(--blue-soft); border-color: var(--blue); }

.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--paper); color: var(--muted); white-space: nowrap; }
.tag.ativo, .tag.aberto { background: var(--green-soft); color: var(--green); }
.tag.encerrado, .tag.fechado { background: #eceef3; color: #5a6278; }
.tag.provavel, .tag.late { background: var(--red-soft); color: var(--red); }
.tag.possivel, .tag.soon { background: var(--gold-soft); color: #8a5a00; }
.tag.remoto { background: var(--blue-soft); color: var(--blue); }
.tag.empresa { background: var(--ink); color: #fff; }

/* Formulários */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.f-12 { grid-column: span 12; } .f-8 { grid-column: span 8; } .f-6 { grid-column: span 6; }
.f-4 { grid-column: span 4; } .f-3 { grid-column: span 3; } .f-2 { grid-column: span 2; }
label, .label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #394157; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid #cfd4e0; border-radius: 6px; font: inherit; font-size: 14px; background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(58,79,128,.15); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
fieldset { border: 0; padding: 0; margin: 0; }
.form-section { padding: 18px 0 20px; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; margin-bottom: 12px; color: var(--ink); }
.f-1 { grid-column: span 1; } .f-5 { grid-column: span 5; } .f-9 { grid-column: span 9; }
.card.flush .table-wrap { margin: 0; }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .grow { flex: 1 1 240px; }
.filters select, .filters input { width: auto; min-width: 140px; }
.filters .grow input { width: 100%; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfd; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfd; }
.table .strong { font-weight: 600; color: var(--text); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 12px; }

.pagination { display: flex; gap: 4px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pagination a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; color: var(--text); border: 1px solid var(--line); background: #fff; }
.pagination a.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .dots { padding: 6px; }

/* ---------- Dashboard ---------- */
.ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--ink); color: #fff; border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.ledger a { color: inherit; padding: 20px 22px 18px; border-right: 1px solid rgba(255,255,255,.09); display: block; position: relative; }
.ledger a:last-child { border-right: 0; }
.ledger a:hover { background: var(--ink-2); text-decoration: none; }
.ledger .n { font-family: var(--serif); font-size: 44px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.ledger .l { font-size: 13px; color: #b9c3dc; margin-top: 8px; display: flex; align-items: center; gap: 7px; }
.ledger .l i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.money-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.money { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.money .v { font-family: var(--serif); font-size: 28px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.money .k { font-size: 13px; color: var(--muted); }
.money.primary { border-top: 3px solid var(--gold); }
.chart-box { position: relative; height: 260px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.list-plain li:last-child { border-bottom: 0; }
.date-chip { min-width: 46px; text-align: center; border-radius: 6px; background: var(--paper); padding: 4px 0; line-height: 1.1; }
.date-chip b { display: block; font-family: var(--serif); font-size: 19px; color: var(--ink); }
.date-chip small { font-size: 11px; color: var(--muted); }
.date-chip.today { background: var(--gold); }

/* ---------- Ficha do procedimento ---------- */
.proc-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 16px; }
.proc-head .numero { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.proc-head .sub { color: var(--muted); margin-top: 4px; }
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 20px; }
.meta dt { font-size: 12px; color: var(--muted); }
.meta dd { margin: 2px 0 0; font-weight: 500; word-break: break-word; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; font: inherit; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs button.active { color: var(--ink); border-color: var(--gold); font-weight: 650; }
.tabs button .c { font-size: 11px; background: var(--paper); border-radius: 10px; padding: 1px 7px; margin-left: 4px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 14px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--ink-3); }
.timeline li.gold::before { border-color: var(--gold); background: var(--gold); }
.timeline .when { font-size: 12.5px; color: var(--muted); }
.timeline .what { white-space: pre-line; }
.inline-form { background: var(--paper); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.obs { white-space: pre-line; background: var(--paper); border-radius: 6px; padding: 12px 14px; }

/* Fórum */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 12px; }
.msg .bubble { background: #fff; border: 1px solid var(--line); border-radius: 0 10px 10px 10px; padding: 12px 15px; flex: 1; }
.msg.mine .bubble { background: #f6f3ea; border-color: #eadfc4; }
.msg .who { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.msg .who b { color: var(--text); }
.msg .body { white-space: pre-line; }
.msg.system .bubble { background: none; border: 0; padding: 4px 0; color: var(--muted); font-style: italic; }
.new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 6px; }

/* Calendário */
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-nav h2 { font-family: var(--serif); font-size: 20px; min-width: 190px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .dow { font-size: 12px; color: var(--muted); padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbfd; }
.cal .day { min-height: 108px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.cal .day.out { background: #f8f9fb; }
.cal .day.out .d { color: #b0b6c5; }
.cal .day.today .d { background: var(--gold); color: var(--ink); }
.cal .d { font-size: 12.5px; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.ev { display: block; font-size: 12px; padding: 2px 6px; border-radius: 4px; margin-top: 3px; background: var(--blue-soft); color: #1f3f8c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.audiencia { background: var(--gold-soft); color: #7a4f00; }
.ev.done { text-decoration: line-through; opacity: .55; }
.ev.late { background: var(--red-soft); color: var(--red); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(18, 26, 48, .55); }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: min(640px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 60px rgba(0,0,0,.25); }
.modal-box.wide { width: min(900px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-family: var(--serif); font-size: 19px; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* Aviso de confidencialidade */
.conf-box { border-top: 5px solid var(--gold); }
.conf-seal { width: 54px; height: 54px; border-radius: 50%; background: var(--ink); color: var(--gold); display: grid; place-items: center; margin-bottom: 14px; }
.conf-box p { line-height: 1.65; }

/* Login */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: "§"; position: absolute; right: -30px; bottom: -120px; font-family: var(--serif); font-size: 460px; line-height: 1; color: rgba(255,255,255,.035); pointer-events: none; }
.auth-side h2 { font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.25; max-width: 460px; }
.auth-side p { color: #b9c3dc; max-width: 440px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.auth-form form { width: min(360px, 100%); }
.auth-form h1 { font-family: var(--serif); font-size: 26px; margin-bottom: 6px; }
.auth-form .field { margin-top: 16px; }
.auth-form .btn { width: 100%; margin-top: 22px; padding: 11px; }

/* Resultado DataJud */
.dj-mov { font-size: 13.5px; }
.dj-mov td:first-child { white-space: nowrap; color: var(--muted); }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .g-main, .g-3 { grid-template-columns: 1fr; }
  .money-row { grid-template-columns: 1fr 1fr; }
  .money-row .primary { grid-column: span 2; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(18,26,48,.45); }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .topbar { padding: 0 14px; }
  .content { padding: 18px 14px 40px; }
  .ledger { grid-template-columns: 1fr 1fr; }
  .ledger a:nth-child(2) { border-right: 0; }
  .ledger a:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.09); }
  .g-2 { grid-template-columns: 1fr; }
  .form-grid > * { grid-column: span 12 !important; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 28px; min-height: 0; }
  .auth-side h2 { font-size: 24px; }
  .cal .day { min-height: 72px; }
  .ev { font-size: 0; height: 6px; padding: 0; }
  .topbar .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main { margin: 0; }
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--paper); padding: 1px 5px; border-radius: 4px; }
