/* VMP JURÍDICO — folha de estilo principal (Fase 2) */
:root {
  --ink: #12263a;
  --navy: #0e2a47;
  --navy-700: #173b5e;
  --navy-900: #081c30;
  --gold: #b08a4a;
  --gold-soft: #e8dcc6;
  --ivory: #f7f5f0;
  --surface: #ffffff;
  --line: #dcd7cc;
  --muted: #5b6672;
  --success: #2f6b4f;
  --success-soft: #e7f1eb;
  --warning: #a5702a;
  --warning-soft: #f7eeda;
  --danger: #9b3a32;
  --danger-soft: #f8e9e7;
  --info: #2e5e7e;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(18, 38, 58, 0.04), 0 8px 24px rgba(18, 38, 58, 0.05);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; margin: 0; }

h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 20px; }

code { font-family: var(--mono); font-size: 13px; }

/* ---------------------------------------------------------------- layout */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 252px;
  flex: 0 0 252px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%);
  color: #e9eef4;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: grid;
  gap: 2px;
  padding: 0 6px 22px;
  color: #fff;
  border-bottom: 1px solid rgba(232, 220, 198, 0.18);
}
.brand:hover { color: #fff; }
.brand-monogram {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: 0.12em;
  color: #fff;
}
.brand-word {
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--gold-soft);
  font-weight: 600;
}
.brand-rule {
  display: block;
  width: 42px;
  height: 2px;
  background: var(--gold);
  margin: 10px 0 6px;
}
.brand-sub {
  font-size: 11px;
  color: rgba(233, 238, 244, 0.66);
  letter-spacing: 0.02em;
}

.nav { margin-top: 18px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(233, 238, 244, 0.42);
  margin: 8px 10px 8px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(233, 238, 244, 0.82);
  font-size: 14px;
  position: relative;
}
.nav-link svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  flex: 0 0 19px;
}
.nav-link.is-active {
  background: var(--navy-700);
  color: #fff;
}
.nav-link.is-active::before {
  content: "";
  position: absolute; left: -18px; top: 8px; bottom: 8px;
  width: 3px; background: var(--gold); border-radius: 0 3px 3px 0;
}
.nav-link.is-future { color: rgba(233, 238, 244, 0.36); cursor: default; }
.nav-link.is-future em {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(176, 138, 74, 0.75);
}

.sidebar-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 10px 2px;
  border-top: 1px solid rgba(232, 220, 198, 0.14);
  font-size: 11px;
  color: rgba(233, 238, 244, 0.55);
}
.sidebar-foot strong { display: block; color: rgba(233, 238, 244, 0.82); font-weight: 500; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #6fbf95;
  box-shadow: 0 0 0 4px rgba(111, 191, 149, 0.12);
}

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 66px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.breadcrumb { font-size: 13px; color: var(--muted); letter-spacing: 0.01em; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.user-meta { display: grid; text-align: right; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.user-login { font-size: 11px; color: var(--muted); }
.inline-form { margin: 0; }

.content { padding: 34px 32px 56px; max-width: 1440px; width: 100%; }

/* ------------------------------------------------------------- tipografia */
.eyebrow {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.muted { color: var(--muted); margin: 8px 0 0; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 26px; flex-wrap: wrap;
}

/* ----------------------------------------------------------------- botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--ink); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ----------------------------------------------------------------- alertas */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  margin: 18px 0;
  font-size: 14px;
}
.alert svg {
  width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.alert-success { background: var(--success-soft); border-color: #c7dfd1; color: #21503b; }
.alert-danger { background: var(--danger-soft); border-color: #efcdc8; color: #7b2b25; }
.alert-info { background: #eaf1f6; border-color: #c9dbe8; color: #244a63; }

/* -------------------------------------------------------------------- KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--gold), transparent);
  opacity: 0.85;
}
.kpi-label {
  display: block;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.kpi-value {
  display: block;
  font-family: var(--serif);
  font-size: 38px; line-height: 1.1;
  margin: 10px 0 4px;
  font-variant-numeric: tabular-nums;
}
.kpi-value-sm { font-size: 18px; line-height: 1.35; padding: 6px 0 2px; }
.kpi-note { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ cartões */
.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
  margin-bottom: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-foot {
  margin: 14px 0 0; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef1f4;
  color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: 0.03em;
}
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

.detail-list { margin: 0; display: grid; gap: 0; }
.detail-list > div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid #efebe2;
  font-size: 14px;
}
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; text-align: right; font-weight: 500; }

.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; flex: 0 0 18px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px; font-weight: 700;
}

.roadmap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.roadmap-list li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #efebe2;
  color: var(--muted);
}
.roadmap-list li:last-child { border-bottom: 0; }
.roadmap-list li > span {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 12px; font-weight: 600;
  color: var(--muted);
  background: var(--ivory);
}
.roadmap-list strong { display: block; color: var(--ink); font-weight: 600; font-size: 14px; }
.roadmap-list em { font-style: normal; font-size: 13px; }
.roadmap-list .is-done > span { background: var(--success); border-color: var(--success); color: #fff; }
.roadmap-list .is-current > span { background: var(--navy); border-color: var(--navy); color: #fff; }
.roadmap-list .is-current strong { color: var(--navy); }

/* -------------------------------------------------------------- formulários */
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 620px;
  box-shadow: var(--shadow);
}
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #cfc9bd;
  border-radius: var(--radius-sm);
  background: #fdfcf9;
  font: inherit;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 138, 74, 0.16);
}
.field-hint { color: var(--muted); font-size: 12px; }
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 6px;
}

/* -------------------------------------------------------------------- login */
.auth-body { background: var(--ivory); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }

.auth-brand {
  background:
    radial-gradient(circle at 18% 18%, rgba(176, 138, 74, 0.16), transparent 42%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 78%);
  color: #fff;
  padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-brand::after {
  content: "";
  position: absolute; right: -140px; bottom: -180px;
  width: 460px; height: 460px;
  border: 1px solid rgba(232, 220, 198, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 60px rgba(232, 220, 198, 0.03), 0 0 0 120px rgba(232, 220, 198, 0.02);
}
.auth-brand-top { display: grid; gap: 2px; }
.auth-brand-copy { max-width: 460px; position: relative; z-index: 1; }
.auth-brand-copy h1 { font-size: 42px; line-height: 1.16; color: #fff; margin: 14px 0 18px; }
.auth-brand-copy p { color: rgba(233, 238, 244, 0.72); font-size: 15px; line-height: 1.65; margin: 0; }
.auth-brand-foot { font-size: 12px; color: rgba(233, 238, 244, 0.5); letter-spacing: 0.04em; position: relative; z-index: 1; }

.auth-panel { display: grid; place-items: center; padding: 40px 28px; }
.auth-form-wrap { width: 100%; max-width: 380px; }
.auth-form-wrap h2 { font-size: 30px; margin: 4px 0 6px; }
.auth-form-wrap .muted { font-size: 13px; margin-bottom: 22px; }
.auth-help { margin: 18px 0 0; font-size: 12px; color: var(--muted); }
.auth-copy { margin: 28px 0 0; font-size: 11px; color: #8b949e; }

/* ------------------------------------------------------------------- erros */
.error-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.error-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 480px;
  box-shadow: var(--shadow);
}
.error-card h1 { margin: 6px 0 10px; }
.error-card p { color: var(--muted); margin: 0 0 20px; }

/* -------------------------------------------------------------- responsivo */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .sidebar { width: 78px; flex-basis: 78px; padding: 22px 10px 14px; align-items: center; }
  .brand { padding: 0 0 18px; text-align: center; justify-items: center; }
  .brand-monogram { font-size: 19px; letter-spacing: 0.06em; }
  .brand-word, .brand-sub, .brand-rule { display: none; }
  .nav { width: 100%; }
  .nav-label { display: none; }
  .nav-link { justify-content: center; padding: 11px 8px; }
  .nav-link span, .nav-link em { display: none; }
  .nav-link.is-active::before { left: -10px; }
  .sidebar-foot { display: none; }
  .content { padding: 26px 22px 44px; }
  .topbar { padding: 0 22px; }
}

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 34px 28px; min-height: 260px; }
  .auth-brand-copy h1 { font-size: 32px; }
  .auth-brand-foot { display: none; }
  .auth-panel { padding: 32px 22px 48px; }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .topbar { height: auto; padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  .content { padding: 22px 16px 40px; }
  .user-meta { text-align: left; }
  .detail-list > div { flex-direction: column; gap: 2px; }
  .detail-list dd { text-align: left; }
  .form-card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------ administração */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--navy); border-bottom-color: var(--gold); }

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar-wrap { align-items: flex-end; }
.toolbar-field { display: grid; gap: 4px; min-width: 150px; }
.toolbar-field.grow { flex: 1; min-width: 220px; }
.toolbar-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.toolbar-field input,
.toolbar-field select {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #cfc9bd;
  border-radius: var(--radius-sm);
  background: #fdfcf9;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}
.toolbar-field input:focus,
.toolbar-field select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 138, 74, 0.16);
}
.toolbar-actions { display: flex; gap: 8px; }

.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #fbfaf7;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #efebe2;
  vertical-align: top;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfbf8; }
.cell-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.cell-muted { color: var(--muted); font-size: 13px; }
.col-actions { text-align: right; white-space: nowrap; }
.link-action {
  background: none; border: 0; padding: 0;
  color: var(--navy-700);
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none;
}
.link-action:hover { color: var(--gold); text-decoration: underline; }
.link-danger { color: var(--danger); }

.list-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 12px;
  font-size: 13px; color: var(--muted);
  flex-wrap: wrap;
}
.pagination { display: flex; align-items: center; gap: 10px; }

.empty-state {
  display: grid; gap: 4px; justify-items: center;
  padding: 44px 20px; text-align: center;
  color: var(--muted);
}
.empty-state strong { color: var(--ink); font-family: var(--serif); font-size: 18px; }

.admin-form { display: grid; gap: 18px; max-width: 900px; }
.admin-form-inline { display: grid; gap: 14px; }
.form-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.form-section h2 { margin-bottom: 12px; }
.form-section-separate { max-width: 900px; margin-top: 18px; border-color: #e6dcc8; }
.form-section-separate h2 { font-size: 18px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-grid .span-2 { grid-column: span 2; }
.field textarea {
  min-height: 70px; resize: vertical;
  padding: 9px 12px; border: 1px solid #cfc9bd; border-radius: var(--radius-sm);
  background: #fdfcf9; font: inherit; color: var(--ink);
}
.field textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 138, 74, 0.16);
}

.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.check-option {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
}
.check-option:hover { border-color: var(--line); background: #fcfbf8; }
.check-option input { margin-top: 3px; accent-color: var(--navy); }
.check-option code { margin-left: auto; font-size: 11px; color: var(--muted); }
.permission-group { padding: 12px 0; border-bottom: 1px solid #efebe2; }
.permission-group:last-child { border-bottom: 0; }
.permission-group h3 {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  margin: 0 0 8px;
}

.quick-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-link {
  display: grid; gap: 2px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fdfcf9;
}
.quick-link strong { color: var(--ink); font-size: 14px; }
.quick-link span { color: var(--muted); font-size: 12px; }
.quick-link:hover { border-color: var(--gold); }

.json-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.json-grid h3, .card > h3 {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  margin: 0 0 8px;
}
.code-block {
  background: #f4f1ea;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  overflow: auto;
  max-height: 340px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 16px;
}
.hash { word-break: break-all; font-size: 11px; }
.badge-warn { background: var(--warning-soft); color: var(--warning); }

@media (max-width: 900px) {
  .field-grid, .check-grid, .json-grid, .quick-links { grid-template-columns: 1fr; }
  .field-grid .span-2 { grid-column: span 1; }
}

.topbar-search { flex: 1; max-width: 360px; margin: 0 24px; }
.topbar-search input {
  width: 100%;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfaf7;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.topbar-search input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 138, 74, 0.14);
}
@media (max-width: 900px) {
  .topbar-search { display: none; }
}

/* ---------------------------------------------------------------- clientes */
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-link { font-weight: 600; color: var(--ink); }
.row-link:hover { color: var(--gold); }
.address-block { margin: 0; color: var(--ink); line-height: 1.7; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plain-list li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px solid #efebe2;
}
.plain-list li:last-child { border-bottom: 0; }
.status-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.status-form select {
  min-height: 34px; padding: 4px 8px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fdfcf9; font: inherit; font-size: 13px;
}
.timeline { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 0; }
.timeline li { padding: 12px 0 12px 16px; border-left: 2px solid var(--gold-soft); position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 18px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
}
.timeline-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.timeline-head strong { color: var(--ink); font-weight: 600; }
.timeline p { margin: 6px 0 0; white-space: pre-wrap; }
.timeline .movement-edit { margin-top: 8px; padding-top: 8px; }
.timeline .movement-edit summary { font-size: 12px; }
.timeline .movement-edit .admin-form { margin-top: 10px; }
.inline-details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.inline-details summary {
  cursor: pointer; color: var(--navy-700); font-size: 13px; font-weight: 600;
  list-style: none;
}
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details summary::before { content: "+ "; color: var(--gold); font-weight: 700; }
.inline-details[open] summary::before { content: "− "; }
.inline-details .admin-form { margin-top: 14px; }

/* ------------------------------------------------------------ impressão */
@media print {
  .sidebar, .topbar, .breadcrumb, .head-actions, .tabs, .form-actions, .app-footer, .toast {
    display: none !important;
  }
  .layout, .content { display: block !important; padding: 0 !important; margin: 0 !important; }
  .card, .form-section, .kpi { break-inside: avoid; box-shadow: none !important; border-color: #bbb !important; }
  .page-head { margin-bottom: 12px; }
  body { background: #fff !important; }
  a { color: inherit !important; text-decoration: none !important; }
}
.calc-links { margin-top: 12px; }
.calc-links-grid { margin-top: 10px; }
.link-danger { color: var(--danger, #a12d2d); background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }
.col-actions .inline-form { display: inline; margin-left: 10px; }
.btn-danger { border-color: #c98b8b; color: #8a1f1f; }

/* ------------------------------------------------------------ editor de modelos */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}
.editor-main { min-width: 0; }
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 7px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f7f5f0;
}
.editor-toolbar button {
  min-width: 32px;
  padding: 5px 8px;
  border: 1px solid #cfc9bd;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.editor-toolbar button:hover { border-color: var(--gold); background: #fffdf8; }
.editor-sep { width: 1px; height: 24px; background: var(--line); margin: 0 3px; }
.editor-reference {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fcfbf8;
  padding: 12px;
  max-height: 560px;
  overflow: auto;
}
.editor-reference h3 { margin: 0 0 3px; font-size: 14px; }
.editor-reference p { margin: 0 0 9px; font-size: 11px; color: var(--muted); }
.placeholder-list { display: grid; gap: 4px; }
.placeholder-list button {
  display: grid;
  gap: 1px;
  width: 100%;
  text-align: left;
  padding: 5px 7px;
  border: 1px solid #e4ddd0;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
.placeholder-list button:hover { border-color: var(--gold); }
.placeholder-list code { font-size: 10px; color: var(--navy); }
.placeholder-list span { font-size: 10px; color: var(--muted); }
.document-preview {
  padding: 18px 22px;
  border: 1px solid var(--line);
  background: #fff;
  min-height: 180px;
}
.document-preview p {
  margin: 0 0 0.85em;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.document-preview p:last-child { margin-bottom: 0; }
.doc-align-left { text-align: left; }
.doc-align-center { text-align: center; }
.doc-align-right { text-align: right; }
.doc-align-justify { text-align: justify; }
.doc-bold { font-weight: 700; }
.doc-italic { font-style: italic; }
.doc-underline { text-decoration: underline; }
@media (max-width: 900px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-reference { max-height: 260px; }
}
