/* public/css/base.css — Design System Câmara Digital */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  --gold: #C9A84C;
  --gold-light: #E8C97A;
  --gold-dim: #7A6230;
  --bg: #0D0F14;
  --bg2: #13161D;
  --bg3: #1A1E27;
  --surface: #1E2330;
  --surface2: #252B3B;
  --border: #2A3045;
  --text: #E8EAF0;
  --text-dim: #8B92A8;
  --text-muted: #4A5168;
  --green: #3ECF8E;
  --red: #F56565;
  --blue: #63B3ED;
  --amber: #F6AD55;
  --radius: 10px;
  --radius-lg: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Tipografia ─────────────────────────────────── */
h1, h2, h3 { font-family: 'Playfair Display', serif; font-weight: 700; }
.mono { font-family: 'IBM Plex Mono', monospace; }

/* ── Layout ─────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page { padding: 32px 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }

/* ── Cards ──────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-sm { padding: 14px 16px; }

/* ── Botões ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  letter-spacing: .02em;
  text-decoration: none;
}

.btn-primary  { background: var(--gold);   color: #0D0F14; font-weight: 600; }
.btn-primary:hover  { background: var(--gold-light); }

.btn-ghost    { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover    { color: var(--text); border-color: var(--text-dim); }

.btn-danger   { background: rgba(245,101,101,.1); color: var(--red); border: 1px solid rgba(245,101,101,.3); }
.btn-danger:hover   { background: rgba(245,101,101,.2); }

.btn-success  { background: rgba(62,207,142,.1); color: var(--green); border: 1px solid rgba(62,207,142,.3); }
.btn-success:hover  { background: rgba(62,207,142,.2); }

.btn-sm   { padding: 6px 12px; font-size: 12px; }
.btn-lg   { padding: 14px 28px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Badges ─────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .06em;
}
.badge-gold  { background: rgba(201,168,76,.14); color: var(--gold); border: 1px solid rgba(201,168,76,.3); }
.badge-green { background: rgba(62,207,142,.12); color: var(--green); border: 1px solid rgba(62,207,142,.25); }
.badge-red   { background: rgba(245,101,101,.12); color: var(--red); border: 1px solid rgba(245,101,101,.25); }
.badge-blue  { background: rgba(99,179,237,.12); color: var(--blue); border: 1px solid rgba(99,179,237,.25); }
.badge-dim   { background: var(--surface); color: var(--text-dim); border: 1px solid var(--border); }

/* ── Tabela ─────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 11px 16px; text-align: left;
  font-size: 10px; font-weight: 600; letter-spacing: .1em;
  color: var(--text-muted); text-transform: uppercase;
  background: var(--bg3); border-bottom: 1px solid var(--border);
}
td { padding: 12px 16px; font-size: 13px; color: var(--text); border-bottom: 1px solid rgba(42,48,69,.5); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Form ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; letter-spacing: .04em; text-transform: uppercase; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif; font-size: 13px;
  transition: border-color .18s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--gold);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-select { appearance: none; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Toggle/Switch ──────────────────────────────── */
.toggle {
  position: relative; display: inline-flex;
  align-items: center; gap: 10px; cursor: pointer;
}
.toggle input { display: none; }
.toggle-track {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--border); transition: background .2s;
  position: relative;
}
.toggle-track::after {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px;
  transition: transform .2s;
}
.toggle input:checked + .toggle-track { background: var(--gold); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }

/* ── Navbar ─────────────────────────────────────── */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.navbar-brand {
  font-family: 'Playfair Display', serif;
  font-size: 17px; color: var(--gold); letter-spacing: .03em;
  text-decoration: none;
}
.navbar-brand small {
  display: block; font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; color: var(--text-muted); letter-spacing: .08em;
  font-weight: 400;
}
.navbar-right { display: flex; align-items: center; gap: 12px; }
.navbar-user { font-size: 12px; color: var(--text-dim); }

/* ── Alerts ─────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; display: flex; align-items: center; gap: 8px;
}
.alert-error   { background: rgba(245,101,101,.1); color: var(--red); border: 1px solid rgba(245,101,101,.25); }
.alert-success { background: rgba(62,207,142,.1); color: var(--green); border: 1px solid rgba(62,207,142,.25); }
.alert-info    { background: rgba(99,179,237,.1); color: var(--blue); border: 1px solid rgba(99,179,237,.25); }
.alert-warn    { background: rgba(246,173,85,.1); color: var(--amber); border: 1px solid rgba(246,173,85,.25); }

/* ── Live dot ───────────────────────────────────── */
.live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--red);
  letter-spacing: .06em; text-transform: uppercase;
}
.live::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.8)} }

/* ── Avatar ─────────────────────────────────────── */
.avatar {
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 700; flex-shrink: 0;
}
.avatar-sm  { width: 28px; height: 28px; font-size: 10px; }
.avatar-md  { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg  { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl  { width: 72px; height: 72px; font-size: 26px; }

/* ── Divider ────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Section header ─────────────────────────────── */
.section-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  color: var(--text-muted); text-transform: uppercase;
}

/* ── Modal ──────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 24px;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  width: 100%; max-width: 500px;
  animation: slideUp .2s ease;
}
.modal-title { font-family: 'Playfair Display', serif; font-size: 20px; margin-bottom: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

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

/* ── Toast ──────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 300;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  animation: slideUp .2s ease;
  max-width: 320px; box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

/* ── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Utilities ──────────────────────────────────── */
.text-gold  { color: var(--gold); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-dim   { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 11px; }
.text-center { text-align: center; }
.mt-4  { margin-top:  4px; }
.mt-8  { margin-top:  8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom:  4px; }
.mb-8  { margin-bottom:  8px; }
.mb-16 { margin-bottom: 16px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }
