/* ── Design Tokens & Base ─────────────────────────────────────────────
   Tema CLARO premium — alinhado à landing page (navy / azul / dourado,
   fontes Playfair Display + Inter). Os nomes das variáveis foram
   mantidos para que todos os painéis herdem o novo tema sem reescrita. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,400&display=swap');

:root {
  /* Marca (espelha a landing) */
  --navy:       #0f1f3d;
  --navy-mid:   #1a3260;

  /* Neutros — agora CLAROS */
  --ink:        #16213e;   /* texto principal (navy quase preto) */
  --ink-soft:   #3c4660;   /* texto secundário */
  --muted:      #6b7488;   /* texto apagado */
  --line:       rgba(15, 31, 61, 0.10);   /* bordas suaves */
  --paper:      #f6f4ef;   /* fundo da página (creme) */
  --panel:      #ffffff;   /* cards */
  --panel-soft: #f3f2ee;   /* superfície suave */
  --panel-2:    #eae8e1;   /* superfície 2 */

  /* Azul = destaque PRINCIPAL */
  --accent:     #1e5fc2;
  --accent-deep:#163e7d;
  --accent-soft:rgba(30, 95, 194, 0.10);

  /* Dourado — acento quente */
  --gold:       #b4831f;   /* dourado escuro, legível em fundo claro */
  --gold-light: #c9922a;
  --gold-soft:  rgba(201, 146, 42, 0.13);
  --coral:      #d65a3c;
  --coral-soft: rgba(214, 90, 60, 0.12);
  --sky:        rgba(30, 95, 194, 0.10);
  --success:    #1c9b66;
  --warning:    #b4831f;
  --danger:     #cf3e3a;

  /* Sidebar escura (como o hero da landing) */
  --sidebar-bg:        #0f1f3d;
  --sidebar-bg-2:      #0b1830;
  --sidebar-text:      rgba(255, 255, 255, 0.72);
  --sidebar-ink:       #ffffff;
  --sidebar-muted:     rgba(255, 255, 255, 0.45);
  --sidebar-line:      rgba(255, 255, 255, 0.09);
  --sidebar-active-bg: rgba(255, 255, 255, 0.08);

  /* Topbar clara (opaca o suficiente p/ dispensar backdrop-filter) */
  --topbar-bg:  rgba(248, 247, 243, 0.96);

  --shadow-xl:  0 28px 70px rgba(15, 31, 61, 0.18);
  --shadow-md:  0 14px 34px rgba(15, 31, 61, 0.10);
  --shadow-sm:  0 2px 12px rgba(15, 31, 61, 0.06);
  --radius:     12px;
  --radius-sm:  8px;

  /* Tipografia */
  --font-body:    'Inter', "Segoe UI", sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

/* ── Reset ─────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; letter-spacing: 0; }
html { scroll-behavior: smooth; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(30,95,194,0.05), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(201,146,42,0.045), transparent 34%),
    var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ── Utility ───────────────────────────────────────────────────────── */

.hidden { display: none !important; }
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

/* ── Buttons ───────────────────────────────────────────────────────── */

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .25s ease,
              background .2s ease, border-color .2s ease, opacity .15s ease, filter .2s ease;
}
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; filter: saturate(.75); }
.btn:disabled::before { display: none; }

/* Brilho que varre o botão no hover (passa sob o texto) */
.btn-primary::before,
.btn-gold::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -125%;
  width: 60%;
  z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-18deg);
  transition: left .6s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
}
.btn-primary:hover::before,
.btn-gold:hover::before { left: 135%; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(30,95,194,.28), inset 0 1px 0 rgba(255,255,255,.20);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(30,95,194,.42), inset 0 1px 0 rgba(255,255,255,.28);
}
.btn-primary:active {
  box-shadow: 0 3px 10px rgba(30,95,194,.30), inset 0 1px 0 rgba(255,255,255,.14);
}

/* Variante dourada — CTA de alto destaque (igual ao hero da landing) */
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  color: #2c2008;
  box-shadow: 0 4px 14px rgba(201,146,42,.34), inset 0 1px 0 rgba(255,255,255,.38);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(201,146,42,.48), inset 0 1px 0 rgba(255,255,255,.48);
}
.btn-gold:active {
  box-shadow: 0 3px 10px rgba(201,146,42,.34), inset 0 1px 0 rgba(255,255,255,.26);
}

.btn-ghost {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(30,95,194,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}
.btn-ghost:hover {
  background: rgba(30,95,194,.13);
  border-color: rgba(30,95,194,.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30,95,194,.16), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn-ghost:active { box-shadow: none; }

.btn-danger {
  background: rgba(207,62,58,.10);
  color: var(--danger);
  border-color: rgba(207,62,58,.30);
}
.btn-danger:hover {
  background: rgba(207,62,58,.16);
  border-color: rgba(207,62,58,.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(207,62,58,.18);
}
.btn-danger:active { box-shadow: none; }

.btn-full { width: 100%; }

/* ── Form elements ─────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  padding: 10px 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  outline: none;
}
.field input::placeholder { color: var(--muted); }

/* ── App Shell (sidebar layout) ────────────────────────────────────── */

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  border-right: 1px solid var(--sidebar-line);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  gap: 4px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--sidebar-line);
  margin-bottom: 8px;
}
.sidebar-brand img { width: 28px; height: 28px; border-radius: 6px; }
.sidebar-brand-name { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--sidebar-ink); }
.sidebar-brand-name span { color: var(--gold-light); }
.sidebar-meta { font-size: 11px; color: var(--sidebar-muted); margin-top: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar-text);
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  border-radius: 0;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.nav-item:hover { background: var(--sidebar-active-bg); color: var(--sidebar-ink); }
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-ink);
  font-weight: 600;
  border-left-color: var(--gold-light);
}
.nav-item.active svg { color: var(--gold-light); }

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 12px 20px 4px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px 0;
  border-top: 1px solid var(--sidebar-line);
}
.session-info { font-size: 13px; }
.session-info strong { display: block; color: var(--sidebar-ink); }
.session-info small { color: var(--sidebar-muted); }

/* Logout sobre a sidebar escura — precisa de contraste próprio */
.sidebar-footer .btn-danger {
  background: rgba(248, 113, 113, 0.14);
  color: #ff8f8b;
  border-color: rgba(248, 113, 113, 0.34);
}
.sidebar-footer .btn-danger:hover {
  background: rgba(248, 113, 113, 0.22);
  border-color: rgba(248, 113, 113, 0.5);
  color: #ffb0ad;
}

/* ── Main content area ─────────────────────────────────────────────── */

.main-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-size: 17px; font-weight: 700; font-family: var(--font-display); }
.topbar-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.page-body { padding: 28px; flex: 1; }

/* ── Cards / Blocks ────────────────────────────────────────────────── */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── KPI Grid ──────────────────────────────────────────────────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kpi-value { font-size: 28px; font-weight: 700; font-family: var(--font-display); color: var(--ink); }
.kpi-meta { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

/* ── Status Pills ──────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.pill-review   { background: var(--gold-soft);  color: var(--gold); }
.pill-approved { background: rgba(52,211,153,.15); color: var(--success); }
.pill-blocked  { background: rgba(248,113,113,.15); color: var(--danger); }
.pill-active   { background: var(--accent-soft); color: var(--accent); }

/* ── Table ─────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
tbody td { padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .1s; }
tbody tr:hover { background: var(--accent-soft); }
tbody tr.selected { background: rgba(43,132,255,0.1); }

/* ── Score bar ─────────────────────────────────────────────────────── */

.score-bar { display: flex; align-items: center; gap: 8px; }
.score-track { flex: 1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.score-fill  { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }
.score-value { font-size: 13px; font-weight: 600; min-width: 28px; }

/* ── Two-col layout ────────────────────────────────────────────────── */

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

/* ── Hamburger (visível só no mobile) ─────────────────────────────── */

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ink);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: background .12s;
}
.hamburger:hover { background: var(--panel-soft); }

/* ── Overlay do drawer mobile ─────────────────────────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,31,61,0.42);
  z-index: 199;
}

/* ── Responsividade mobile ─────────────────────────────────────────── */

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -240px;
    width: 240px;
    height: 100%;
    z-index: 200;
    transition: left .24s cubic-bezier(.4,0,.2,1), box-shadow .24s ease;
  }

  .sidebar-open .sidebar {
    left: 0;
    box-shadow: 6px 0 28px rgba(15,31,61,0.24);
  }

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

  .topbar { padding: 12px 16px; }
  .page-body { padding: 16px; }

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

  .opportunities-layout { flex-direction: column; }
}
