@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* ---- Paleta: modo claro ---- */
  --bg:            #F5F3EE;
  --surface:       #FFFFFF;
  --surface-alt:   #ECE9E2;
  --ink:           #1B1F23;
  --ink-soft:      #565049;
  --border:        #DEDACE;
  --gold:          #B8863E;
  --gold-soft:     #E8D9BE;
  --teal:          #2F6B62;
  --teal-soft:     #DCEAE7;
  --rust:          #A5482F;
  --rust-soft:     #F3E1DA;

  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body:    'Inter', -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  --radius: 3px;
  --shadow: 0 1px 2px rgba(27, 31, 35, 0.06), 0 4px 16px rgba(27, 31, 35, 0.04);
}

[data-theme="dark"] {
  --bg:            #14181C;
  --surface:       #1B2025;
  --surface-alt:   #23292F;
  --ink:           #EDEAE3;
  --ink-soft:      #A7A196;
  --border:        #30363C;
  --gold:          #D4A05C;
  --gold-soft:     #3A3122;
  --teal:          #5EA89C;
  --teal-soft:     #1D2E2B;
  --rust:          #D17555;
  --rust-soft:     #33221D;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 20px rgba(0,0,0,0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  transition: background 0.2s ease, color 0.2s ease;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.mono { font-family: var(--font-mono); font-size: 0.85em; }

a { color: inherit; text-decoration: none; }

/* ---------- Layout raiz ---------- */

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar: índice editorial ---------- */

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 28px 0;
  display: flex;
  flex-direction: column;
}

.masthead {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.masthead .brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.masthead .brand::after {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--gold);
  margin-top: 8px;
}

.masthead .tagline {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-top: 6px;
}

nav.menu { flex: 1; overflow-y: auto; }

.menu-group { margin-bottom: 2px; }

.menu-item, .menu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.menu-item:hover, .menu-toggle:hover {
  color: var(--ink);
  background: var(--surface-alt);
}

.menu-item.active {
  color: var(--ink);
  border-left: 2px solid var(--gold);
  background: var(--surface-alt);
  font-weight: 600;
}

.menu-toggle .chevron {
  font-size: 10px;
  transition: transform 0.2s ease;
  color: var(--ink-soft);
}

.menu-toggle.open .chevron { transform: rotate(90deg); }

.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.submenu.open { max-height: 400px; }

.submenu .menu-item {
  padding-left: 40px;
  font-size: 13px;
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--gold);
}

.user-name { font-size: 13.5px; font-weight: 500; }

/* ---------- Conteúdo principal ---------- */

main.content {
  padding: 32px;
  max-width: 1280px;
}

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 { font-size: 26px; margin: 0; }

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}

/* ---------- Tabs (edição do jornal) ---------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}

.tab.active {
  color: var(--ink);
  border-bottom: 2px solid var(--gold);
}

/* ---------- Tabela editorial (sumário de edição) ---------- */

.editorial-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.editorial-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.editorial-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}

.editorial-table tr:last-child td { border-bottom: none; }

.editorial-table tr:hover td { background: var(--surface-alt); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-aprovado  { background: var(--teal-soft); color: var(--teal); }
.badge-pendente  { background: var(--rust-soft); color: var(--rust); }
.badge-sugestao  { background: var(--gold-soft); color: var(--gold); }

/* ---------- Botões e formulários ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { opacity: 0.85; }

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--ink); }
.btn-outline:hover { background: var(--surface-alt); }

.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { opacity: 0.9; }

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

textarea.form-control { resize: vertical; min-height: 100px; }

/* ---------- Cards / empty states ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

.empty-state .display { font-size: 18px; margin-bottom: 8px; color: var(--ink); }

.flash {
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 500;
}

.flash-success { background: var(--teal-soft); color: var(--teal); }
.flash-error   { background: var(--rust-soft); color: var(--rust); }

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

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
