@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

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

:root {
  --brand:        #1a3a5c;
  --brand-light:  #2563a8;
  --brand-accent: #e8a020;
  --accent:       #2563a8;
  --accent-light: #eff6ff;
  --bg:           #f4f6fa;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;
  --sidebar:      #0f2540;
  --sidebar-text: rgba(255,255,255,0.7);
  --card:         #ffffff;
  --text:         #1a2335;
  --text-muted:   #5a6880;
  --text2:        #5a6880;
  --border:       #e2e8f0;
  --success:      #16a34a;
  --success-light:#dcfce7;
  --warning:      #d97706;
  --danger:       #dc2626;
  --info:         #2563a8;
  --radius:       10px;
  --radius-lg:    14px;
  --font-head:    'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;
}

[data-theme="dark"] {
  --brand:        #3b82f6;
  --brand-light:  #60a5fa;
  --brand-accent: #f59e0b;
  --bg:           #0f172a;
  --surface:      #1e293b;
  --surface-2:    #273549;
  --sidebar:      #070d1a;
  --sidebar-text: rgba(255,255,255,0.6);
  --card:         #1e293b;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --text2:        #94a3b8;
  --border:       #334155;
  --success:      #22c55e;
}

body { font-family: var(--font-body); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }

/* ── LAYOUT ─────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar { width: 230px; min-height: 100vh; background: var(--sidebar); display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }

.logo-area { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); text-align:center; }
.logo-inst  { font-family: var(--font-head); font-size: 10px; font-weight: 700; letter-spacing: 2.5px; color: var(--brand-accent); text-transform: uppercase; margin-bottom: 3px; }
.logo-name  { font-family: var(--font-head); font-size: 14px; font-weight: 800; color: #fff; line-height: 1.1; }
.logo-tag   { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 4px; }

.user-area  { padding: 14px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.avatar     { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 800; font-size: 12px; color: #fff; flex-shrink: 0; }
.user-info .uname { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; }
.user-info .urole { font-size: 11px; color: rgba(255,255,255,0.4); }

.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-section { padding: 10px 20px 3px; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.28); font-weight: 700; }
.nav-item    { display: flex; align-items: center; gap: 10px; padding: 9px 20px; cursor: pointer; color: var(--sidebar-text); font-size: 13px; font-weight: 500; border-left: 3px solid transparent; text-decoration: none; transition: all .15s; }
.nav-item:hover  { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.08); color: #fff; border-left-color: var(--brand-accent); }
.nav-item .icon  { font-size: 15px; width: 20px; text-align: center; }
.nav-item .badge { background: var(--brand-accent); color: #fff; font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 10px; margin-left: auto; }
.nav-item .badge.red { background: var(--danger); }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-footer a { color: rgba(255,255,255,0.4); font-size: 12px; text-decoration: none; display: flex; align-items: center; gap: 6px; }
.sidebar-footer a:hover { color: rgba(255,255,255,0.7); }

/* ── MAIN ─────────────────────────────────────────────────── */
.main-area   { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar      { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.topbar-title { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-date  { font-size: 13px; color: var(--text-muted); }
.page-content { padding: 20px 16px; flex: 1; }

/* THEME TOGGLE */
.theme-toggle { background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; cursor: pointer; font-size: 15px; display: flex; align-items: center; gap: 4px; color: var(--text); }
.theme-toggle:hover { opacity: 0.8; }

/* ── CARDS ───────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--text); }
.card-body { padding: 20px; }

/* ── KPI GRID ─────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.kpi-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.kpi-val   { font-family: var(--font-head); font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.kpi-sub   { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.kpi-card.red    .kpi-val { color: var(--danger); }
.kpi-card.green  .kpi-val { color: var(--success); }
.kpi-card.accent .kpi-val { color: var(--brand-accent); font-size: 22px; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; text-decoration: none; white-space: nowrap; }
.btn-primary  { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-light); color: #fff; }
.btn-warning  { background: var(--brand-accent); color: #fff; }
.btn-warning:hover { opacity: 0.9; }
.btn-accent   { background: var(--brand-accent); color: #fff; }
.btn-outline  { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--surface-2); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-sm       { padding: 5px 12px; font-size: 12px; }
.btn-lg       { padding: 12px 24px; font-size: 15px; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.form-control { width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-family: var(--font-body); font-size: 14px; color: var(--text); background: var(--surface); transition: border-color 0.15s; }
.form-control:focus { outline: none; border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(37,99,168,0.1); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── TABLES ──────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 10px 16px; text-align: left; border-bottom: 2px solid var(--border); background: var(--surface-2); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text); }
tr:hover td { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-novo                { background: #e0f2fe; color: #0369a1; }
.badge-contato             { background: #dbeafe; color: #1d4ed8; }
.badge-em_prospeccao       { background: #f3e8ff; color: #7c3aed; }
.badge-sem_interesse       { background: #f1f5f9; color: #64748b; }
.badge-oportunidade        { background: #fef3c7; color: #b45309; }
.badge-aguardando_pagamento{ background: #ffedd5; color: #c2410c; }
.badge-matricula_concluida { background: #dcfce7; color: #15803d; font-weight: 700; }
.badge-perdido             { background: #fee2e2; color: #b91c1c; }
.badge-pendente            { background: #fef3c7; color: #b45309; }
.badge-ativo               { background: #dcfce7; color: #15803d; }
.badge-pago                { background: #dcfce7; color: #15803d; }
.badge-high                { background: #fee2e2; color: #b91c1c; }
.badge-normal              { background: #dbeafe; color: #1d4ed8; }
.badge-low                 { background: #f1f5f9; color: #64748b; }

[data-theme="dark"] .badge-novo                { background: #0c4a6e; color: #7dd3fc; }
[data-theme="dark"] .badge-contato             { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .badge-oportunidade        { background: #78350f; color: #fcd34d; }
[data-theme="dark"] .badge-aguardando_pagamento{ background: #7c2d12; color: #fdba74; }
[data-theme="dark"] .badge-matricula_concluida { background: #14532d; color: #86efac; }
[data-theme="dark"] .badge-sem_interesse       { background: #1e293b; color: #94a3b8; }
[data-theme="dark"] .badge-perdido             { background: #7f1d1d; color: #fca5a5; }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; margin-bottom: 16px; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
[data-theme="dark"] .alert-success { background: #14532d; color: #86efac; border-color: #166534; }
[data-theme="dark"] .alert-danger  { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }

/* ── PROGRESS ─────────────────────────────────────────────── */
.progress-wrap { background: var(--border); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar  { height: 100%; background: var(--brand-light); border-radius: 4px; transition: width 0.5s; }
.progress-bar.green { background: var(--success); }
.progress-bar.red   { background: var(--danger); }
.progress-bar.amber { background: var(--brand-accent); }

/* ── GRID HELPERS ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ── RANKING ─────────────────────────────────────────────── */
.ranking-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rank-num     { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; background: var(--border); color: var(--text-muted); }
.rank-num.gold   { background: #FFD700; color: #000; }
.rank-num.silver { background: #C0C0C0; color: #000; }
.rank-num.bronze { background: #CD7F32; color: #fff; }

/* ── NOTIFICATIONS ───────────────────────────────────────── */
.bell-wrap  { position: relative; }
.bell-btn   { background: none; border: none; font-size: 20px; cursor: pointer; padding: 6px; color: var(--text2); position: relative; }
.bell-count { position: absolute; top: 2px; right: 2px; background: var(--danger); color: #fff; font-size: 9px; font-weight: 800; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; border: 2px solid #fff; }
.notif-panel  { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 8px 32px rgba(0,0,0,0.12); z-index: 100; overflow: hidden; }
.notif-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); }
.notif-item   { padding: 13px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover     { background: var(--surface-2); }
.notif-item.unread    { border-left: 3px solid var(--brand-accent); }
.notif-item.high      { border-left-color: var(--danger); }
.notif-title { font-weight: 600; font-size: 12px; color: var(--text); margin-bottom: 2px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.notif-msg   { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.notif-date  { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ── TOOLBOX ─────────────────────────────────────────────── */
.tool-icon { font-size: 28px; margin-bottom: 8px; }
.produto-tag { font-size: 9px; font-weight: 700; color: var(--brand-light); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── FILTERS ─────────────────────────────────────────────── */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }

/* ── MOBILE ──────────────────────────────────────────────── */
.hamburger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); padding: 4px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.mobile-topbar { display: none; position: fixed; top: 0; left: 0; right: 0; height: 54px; background: var(--sidebar); align-items: center; padding: 0 16px; gap: 12px; z-index: 200; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.mobile-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: #fff; }
.mobile-topbar .hamburger { color: #fff; font-size: 20px; }
.mobile-topbar .bell-btn { color: rgba(255,255,255,0.8); }

@media (max-width: 768px) {
  .mobile-topbar { display: flex; }
  .topbar { display: none; }
  .main-area { margin-top: 54px; }
  .topbar { display: none; }
  .sidebar { position: fixed; top: 54px; height: calc(100vh - 54px); transform: translateX(-100%); z-index: 150; transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; top: 54px; }
  .hamburger { display: block; }
  .page-content { padding: 70px 12px 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .notif-panel { width: 300px; right: -60px; }
}

/* MODALS */
.modal-overlay { position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:1000;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(2px); }
.modal { background:var(--surface);border-radius:var(--radius-lg);padding:24px;width:100%;max-width:480px;max-height:90vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,0.3); }
.modal-header { display:flex;justify-content:space-between;align-items:center;margin-bottom:16px; }
.modal-header h3 { font-family:var(--font-head);font-size:17px;font-weight:700; }
.modal-body { margin-bottom:0; }
.modal-footer { display:flex;gap:8px;justify-content:flex-end;margin-top:16px;padding-top:16px;border-top:1px solid var(--border); }
.close-btn { background:none;border:none;font-size:20px;cursor:pointer;color:var(--text-muted); }
.close-btn:hover { color:var(--text); }
.alert-warning { background:#fef3c7;color:#b45309;border:1px solid #fcd34d;padding:12px 16px;border-radius:8px;font-size:14px;font-weight:500;margin-bottom:16px; }
