/* ===== LUMIAI DESIGN SYSTEM ===== */
/* Inspired by Revora reference — light, premium, editorial */

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

:root {
  /* Backgrounds — off-white system like Revora */
  --bg-base:       #ebebea;
  --bg-surface:    #f2f2f0;
  --bg-card:       #ffffff;
  --bg-dark:       #1a3320;
  --bg-dark-2:     #142a1a;
  --bg-input:      #f7f7f6;

  /* Text */
  --text-primary:  #111310;
  --text-secondary:#4a4f47;
  --text-muted:    #8a8f87;
  --text-inverse:  #ffffff;
  --text-inverse-2:#c8d4c0;

  /* Accent — green-moss, deep and premium */
  --accent:        #2d5a2d;
  --accent-mid:    #3d7a3d;
  --accent-light:  #e8f0e8;
  --accent-glow:   rgba(45,90,45,0.12);

  /* Negative / warning */
  --neg:           #c0392b;
  --neg-light:     #fdf0ef;
  --warn:          #e67e22;
  --warn-light:    #fef5ec;

  /* Positive */
  --pos:           #27ae60;
  --pos-light:     #eafaf1;

  /* Borders */
  --border:        rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.14);
  --border-card:   rgba(0,0,0,0.06);

  /* Shadows */
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg:     0 12px 40px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-card:   0 1px 3px rgba(0,0,0,0.05), 0 0 0 1px rgba(0,0,0,0.06);

  /* Radius */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-full:9999px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10:40px;
  --space-12:48px;
  --space-16:64px;

  /* Transitions */
  --t-fast:  150ms cubic-bezier(0.4,0,0.2,1);
  --t-base:  250ms cubic-bezier(0.4,0,0.2,1);
  --t-slow:  400ms cubic-bezier(0.4,0,0.2,1);

  /* Sidebar */
  --sidebar-w: 240px;
  --topbar-h:  60px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

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

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

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-body {
  padding: var(--space-8) var(--space-10);
  flex: 1;
  max-width: 1440px;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: 0;
}

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

.sidebar-logo-mark {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-mark svg { width: 16px; height: 16px; }

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.sidebar-logo-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 6px;
  border-radius: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 10px 6px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--t-fast);
  cursor: pointer;
  position: relative;
}

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

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

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.nav-badge.new {
  background: var(--pos);
}

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

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast);
}

.sidebar-user:hover { background: var(--bg-base); }

.user-avatar {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-plan { font-size: 11px; color: var(--text-muted); }

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-8);
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  flex: 1;
}

.topbar-title h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.topbar-title p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45,90,45,0.25);
}

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

.btn-secondary:hover {
  background: var(--border);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-base);
  color: var(--text-primary);
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
}

.card-sm { border-radius: var(--r-md); }

/* ===== METRIC CARDS ===== */
.metric-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow var(--t-fast);
}

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

.metric-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.metric-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1px;
}

.metric-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon.green  { background: var(--accent-light); color: var(--accent); }
.metric-icon.blue   { background: #e8f0fe; color: #1a73e8; }
.metric-icon.orange { background: var(--warn-light); color: var(--warn); }
.metric-icon.red    { background: var(--neg-light); color: var(--neg); }

.metric-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1;
}

.metric-footer {
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.metric-delta.up   { color: var(--pos); background: var(--pos-light); }
.metric-delta.down { color: var(--neg); background: var(--neg-light); }

.metric-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ===== SPARKLINE ===== */
.sparkline {
  height: 36px;
  width: 100%;
}

/* ===== GRID ===== */
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-5); }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--space-5); }

/* ===== SECTION ===== */
.section { margin-bottom: var(--space-8); }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.section-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
}

.badge-green  { background: var(--pos-light);   color: var(--pos); }
.badge-red    { background: var(--neg-light);   color: var(--neg); }
.badge-orange { background: var(--warn-light);  color: var(--warn); }
.badge-gray   { background: var(--bg-base);     color: var(--text-secondary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }

/* ===== DARK SECTION ===== */
.dark-section {
  background: var(--bg-dark);
  border-radius: var(--r-xl);
  padding: var(--space-8);
  color: var(--text-inverse);
}

/* ===== TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

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

.data-table tr:hover td {
  background: var(--bg-base);
}

/* ===== PROGRESS ===== */
.progress-bar {
  height: 5px;
  background: var(--bg-base);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width var(--t-slow);
}

/* ===== INPUT ===== */
.input-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-field {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color var(--t-fast);
  outline: none;
  width: 100%;
}

.input-field:focus {
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-field::placeholder { color: var(--text-muted); }

/* ===== STEP INDICATOR ===== */
.step-pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-card);
}

.step-item {
  display: flex;
  align-items: center;
  flex: 1;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--border);
  background: white;
  color: var(--text-muted);
  transition: all var(--t-base);
}

.step-dot.done   { background: var(--accent);    border-color: var(--accent);   color: white; }
.step-dot.active { background: white;             border-color: var(--accent);   color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }

.step-label { font-size: 11.5px; font-weight: 500; color: var(--text-muted); margin-left: 8px; }
.step-label.done   { color: var(--text-primary); }
.step-label.active { color: var(--accent); font-weight: 600; }

.step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 8px;
}

.step-line.done { background: var(--accent); }

/* ===== UTILITY ===== */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2       { gap: var(--space-2); }
.gap-3       { gap: var(--space-3); }
.gap-4       { gap: var(--space-4); }
.gap-6       { gap: var(--space-6); }
.gap-8       { gap: var(--space-8); }
.w-full      { width: 100%; }
.mt-2        { margin-top: var(--space-2); }
.mt-4        { margin-top: var(--space-4); }
.mt-6        { margin-top: var(--space-6); }
.text-sm     { font-size: 12px; }
.text-muted  { color: var(--text-muted); }
.font-bold   { font-weight: 700; }
.truncate    { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== PAGE-CONTENT COMPAT (páginas antigas) ===== */
.page-wrapper {
  display: flex;
  min-height: 100vh;
}
.page-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: var(--space-8) var(--space-10);
  background: var(--bg-base);
}

/* ===== MAIN-WRAP COMPAT ===== */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== TOPBAR COMPAT (páginas antigas) ===== */
.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
}
.topbar-menu {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  transition: background var(--t-fast);
}
.topbar-menu:hover { background: var(--bg-base); }
.topbar-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
}
.topbar-breadcrumb .active {
  color: var(--text-primary); font-weight: 600;
}
.topbar-right {
  display: flex; align-items: center; gap: var(--space-3);
}
.topbar-avatar {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
  cursor: pointer;
}
