/* ============================================================
   Panda — CSS Principal
   ============================================================ */

:root {
  --primary: #1e3a5f;
  --primary-light: #2a5298;
  --accent: #2e7d52;
  --accent-light: #3d9c68;
  --accent-hover: #245f40;
  --bg: #f5f7fa;
  --bg-card: #ffffff;
  --text: #1a2744;
  --text-muted: #64748b;
  --border: #c8d5e0;
  --sidebar-bg: #1e3a5f;
  --sidebar-text: #c8d8f0;
  --sidebar-active: rgba(46, 125, 82, 0.25);
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 10px;
  --transition: all 0.2s ease;
  --sidebar-width: 240px;
}

[data-theme="dark"] {
  --bg: #0f1923;
  --bg-card: #1a2d44;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #2d4a6b;
  --sidebar-bg: #0d1824;
  --sidebar-text: #94b8d8;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.25s, color 0.25s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   LAYOUT: Sidebar + Main
   ============================================================ */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.sidebar-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 82, 0.22), 0 3px 10px rgba(0,0,0,0.28);
  padding: 2px;
  flex-shrink: 0;
}

.logo-fallback {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.sidebar-app-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.sidebar-app-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.sidebar-app-version {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--sidebar-text);
  opacity: 0.7;
  letter-spacing: 0.03em;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 0;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #ffffff;
  border-left-color: var(--accent-light);
}

.sidebar-footer {
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.logout-item { color: #f87171 !important; }
.logout-item:hover { background: rgba(248,113,113,0.12) !important; color: #fca5a5 !important; }

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  width: 100%;
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
  text-align: left;
}

.theme-toggle:hover { background: var(--sidebar-hover); color: #ffffff; }
.theme-toggle svg { width: 18px; height: 18px; flex-shrink: 0; }

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.theme-label { font-size: 0.9rem; }

/* Main content */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-wrapper {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
}

/* Mobile header */
.mobile-header {
  display: none;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-title { font-weight: 700; font-size: 1.1rem; color: var(--text); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 90;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 1.25rem; }
.card-body.p-0 { padding: 0; }

/* ============================================================
   STATS
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 22px; height: 22px; }

.stat-icon-blue { background: rgba(42,82,152,0.12); color: var(--primary-light); }
.stat-icon-green { background: rgba(46,125,82,0.12); color: var(--accent); }
.stat-icon-purple { background: rgba(124,58,237,0.12); color: #7c3aed; }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ============================================================
   DASHBOARD GRID
   ============================================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* Bar chart SVG-style puro */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 200px;
  padding-bottom: 1.5rem;
  overflow-x: auto;
}

.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  min-width: 48px;
}

.bar-wrap {
  display: flex;
  align-items: flex-end;
  height: 160px;
}

.bar-fill {
  width: 32px;
  min-height: 4px;
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
  border-radius: 4px 4px 0 0;
  transition: opacity 0.2s;
  cursor: default;
}

.bar-fill:hover { opacity: 0.8; }

.bar-label { font-size: 0.72rem; color: var(--text-muted); }
.bar-value { font-size: 0.72rem; font-weight: 600; color: var(--text); }

/* Quick search */
.quick-search-form { }
.input-group { display: flex; gap: 0.5rem; }
.input-group .form-control { flex: 1; }

/* Recent list */
.recent-list { list-style: none; }

.recent-item { border-bottom: 1px solid var(--border); }
.recent-item:last-child { border-bottom: none; }

.recent-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.25rem;
  text-decoration: none;
  transition: var(--transition);
  gap: 1rem;
}

.recent-link:hover { background: var(--bg); }

.recent-info { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; }

.recent-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-date { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--bg); border-color: var(--text-muted); color: var(--text); }

.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

/* ============================================================
   FORMS
   ============================================================ */

.form-group { display: flex; flex-direction: column; gap: 0.3rem; }

label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.form-control {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46,125,82,0.12);
}

.form-control-lg { padding: 0.7rem 0.9rem; font-size: 1rem; }

select.form-control { cursor: pointer; }

.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }

.required { color: #dc2626; }

.form-standard { display: flex; flex-direction: column; gap: 1rem; }

.form-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
}

.form-group-lg { }

.form-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

/* Filter form */
.filter-form { }
.filter-row { display: flex; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap; }
.filter-field { flex: 1; min-width: 180px; }
.filter-field-sm { flex: 0 0 120px; min-width: 100px; }
.filter-field-btn { flex: 0 0 auto; }

/* File input */
.file-input-wrapper { position: relative; }
.file-input { position: absolute; opacity: 0; width: 0; height: 0; }
.file-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border: 2px dashed var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: var(--transition);
}
.file-label svg { width: 20px; height: 20px; }
.file-label:hover { border-color: var(--accent); color: var(--accent); background: rgba(46,125,82,0.04); }

/* ============================================================
   TABLE
   ============================================================ */

.table-wrapper { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}

.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg); }

.table-compact th { padding-left: 0.5rem; padding-right: 0.5rem; }
.table-compact td { padding-left: 0.5rem; padding-right: 0.5rem; }
.td-data { font-size: calc(0.875rem - 1pt); color: var(--text-muted); white-space: nowrap; }
.th-data { font-size: calc(0.78rem - 1pt) !important; }
.td-seq { width: 40px; color: var(--text-muted); font-size: 0.8rem; text-align: right; white-space: nowrap; padding-right: 0.5rem !important; }
.td-truncate { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-partes { max-width: 260px; }
.td-partes div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.875rem; }
.td-partes div:not(:last-child) { margin-bottom: 0.1rem; }
.td-actions-cell { vertical-align: middle; white-space: nowrap; }
.td-actions { display: flex; gap: 0.25rem; align-items: center; }
.td-assunto { max-width: 300px; }
.td-assunto-item {
  font-size: 0.83rem; line-height: 1.4;
  padding-left: 0.85rem; position: relative;
  overflow-wrap: break-word; word-break: break-word;
}
.td-assunto-item::before {
  content: "·"; position: absolute; left: 0;
  color: var(--text-muted); font-weight: 700;
}
.td-assunto-item:not(:last-child) { margin-bottom: 0.2rem; }
.td-assunto-resultado { opacity: 0.75; font-size: 0.78rem; }
.resultado-def { color: #059669; font-weight: 500; }
.resultado-ind { color: #dc2626; font-weight: 500; }
[data-theme="dark"] .resultado-def { color: #34d399; }
[data-theme="dark"] .resultado-ind { color: #f87171; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; text-decoration: none; }
.btn-icon svg { width: 15px; height: 15px; }
.btn-icon:hover { background: var(--bg); color: var(--primary); border-color: var(--primary); }
.btn-icon-danger { color: var(--text-muted); }
.btn-icon-danger:hover { background: #fef2f2; color: #dc2626; border-color: #dc2626; }
mark.destaque { background: #fef08a; color: inherit; border-radius: 2px; padding: 0 1px; }
mark.destaque-ativa { background: #f59e0b; outline: 2px solid #d97706; }
.text-mono { font-family: "Courier New", Courier, monospace; font-size: 0.82rem; }
.text-muted { color: var(--text-muted); }
.text-nowrap { white-space: nowrap; }

/* ============================================================
   MODELOS
   ============================================================ */
.modelos-lista { list-style: none; padding: 0; margin: 0; }
.modelo-item { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1.25rem; border-bottom: 1px solid var(--border); }
.modelo-item:last-child { border-bottom: none; }
.modelo-item:hover { background: var(--bg); }
.modelo-label { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; flex: 1; min-width: 0; user-select: none; }
.modelo-label input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; accent-color: var(--primary); }
.modelo-nome { font-size: 0.9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modelos-selecionar-todos { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.875rem; color: var(--text-muted); user-select: none; }
.modelos-selecionar-todos input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

/* ============================================================
   BADGES & TAGS
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-year { background: rgba(42,82,152,0.12); color: var(--primary-light); }

.tag {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(46,125,82,0.1);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pagination-info { font-size: 0.875rem; color: var(--text-muted); }

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(220,38,38,0.08);
  border-color: rgba(220,38,38,0.2);
  color: #dc2626;
}

.alert-info {
  background: rgba(42,82,152,0.08);
  border-color: rgba(42,82,152,0.2);
  color: var(--primary-light);
}

/* ============================================================
   META GRID (detalhe sentença)
   ============================================================ */

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.meta-item { display: flex; flex-direction: column; gap: 0.2rem; }
.meta-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.meta-value { font-size: 0.9rem; color: var(--text); }

/* Texto completo */
.texto-completo {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.83rem;
  line-height: 1.7;
  color: var(--text);
  padding: 1.25rem;
  max-height: 500px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============================================================
   BUSCA — resultados
   ============================================================ */

.busca-form { }

.busca-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.busca-field-main { flex: 1; min-width: 260px; }
.busca-field-ano { flex: 0 0 140px; }
.busca-field-btn { flex: 0 0 auto; }

.resultados-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.resultados-lista { display: flex; flex-direction: column; gap: 0.75rem; }

.resultado-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  transition: var(--transition);
}

.resultado-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(46,125,82,0.1); }

.resultado-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.resultado-processo { font-size: 0.82rem; color: var(--text-muted); }

.resultado-assunto { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.resultado-assunto a { color: var(--text); text-decoration: none; }
.resultado-assunto a:hover { color: var(--accent); }

.resultado-partes { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.resultado-trecho {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border-radius: 4px;
  border-left: 3px solid var(--accent-light);
  margin-bottom: 0.75rem;
}

.resultado-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Mark — destaque de busca */
mark {
  background: rgba(46, 125, 82, 0.2);
  color: var(--accent-hover);
  font-weight: 600;
  border-radius: 2px;
  padding: 0 2px;
}

[data-theme="dark"] mark {
  background: rgba(61, 156, 104, 0.25);
  color: var(--accent-light);
}

/* ============================================================
   AUTH PAGES
   ============================================================ */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1rem;
}

.auth-container { width: 100%; max-width: 400px; }

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 2.5rem 2rem;
  animation: fadeIn 0.3s ease;
}

.auth-logo {
  text-align: center;
  margin-bottom: 0.75rem;
}

.auth-logo img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 5px rgba(46, 125, 82, 0.18), 0 6px 24px rgba(30, 58, 95, 0.18);
  padding: 3px;
}

.logo-fallback-auth {
  font-size: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  width: 100px; height: 100px;
}

.auth-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-text { font-size: 1rem; color: var(--text); margin-bottom: 0.5rem; }

/* ============================================================
   ANIMATION
   ============================================================ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease both; }

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }

  .sidebar-overlay.open { display: block; }

  .main-content { margin-left: 0; }

  .mobile-header { display: flex; }

  .page-wrapper { padding: 1rem; }

  .dashboard-grid { grid-template-columns: 1fr; }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .header-actions { width: 100%; }

  .meta-grid { grid-template-columns: 1fr 1fr; }

  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-field-sm { flex: 1; }

  .busca-row { flex-direction: column; align-items: stretch; }
  .busca-field-ano { flex: 1; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .td-actions { flex-wrap: wrap; }
}

/* ============================================================
   PRECEDENTES QUALIFICADOS TST
   ============================================================ */

.precedentes-status-card { margin-bottom: 1.25rem; }

.precedentes-accordion details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.precedentes-accordion summary {
  padding: 0.875rem 1rem;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.precedentes-accordion summary::-webkit-details-marker { display: none; }

.precedentes-accordion details[open] summary {
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}

.precedentes-accordion summary svg {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.precedentes-accordion details[open] summary svg {
  transform: rotate(90deg);
}

.badge-fixada {
  background: rgba(46,125,82,0.15);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-pendente {
  background: rgba(180,120,0,0.15);
  color: #b47800;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-superada {
  background: rgba(180,30,30,0.15);
  color: #b41e1e;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-suspensao {
  background: rgba(180,80,0,0.12);
  color: #c05000;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.alert-warning {
  background: rgba(180,120,0,0.08);
  border-color: rgba(180,120,0,0.25);
  color: #b47800;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  border: 1px solid transparent;
  margin-bottom: 0.75rem;
}

.alert-warning a { color: #b47800; text-decoration: underline; }

.precedente-tese {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  margin: 0.75rem 0;
  line-height: 1.65;
  font-size: 0.9rem;
}

.diff-section { margin: 0.5rem 0; }
.diff-adicionado { color: var(--accent); }
.diff-alterado { color: #b47800; }
.diff-removido { color: #b41e1e; }

/* ============================================================
   ADMIN — badges de status
   ============================================================ */

.badge-success  { background: rgba(46,125,82,0.14);  color: #1a6b3a; }
.badge-danger   { background: rgba(220,38,38,0.12);  color: #b91c1c; }
.badge-warning  { background: rgba(180,120,0,0.13);  color: #92610a; }
.badge-admin    { background: rgba(109,40,217,0.12); color: #6d28d9; }
.badge-neutral  { background: rgba(100,116,139,0.12); color: var(--text-muted); }
.badge-info     { background: rgba(42,82,152,0.12);  color: var(--primary-light); }

[data-theme="dark"] .badge-success  { background: rgba(46,125,82,0.22);  color: #4ade80; }
[data-theme="dark"] .badge-danger   { background: rgba(220,38,38,0.2);   color: #f87171; }
[data-theme="dark"] .badge-warning  { background: rgba(180,120,0,0.2);   color: #fbbf24; }
[data-theme="dark"] .badge-admin    { background: rgba(109,40,217,0.2);  color: #c4b5fd; }
[data-theme="dark"] .badge-neutral  { background: rgba(100,116,139,0.2); color: var(--text-muted); }
[data-theme="dark"] .badge-info     { background: rgba(42,82,152,0.2);   color: #93c5fd; }

/* Aliases para os badges do log */
.badge-log-success  { background: rgba(46,125,82,0.14);  color: #1a6b3a; }
.badge-log-danger   { background: rgba(220,38,38,0.12);  color: #b91c1c; }
.badge-log-warning  { background: rgba(180,120,0,0.13);  color: #92610a; }
.badge-log-info     { background: rgba(42,82,152,0.12);  color: var(--primary-light); }
.badge-log-neutral  { background: rgba(100,116,139,0.12); color: var(--text-muted); }

[data-theme="dark"] .badge-log-success  { background: rgba(46,125,82,0.22);  color: #4ade80; }
[data-theme="dark"] .badge-log-danger   { background: rgba(220,38,38,0.2);   color: #f87171; }
[data-theme="dark"] .badge-log-warning  { background: rgba(180,120,0,0.2);   color: #fbbf24; }
[data-theme="dark"] .badge-log-info     { background: rgba(42,82,152,0.2);   color: #93c5fd; }
[data-theme="dark"] .badge-log-neutral  { background: rgba(100,116,139,0.2); color: var(--text-muted); }

/* ============================================================
   ADMIN — alert de sucesso
   ============================================================ */

.alert-success {
  background: rgba(46,125,82,0.1);
  border-color: rgba(46,125,82,0.25);
  color: #1a6b3a;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  border: 1px solid transparent;
}

[data-theme="dark"] .alert-success {
  background: rgba(46,125,82,0.18);
  border-color: rgba(46,125,82,0.35);
  color: #4ade80;
}

/* ============================================================
   ADMIN — avatar de usuário
   ============================================================ */

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================================
   ADMIN — botão success (Ativar)
   ============================================================ */

.btn-success {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-success:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

/* ============================================================
   ADMIN — textos auxiliares
   ============================================================ */

.text-danger { color: #dc2626; }

[data-theme="dark"] .text-danger { color: #f87171; }

/* ============================================================
   ADMIN — separador de seção no nav
   ============================================================ */

.nav-section-sep {
  margin: 0.4rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ============================================================
   ADMIN — checkbox no formulário
   ============================================================ */

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ============================================================
   ADMIN — modal
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  padding: 1.75rem;
  width: 100%;
  max-width: 420px;
  animation: fadeIn 0.2s ease;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
