/* ============================================================================
   FARMNEXUS OS — Design System CSS
   "Da semente ao lucro. Do solo à nuvem."
   Paleta: Obsidian Dark + Esmeralda + Dourado | Fontes: Outfit + Inter
   ============================================================================ */

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

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Backgrounds */
  --bg-obsidian:         #121212;
  --bg-obsidian-surface: #1E1E1E;
  --bg-obsidian-card:    rgba(30, 30, 30, 0.78);
  --bg-obsidian-input:   rgba(0, 0, 0, 0.4);

  /* Borders */
  --border-glass:        rgba(255, 255, 255, 0.08);
  --border-glass-hover:  rgba(255, 255, 255, 0.15);
  --border-blue-glow: rgba(2, 132, 199, 0.35);
  --border-slate-glow:    rgba(100, 116, 139, 0.35);
  --border-red-glow:     rgba(239, 68, 68, 0.35);

  /* Blue Palette */
  --color-blue:       #0284c7;
  --color-blue-dark:  #0369a1;
  --color-blue-light: #38bdf8;
  --color-blue-bg:    rgba(2, 132, 199, 0.14);

  /* Slate Palette */
  --color-slate:          #64748b;
  --color-slate-dark:     #475569;
  --color-slate-light:    #94a3b8;
  --color-slate-bg:       rgba(100, 116, 139, 0.14);

  /* Blue Palette */
  --color-blue:          #3B82F6;
  --color-blue-light:    #60A5FA;

  /* Red Palette (Errors) */
  --color-red:           #EF4444;
  --color-red-light:     #FCA5A5;
  --color-red-bg:        rgba(239, 68, 68, 0.14);

  /* Text */
  --text-primary:        #F9FAFB;
  --text-secondary:      #9CA3AF;
  --text-muted:          #6B7280;
  --text-dark:           #121212;

  /* Typography */
  --font-heading:        'Outfit', sans-serif;
  --font-body:           'Inter', sans-serif;

  /* Transitions */
  --transition-smooth:   all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast:     all 0.15s ease;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  36px;
  --space-2xl: 48px;
  --space-3xl: 64px;

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

  /* Shadows */
  --shadow-card:    0 12px 30px rgba(0, 0, 0, 0.45);
  --shadow-blue: 0 4px 15px rgba(2, 132, 199, 0.35);
  --shadow-slate:    0 4px 15px rgba(100, 116, 139, 0.35);
  --shadow-glow:    0 0 40px rgba(2, 132, 199, 0.15);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.has-bg {
  background-image:
    radial-gradient(circle at 15% 10%, rgba(2, 132, 199, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(100, 116, 139, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(18, 18, 18, 0.95) 0%, var(--bg-obsidian) 100%);
  background-attachment: fixed;
}

a { color: var(--color-blue-light); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--color-blue); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-obsidian); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ============================================================================
   NAVIGATION
   ============================================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(18, 18, 18, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 var(--space-xl);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

/* ============================================================================
   ERP LAYOUT (AEGRO-STYLE HORIZONTAL)
   ============================================================================ */
.erp-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: #f1f5f9;
}

/* --- Header Global --- */
.erp-header-global {
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

/* 1. Top Context Bar (Blue) */
.topbar-context {
  background: linear-gradient(90deg, var(--color-blue-dark), var(--color-blue));
  color: white;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}
.context-left, .context-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.context-selectors {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0,0,0,0.15);
  padding: 4px 16px;
  border-radius: 20px;
}
.context-select {
  background: transparent;
  border: none;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
}
.context-select option {
  color: #333;
}
.context-arrow {
  color: rgba(255,255,255,0.6);
  font-weight: bold;
}
.icon-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s;
}
.icon-btn:hover {
  transform: scale(1.1);
}

/* 2. Topbar Menu (White) */
.topbar-menu {
  background: #ffffff;
  height: 64px;
  display: flex;
  justify-content: center; /* Center the menu items */
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}
.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #475569;
  min-width: 80px;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}
.menu-item:hover, .menu-item.active {
  background: #f1f5f9;
  color: var(--color-blue);
}
.menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8; /* Azul meio marca d'água */
  margin-bottom: 4px;
  transition: all 0.2s;
}
.menu-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}
.menu-item:hover .menu-icon, .menu-item.active .menu-icon {
  color: var(--color-blue-dark); /* Fica mais escuro no hover/active */
}
.menu-text {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

/* --- Main Content --- */
.erp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden; /* To allow map or scrollable lists to fill height */
}

.nav.scrolled {
  background: rgba(18, 18, 18, 0.96);
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-brand-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-blue), var(--color-slate));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.4);
  transition: var(--transition-smooth);
}

.nav-brand:hover .nav-brand-icon {
  transform: rotate(10deg) scale(1.05);
  box-shadow: 0 0 30px rgba(2, 132, 199, 0.6);
}

.nav-brand-text h1 {
  font-size: 1.25rem;
  font-weight: 900;
  background: linear-gradient(90deg, #FFFFFF, var(--color-blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-brand-text p {
  font-size: 0.72rem;
  color: var(--color-slate-light);
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: var(--transition-fast);
}

.btn:hover::after { opacity: 1; }

.btn:active { transform: scale(0.97); }

.btn-blue {
  background: linear-gradient(135deg, var(--color-blue), var(--color-blue-dark));
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-blue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(2, 132, 199, 0.5);
  color: #fff;
}

.btn-slate {
  background: linear-gradient(135deg, var(--color-slate), var(--color-slate-dark));
  color: var(--text-dark);
  font-weight: 700;
  box-shadow: var(--shadow-slate);
}
.btn-slate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(100, 116, 139, 0.5);
  color: var(--text-dark);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-glass-hover);
  color: var(--text-primary);
}

.btn-outline-blue {
  background: transparent;
  color: var(--color-blue-light);
  border: 1px solid var(--border-blue-glow);
}
.btn-outline-blue:hover {
  background: var(--color-blue-bg);
  color: var(--color-blue-light);
}

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-full { width: 100%; }

.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}
.btn-loading .btn-text { visibility: hidden; }
.btn-loading::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ============================================================================
   CARDS (Glassmorphism)
   ============================================================================ */
.glass-card {
  background: var(--bg-obsidian-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: var(--border-glass-hover);
}

.glass-card-blue { border-left: 4px solid var(--color-blue); }
.glass-card-slate    { border-left: 4px solid var(--color-slate); }
.glass-card-blue    { border-left: 4px solid var(--color-blue); }

/* ============================================================================
   BADGES
   ============================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-blue {
  background: var(--color-blue-bg);
  color: var(--color-blue-light);
  border: 1px solid var(--border-blue-glow);
}

.badge-slate {
  background: var(--color-slate-bg);
  color: var(--color-slate-light);
  border: 1px solid var(--border-slate-glow);
}

.badge-red {
  background: var(--color-red-bg);
  color: var(--color-red-light);
  border: 1px solid var(--border-red-glow);
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-label .required {
  color: var(--color-red);
  font-weight: 700;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-obsidian-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition-fast);
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-input.error {
  border-color: var(--color-red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-input.success {
  border-color: var(--color-blue);
}

.form-error-message {
  font-size: 0.78rem;
  color: var(--color-red-light);
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-select {
  background: #1F2937;
  cursor: pointer;
}

/* Password Strength Meter */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.password-strength-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.1);
  transition: var(--transition-fast);
}

.password-strength-bar.active.weak   { background: var(--color-red); }
.password-strength-bar.active.medium { background: var(--color-slate); }
.password-strength-bar.active.strong { background: var(--color-blue); }

.password-strength-text {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 2px;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition-fast);
}
.password-toggle:hover { color: var(--text-primary); }

/* ============================================================================
   ALERT BOXES
   ============================================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: var(--space-md);
  animation: fadeSlideIn 0.3s ease-out;
}

.alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

.alert-error {
  background: var(--color-red-bg);
  border: 1px solid var(--border-red-glow);
  color: var(--color-red-light);
}

.alert-success {
  background: var(--color-blue-bg);
  border: 1px solid var(--border-blue-glow);
  color: var(--color-blue-light);
}

.alert-warning {
  background: var(--color-slate-bg);
  border: 1px solid var(--border-slate-glow);
  color: var(--color-slate-light);
}

/* ============================================================================
   LAYOUT UTILITIES
   ============================================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-header h2 {
  font-size: 2.2rem;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--text-primary), var(--color-blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-lg); }

.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.text-center { text-align: center; }
.text-blue { color: var(--color-blue-light); }
.text-slate { color: var(--color-slate-light); }
.text-muted { color: var(--text-secondary); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-10px); }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fade-in     { animation: fadeSlideIn 0.5s ease-out both; }
.animate-fade-in-d1  { animation: fadeSlideIn 0.5s ease-out 0.1s both; }
.animate-fade-in-d2  { animation: fadeSlideIn 0.5s ease-out 0.2s both; }
.animate-fade-in-d3  { animation: fadeSlideIn 0.5s ease-out 0.3s both; }
.animate-fade-in-d4  { animation: fadeSlideIn 0.5s ease-out 0.4s both; }
.animate-fade-in-d5  { animation: fadeSlideIn 0.5s ease-out 0.5s both; }
.animate-float       { animation: float 3s ease-in-out infinite; }

/* Intersection Observer reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================================
   AUTH PAGES (Login / Cadastro)
   ============================================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(2, 132, 199, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(100, 116, 139, 0.08) 0%, transparent 50%);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(30, 30, 30, 0.85);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(2, 132, 199, 0.06);
  animation: fadeSlideIn 0.5s ease-out;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-header .nav-brand-icon {
  margin: 0 auto var(--space-md);
  width: 56px; height: 56px;
  font-size: 1.6rem;
}

.auth-header h2 {
  font-size: 1.6rem;
  margin-bottom: var(--space-xs);
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-glass);
}

/* Input with icon */
.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.input-wrapper .form-input {
  padding-left: 42px;
}

/* ============================================================================
   HERO SECTION (Landing)
   ============================================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 68px; /* nav height */
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.12), transparent 60%);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(100, 116, 139, 0.08), transparent 60%);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite reverse;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero-content h1 {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
}

.hero-content h1 .gradient-text {
  background: linear-gradient(135deg, var(--color-blue-light), var(--color-slate-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 560px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-glass);
}

.hero-stat-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-blue-light);
}

.hero-stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================================
   FEATURES GRID
   ============================================================================ */
.feature-card {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-obsidian-card);
  border: 1px solid var(--border-glass);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-blue), var(--color-slate));
  opacity: 0;
  transition: var(--transition-smooth);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-blue-glow);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: var(--space-md);
}

.feature-icon-blue { background: var(--color-blue-bg); }
.feature-icon-slate    { background: var(--color-slate-bg); }

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================================
   KPI / COUNTER SECTION
   ============================================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.kpi-item {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-obsidian-card);
  border: 1px solid var(--border-glass);
  transition: var(--transition-smooth);
}

.kpi-item:hover {
  border-color: var(--border-blue-glow);
  transform: translateY(-3px);
}

.kpi-number {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--color-blue-light), var(--color-slate));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.kpi-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  font-weight: 500;
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.footer {
  background: rgba(18, 18, 18, 0.95);
  border-top: 1px solid var(--border-glass);
  padding: var(--space-2xl) 0 var(--space-lg);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: var(--space-sm);
  max-width: 300px;
}

.footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-glass);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .hero-content h1 { font-size: 2.8rem; }
}

/* Mobile */
@media (max-width: 768px) {
  .nav { padding: 0 var(--space-md); height: 60px; }

  .nav-links { display: none; }

  .nav-toggle { display: block; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(20px);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-glass);
    animation: fadeSlideIn 0.3s ease-out;
  }

  .hero { padding-top: 60px; }
  .hero-content h1 { font-size: 2.2rem; }
  .hero-stats { flex-direction: column; gap: var(--space-md); }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .section-header h2 { font-size: 1.7rem; }

  .auth-card { padding: var(--space-lg); }

  .footer-content { flex-direction: column; }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero-content h1 { font-size: 1.8rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .kpi-number { font-size: 2rem; }
}

/* ============================================================================
   ERP SHELL (LAYOUT & MODULES)
   ============================================================================ */

/* (Old ERP layout removed to prevent conflict with Aegro horizontal layout at line 147) */

/* --- Content Container --- */
.erp-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  color: #1f2937; /* Dark text for light background */
}

/* --- Filters & Cards --- */
.erp-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: var(--space-md);
  border: 1px solid #e5e7eb;
}
.erp-card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  font-size: 1.1rem;
  color: #111827;
}
.erp-card-body { padding: var(--space-lg); }

/* --- Table Tabs --- */
.erp-tabs {
  display: flex;
  background-color: var(--color-blue);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
}
.erp-tab {
  padding: 12px 24px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}
.erp-tab:hover { color: #fff; background-color: rgba(255,255,255,0.1); }
.erp-tab.active {
  background-color: #ffffff;
  color: var(--color-blue);
}

/* --- Data Table --- */
.erp-table-wrapper {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow-x: auto;
}
.erp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}
.erp-table th {
  background-color: #f9fafb;
  padding: 12px 16px;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}
.erp-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}
.erp-table tbody tr:hover { background-color: #f3f4f6; }
.erp-table tbody tr:nth-child(even) { background-color: #fafafa; }

/* Status Dots */
.status-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.green { background-color: #10B981; }
.status-dot.red { background-color: #EF4444; }
.status-dot.gold { background-color: #F59E0B; }

/* Table Actions */
.table-actions { display: flex; gap: 8px; }

/* --- Floating Action Button (FAB) --- */
.fab-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-blue);
  color: white;
  border: none;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 15px rgba(2, 132, 199, 0.4);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 900;
}
.fab-btn:hover {
  transform: scale(1.1);
  background: var(--color-blue-dark);
}
.btn-action {
  background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 4px;
  padding: 4px 8px; cursor: pointer; color: #6b7280; transition: all 0.2s;
}
.btn-action:hover { background: var(--color-blue); color: #fff; border-color: var(--color-blue); }

/* Invert input text colors for light areas */
.erp-card .form-input, .erp-card .form-select {
  background-color: #fff;
  border-color: #d1d5db;
  color: #111827;
}
.erp-card .form-label { color: #374151; }

/* ============================================================================
   AEGRO STYLE: FULLSCREEN MODAL & LAYOUT
   ============================================================================ */
.fullscreen-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(241, 245, 249, 0.98);
  z-index: 2000; display: none; opacity: 0; transition: opacity 0.3s;
  overflow-y: auto; padding: 0;
}
.fullscreen-overlay.open { display: block; opacity: 1; }

.fullscreen-modal {
  max-width: 1200px; width: 95%; margin: 40px auto;
  background: #ffffff; border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  display: flex; flex-direction: column; overflow: hidden;
  min-height: calc(100vh - 80px);
}

.fullscreen-header {
  padding: 24px 32px; border-bottom: 1px solid #e2e8f0;
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; position: sticky; top: 0; z-index: 10;
}
.fullscreen-header h2 { margin: 0; font-size: 1.5rem; color: #1e293b; font-weight: 600; }

.fullscreen-body {
  padding: 32px; flex: 1; background: #f8fafc;
}

.fullscreen-footer {
  padding: 16px 32px; border-top: 1px solid #e2e8f0;
  display: flex; justify-content: flex-end; gap: 16px;
  background: #fff; position: sticky; bottom: 0; z-index: 10;
}

.form-section {
  background: #ffffff; border-radius: 8px; border: 1px solid #e2e8f0;
  padding: 24px; margin-bottom: 24px;
}
.form-section-title {
  font-size: 1.1rem; font-weight: 700; color: #334155; margin: 0 0 16px 0;
}

/* --- ERP TABS --- */
.erp-tabs {
  display: flex; border-bottom: 1px solid #e2e8f0; margin-bottom: 24px; gap: 24px;
}
.erp-tab-item {
  padding: 12px 0; color: rgba(255,255,255,0.7); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; border-bottom: 3px solid transparent; text-transform: uppercase; letter-spacing: 0.5px;
}
.erp-tab-item:hover { color: #ffffff; }
.erp-tab-item.active {
  color: #ffffff; border-bottom-color: #ffffff;
}

/* --- SUMMARY CARDS --- */
.erp-card-row {
  display: flex; gap: 16px; margin-bottom: 24px;
}
.erp-card-summary {
  flex: 1; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.erp-card-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; font-weight: 600; color: #475569;
}
.erp-card-value {
  font-size: 1.5rem; font-weight: 700; color: #1e293b;
}
.badge-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; font-size: 0.75rem; font-weight: 700; color: #fff;
}
.bg-blue { background: #3b82f6; }
.bg-red { background: #ef4444; }
.bg-green { background: #10b981; }
.bg-gray { background: #94a3b8; }

/* --- EMPTY STATE --- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
}
.empty-state-icon {
  color: #cbd5e1; margin-bottom: 16px;
}
.empty-state-icon svg { width: 80px; height: 80px; stroke-width: 1.5; }
.empty-state-title {
  font-size: 1.15rem; font-weight: 600; color: #334155; margin-bottom: 8px;
}
.empty-state-desc {
  font-size: 0.9rem; color: #64748b; margin-bottom: 24px; max-width: 400px;
}
.btn-green {
  background: #10b981; color: white; border: none; padding: 10px 20px;
  font-weight: 600; border-radius: 4px; box-shadow: 0 4px 6px rgba(16,185,129,0.2); cursor: pointer;
}
.btn-green:hover { background: #059669; transform: translateY(-1px); }

/* Modals in light theme using fullscreen-overlay */
.fullscreen-overlay .form-input, 
.fullscreen-overlay .form-select, 
.fullscreen-overlay .form-textarea { 
  color: #111827; 
  background-color: #fff; 
  border-color: #d1d5db; 
}
