/* ============================================================================
 * Theme tokens — usado por system.css, styles.css e páginas inline.
 * Este arquivo é a ÚNICA fonte de paleta + tipografia.
 * ========================================================================= */

:root {
  /* ---------- Paleta ---------- */
  --brand-50:  #ecfdf5;
  --brand-100: #d1fae5;
  --brand-300: #6ee7b7;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --brand-800: #065f46;
  --brand-900: #064e3b;

  --ink:       #0f172a;
  --ink-soft:  #1e293b;
  --muted:     #475569;
  --muted-2:   #64748b;
  --line:      #e2e8f0;
  --line-2:    #cbd5e1;
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --surface-2: #f8fafc;

  --danger-50:  #fef2f2;
  --danger-100: #fee2e2;
  --danger-300: #fca5a5;
  --danger-500: #ef4444;
  --danger-700: #b91c1c;
  --danger-800: #991b1b;

  --warn-50:  #fffbeb;
  --warn-100: #fef3c7;
  --warn-300: #fcd34d;
  --warn-500: #f59e0b;
  --warn-700: #b45309;
  --warn-800: #92400e;

  --ok-50:  #f0fdf4;
  --ok-100: #dcfce7;
  --ok-300: #86efac;
  --ok-500: #22c55e;
  --ok-700: #15803d;
  --ok-800: #166534;

  /* ---------- Tipografia ---------- */
  --t-display: 700 2rem/1.1     'Inter', system-ui, sans-serif;
  --t-h1:      900 1.5rem/1.2   'Inter', system-ui, sans-serif;
  --t-h2:      800 1.15rem/1.3  'Inter', system-ui, sans-serif;
  --t-h3:      800 0.95rem/1.35 'Inter', system-ui, sans-serif;
  --t-body:    500 0.9rem/1.5   'Inter', system-ui, sans-serif;
  --t-small:   600 0.78rem/1.4  'Inter', system-ui, sans-serif;
  --t-caption: 800 0.68rem/1.3  'Inter', system-ui, sans-serif;

  --letter-tight:  -0.01em;
  --letter-wide:    0.06em;

  /* ---------- Estrutura ---------- */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --tap:       48px;

  --shadow-sm:  0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:     0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg:  0 12px 28px rgba(15, 23, 42, 0.12);

  --transition: 0.18s ease;
}

/* ---------- Utilitárias tipografia ---------- */
.t-display  { font: var(--t-display);  letter-spacing: var(--letter-tight); color: var(--ink); }
.t-h1       { font: var(--t-h1);       letter-spacing: var(--letter-tight); color: var(--ink); }
.t-h2       { font: var(--t-h2);                                            color: var(--ink); }
.t-h3       { font: var(--t-h3);                                            color: var(--ink); }
.t-body     { font: var(--t-body);                                          color: var(--ink); }
.t-small    { font: var(--t-small);                                         color: var(--muted); }
.t-caption  { font: var(--t-caption); letter-spacing: var(--letter-wide); text-transform: uppercase; color: var(--muted-2); }

/* ---------- Empty state ---------- */
.empty-state-block {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--line-2);
}
.empty-state-block .empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--muted-2);
}
.empty-state-block .empty-icon svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2; }
.empty-state-block .empty-title { font: var(--t-h3); color: var(--ink); margin: 0; }
.empty-state-block .empty-msg { font: var(--t-small); color: var(--muted); margin: 0; max-width: 320px; }
.empty-state-block .empty-cta {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 18px;
  background: var(--brand-700);
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font: var(--t-small);
  font-weight: 800;
  text-transform: uppercase;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font: var(--t-small);
  margin-bottom: 14px;
}
.breadcrumb-nav a {
  color: var(--brand-700);
  text-decoration: none;
  font-weight: 700;
}
.breadcrumb-nav a:hover { text-decoration: underline; }
.breadcrumb-nav .sep { color: var(--line-2); font-weight: 400; }
.breadcrumb-nav .current { color: var(--muted); font-weight: 800; }

/* ---------- Botão com loading ---------- */
.btn-loading {
  position: relative;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---------- Time badge ---------- */
.time-ago-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font: var(--t-caption);
  border: 1px solid var(--line);
}
.time-ago-badge.warn { background: var(--warn-100); color: var(--warn-800); border-color: var(--warn-300); }
.time-ago-badge.danger { background: var(--danger-100); color: var(--danger-800); border-color: var(--danger-300); }

/* ---------- Lightbox ---------- */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
}
.lightbox-backdrop.is-open { display: flex; }
.lightbox-backdrop img {
  max-width: 96vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  color: white;
  padding: 8px 16px;
  border-radius: 999px;
  font: var(--t-small);
  font-weight: 700;
  max-width: 88vw;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

/* ---------- Search input ---------- */
.list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  min-height: var(--tap);
}
.list-search svg { width: 18px; height: 18px; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 2; }
.list-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: 0;
  font: var(--t-body);
  min-height: var(--tap);
  min-width: 0;
}
.list-search-counter {
  font: var(--t-caption);
  color: var(--muted);
  padding: 4px 10px;
  background: var(--surface-2);
  border-radius: 999px;
}
