/* ===================================================
   FAROL CARREIRAS - Design System v2
   Estetica: SaaS Premium - Analytics - Light-first
   Fontes: Plus Jakarta Sans (display) + Inter (corpo)
   =================================================== */

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

/* --- TOKENS ---------------------------------------- */
:root {
  --blue:        #2563EB;
  --blue-light:  #3B82F6;
  --blue-dim:    #EFF6FF;
  --blue-mid:    #DBEAFE;
  --cyan:        #06B6D4;
  --cyan-dim:    #ECFEFF;
  --sky:         #38BDF8;
  --sky-dim:     #F0F9FF;
  --green:       #10B981;
  --green-dim:   #ECFDF5;
  --amber:       #F59E0B;
  --amber-dim:   #FFFBEB;
  --red:         #EF4444;
  --red-dim:     #FEF2F2;
  --purple:      #8B5CF6;
  --purple-dim:  #F5F3FF;

  --bg:          #F8FAFC;
  --bg-2:        #FFFFFF;
  --bg-3:        #F1F5F9;
  --bg-4:        #E2E8F0;
  --border:      #E2E8F0;
  --border-2:    #CBD5E1;
  --text:        #0F172A;
  --text-2:      #334155;
  --text-3:      #64748B;
  --text-4:      #94A3B8;

  --shadow-sm:   0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md:   0 4px 12px rgba(15,23,42,0.08), 0 2px 4px rgba(15,23,42,0.04);
  --shadow-lg:   0 10px 30px rgba(15,23,42,0.1), 0 4px 8px rgba(15,23,42,0.05);
  --shadow-blue: 0 4px 14px rgba(37,99,235,0.2);

  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --gap:       20px;

  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;
}

/* --- DARK MODE -------------------------------------- */
[data-theme="dark"] {
  --bg:          #0F172A;
  --bg-2:        #1E293B;
  --bg-3:        #0F172A;
  --bg-4:        #1E293B;
  --border:      #1E293B;
  --border-2:    #334155;
  --text:        #F1F5F9;
  --text-2:      #CBD5E1;
  --text-3:      #94A3B8;
  --text-4:      #475569;
  --blue-dim:    rgba(37,99,235,0.15);
  --blue-mid:    rgba(37,99,235,0.1);
  --cyan-dim:    rgba(6,182,212,0.1);
  --sky-dim:     rgba(56,189,248,0.1);
  --green-dim:   rgba(16,185,129,0.1);
  --amber-dim:   rgba(245,158,11,0.1);
  --red-dim:     rgba(239,68,68,0.1);
  --purple-dim:  rgba(139,92,246,0.1);
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg:   0 10px 30px rgba(0,0,0,0.4);
}

/* --- RESET ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

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

/* --- SIDEBAR ---------------------------------------- */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .mark {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-blue);
}

.sidebar-logo .logo-text .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  line-height: 1.2;
}

.sidebar-logo .logo-text .tagline {
  font-size: 10px;
  color: var(--text-4);
  letter-spacing: 0.3px;
  margin-top: 1px;
}

.nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-section {
  padding: 10px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-4);
  font-family: var(--font-display);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  color: var(--text-3);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  transition: all 0.12s;
  border-radius: 0;
  margin: 1px 8px;
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-item:hover {
  color: var(--text);
  background: var(--bg-3);
}

.nav-item.active {
  color: var(--blue);
  background: var(--blue-dim);
  font-weight: 600;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  opacity: 0.7;
}
.nav-item.active .icon { opacity: 1; }

.sidebar-bottom {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-3);
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: var(--text-4); }

.btn-signout {
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 7px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.12s;
}
.btn-signout:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

/* --- MAIN ------------------------------------------- */
.main { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 58px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--bg-2);
  flex-shrink: 0;
  gap: 12px;
}

.topbar-left { min-width: 0; }
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text); }
.topbar-sub   { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* Dark mode toggle */
.theme-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.12s;
}
.theme-toggle:hover { border-color: var(--border-2); background: var(--bg-4); }

.page { flex: 1; padding: 24px 28px; overflow-y: auto; }

/* --- CARDS ------------------------------------------ */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- KPI CARDS -------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: var(--gap);
}

.kpi-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}

.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  font-family: var(--font-display);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.kpi-unit {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 500;
  margin-left: 2px;
}

.kpi-meta {
  font-size: 11px;
  color: var(--text-4);
  margin-top: 5px;
}

.kpi-progress {
  margin-top: 10px;
  height: 4px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
}

.kpi-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1s ease;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-top: 6px;
}

/* --- BADGES ----------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  white-space: nowrap;
  letter-spacing: 0.1px;
}

.badge-blue   { background: var(--blue-dim);   color: var(--blue);   }
.badge-cyan   { background: var(--cyan-dim);   color: var(--cyan);   }
.badge-green  { background: var(--green-dim);  color: var(--green);  }
.badge-amber  { background: var(--amber-dim);  color: var(--amber);  }
.badge-red    { background: var(--red-dim);    color: var(--red);    }
.badge-purple { background: var(--purple-dim); color: var(--purple); }
.badge-gray   { background: var(--bg-3);       color: var(--text-3); border: 1px solid var(--border); }

/* --- BOTOES ----------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover { background: #1D4ED8; box-shadow: 0 4px 18px rgba(37,99,235,0.3); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-2); background: var(--bg-3); color: var(--text); }

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

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid transparent;
}
.btn-danger:hover { background: #FEE2E2; }

.btn-cyan {
  background: var(--cyan);
  color: #fff;
}
.btn-cyan:hover { background: #0891B2; }

/* --- INPUTS ----------------------------------------- */
input, select, textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

input::placeholder { color: var(--text-4); }
select { cursor: pointer; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
  font-family: var(--font-display);
}

.field { display: flex; flex-direction: column; gap: 4px; }
.field-hint { font-size: 11px; color: var(--text-4); margin-top: 4px; }

.form-grid   { display: grid; grid-template-columns: 1fr 1fr;     gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* --- PROGRESS --------------------------------------- */
.progress-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s ease;
}

/* --- IEP BARS --------------------------------------- */
.iep-item {
  margin-bottom: 14px;
}
.iep-item:last-child { margin-bottom: 0; }
.iep-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.iep-label  { font-size: 13px; font-weight: 500; color: var(--text-2); font-family: var(--font-display); }
.iep-value  { font-family: var(--font-display); font-size: 14px; font-weight: 700; }

/* --- SKILL GAP CARDS -------------------------------- */
.skill-gap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: var(--gap);
}

.skill-gap-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}

.skill-gap-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.skill-gap-card .sgc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.skill-gap-card .sgc-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.skill-gap-card .sgc-category {
  font-size: 10px;
  color: var(--text-4);
  margin-top: 1px;
}

.skill-gap-card .sgc-demand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 8px;
}

.skill-gap-card .sgc-bar { margin-bottom: 10px; }

.skill-gap-card .sgc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- FUNIL ------------------------------------------ */
.funil-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.funil-item {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  transition: all 0.12s;
}

.funil-item:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }

.funil-n {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.funil-label {
  font-size: 9px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-4);
  margin-top: 4px;
  font-family: var(--font-display);
  font-weight: 600;
}

/* --- LIST ITEMS ------------------------------------- */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.list-item:last-child { border-bottom: none; }

/* --- MODAL ------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: var(--radius);
  transition: all 0.12s;
}
.modal-close:hover { background: var(--red-dim); border-color: var(--red); color: var(--red); }

/* --- SCORE DISPLAY ---------------------------------- */
.score-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
}

.score-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
}

.score-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.score-circle .sc-val {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.score-circle .sc-lbl {
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-family: var(--font-display);
}

/* --- EMPTY STATE ------------------------------------ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 14px;
}

.empty-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.empty-sub   { font-size: 13px; color: var(--text-4); }

/* --- LOADING ---------------------------------------- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px;
  color: var(--text-4);
  font-size: 13px;
  font-family: var(--font-display);
  font-weight: 500;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- SECTION HEADER --------------------------------- */
.section-header {
  margin-bottom: 20px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
}
.section-sub { font-size: 13px; color: var(--text-3); }

/* --- TIMELINE --------------------------------------- */
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.timeline-content { flex: 1; }
.timeline-desc { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.timeline-date { font-size: 11px; color: var(--text-4); margin-top: 3px; display: flex; align-items: center; gap: 6px; }

/* --- TABS ------------------------------------------- */
.tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 9px 16px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.12s;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.tab-btn:hover:not(.active) { color: var(--text-2); background: var(--bg-3); border-radius: var(--radius) var(--radius) 0 0; }

/* --- GRID HELPERS ----------------------------------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--gap); }
.gap    { margin-bottom: var(--gap); }
.gap-sm { margin-bottom: 12px; }

/* --- SKILL TAGS ------------------------------------- */
.skills-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.skill-tag {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  font-family: var(--font-display);
}
.skill-tag.tenho { border-color: #A7F3D0; color: var(--green); background: var(--green-dim); }

/* --- STATUS CORES ----------------------------------- */
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- ANIMACOES -------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up   { animation: fadeUp 0.3s ease both; }
.fade-up-2 { animation: fadeUp 0.3s ease 0.06s both; }
.fade-up-3 { animation: fadeUp 0.3s ease 0.12s both; }
.fade-up-4 { animation: fadeUp 0.3s ease 0.18s both; }
.fade-up-5 { animation: fadeUp 0.3s ease 0.24s both; }

/* --- SCROLLBAR -------------------------------------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* --- DIVIDER ---------------------------------------- */
.divider { height: 1px; background: var(--border); margin: 4px 0; }

/* --- ALERT BOX -------------------------------------- */
.alert {
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.alert-blue   { background: var(--blue-dim);   border: 1px solid #BFDBFE; }
.alert-amber  { background: var(--amber-dim);  border: 1px solid #FDE68A; }
.alert-green  { background: var(--green-dim);  border: 1px solid #A7F3D0; }
.alert-red    { background: var(--red-dim);    border: 1px solid #FECACA; }

.alert-icon  { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-title { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.alert-body  { font-size: 12px; color: var(--text-2); line-height: 1.5; }

/* --- RESPONSIVO ------------------------------------- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .sidebar { width: 200px; }
}

/* ============ MOBILE (abaixo de 768px) ============ */
@media (max-width: 768px) {
  /* Sidebar vira off-canvas (gaveta) */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 270px;
    max-width: 85vw;
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: 4px 0 24px rgba(15,23,42,0.18);
  }
  .sidebar.open { transform: translateX(0); }

  /* Overlay escuro quando a gaveta abre */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.45);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s;
  }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }

  /* Conteudo ocupa 100% */
  .main { width: 100%; }
  .page { padding: 14px 14px 90px; }   /* espaco p/ menu inferior */

  /* Topbar mobile com botao hamburguer */
  .topbar {
    padding: 0 14px;
    height: 54px;
    position: sticky;
    top: 0;
    z-index: 900;
  }
  .topbar-title { font-size: 15px; }
  .topbar-sub { font-size: 11px; }
  .topbar-actions .btn { padding: 7px 12px; font-size: 12px; }
  /* Esconde botoes de acao textuais no topo (vao pro FAB) */
  .topbar-actions .btn-hide-mobile { display: none; }

  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border: 1px solid var(--border);
    background: var(--bg-2);
    border-radius: var(--radius);
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    color: var(--text);
  }

  /* Grids empilham */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .funil-grid { grid-template-columns: repeat(5,1fr); gap: 4px; }
  .skill-gap-grid { grid-template-columns: 1fr; }

  /* Cards e textos */
  .card { padding: 16px; border-radius: 14px; }
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 26px; }
  .section-title { font-size: 18px; }

  /* Botoes maiores p/ toque */
  .btn { padding: 11px 16px; font-size: 14px; min-height: 44px; }
  .btn-primary, .btn-secondary, .btn-cyan, .btn-ghost, .btn-danger { min-height: 44px; }
  input, select, textarea { font-size: 16px; padding: 12px; min-height: 46px; } /* 16px evita zoom no iOS */
  label { font-size: 13px; }

  /* Modais full-screen no mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    padding: 20px 16px;
    animation: slideUp 0.28s ease;
  }
  @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

  /* Botoes do modal fixos no fundo */
  .modal > div:last-child {
    position: sticky;
    bottom: -20px;
    background: var(--bg-2);
    padding: 14px 0 4px;
    margin: 0 -16px -20px;
    padding-left: 16px;
    padding-right: 16px;
    border-top: 1px solid var(--border);
    z-index: 5;
  }
  .modal .btn { flex: 1; justify-content: center; }

  /* Tab bar com scroll horizontal */
  .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { flex-shrink: 0; }

  /* Esconde a sidebar-bottom interna (user fica na gaveta) */
  .sidebar { display: flex; }
}

/* ============ MENU INFERIOR (mobile) ============ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  z-index: 1000;
  box-shadow: 0 -2px 12px rgba(15,23,42,0.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-inner { display: flex; height: 64px; }
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-4);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  transition: color 0.12s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bn-item.active { color: var(--blue); }
.bn-icon { font-size: 19px; line-height: 1; }

@media (max-width: 768px) {
  .bottom-nav { display: block; }
}

/* ============ BOT O FLUTUANTE (FAB) ============ */
.fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 80px;
  z-index: 950;
  width: auto;
  height: 52px;
  padding: 0 22px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
  border: none;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37,99,235,0.4);
  text-decoration: none;
}
.fab:active { transform: scale(0.96); }

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

/* Botao hamburguer escondido no desktop */
.mobile-menu-btn { display: none; }

/* ============ MOBILE PEQUENO (abaixo de 480px) ============ */
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .funil-grid { grid-template-columns: repeat(5,1fr); font-size: 9px; }
  .funil-n { font-size: 16px; }
  .funil-label { font-size: 7px; }
  .topbar-sub { display: none; }   /* economiza espaco vertical */
  .section-title { font-size: 17px; }
}
