/* ============================================================
   CACAROT ONLINE — Unified Design System v2.0
   Aesthetic: Precision Instrument — dark, calm, technical
   Fonts: Outfit (UI) + JetBrains Mono (data)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --bg-base:      #0d1117;
  --bg-surface:   #161b22;
  --bg-elevated:  #1c2230;
  --bg-overlay:   #21262d;
  --bg-hover:     #262c36;
  --bg-input:     #0d1117;
  --border:       #2a3141;
  --border-subtle:#1e2535;
  --border-focus: #4a8dd4;
  --accent:       #4a8dd4;
  --accent-hover: #5a9de4;
  --accent-dim:   rgba(74,141,212,0.12);
  --accent-glow:  rgba(74,141,212,0.25);
  --text-primary:   #dde3ee;
  --text-secondary: #8892a4;
  --text-muted:     #4a5568;
  --success:      #3ab87a;
  --success-dim:  rgba(58,184,122,0.12);
  --warning:      #c8963a;
  --warning-dim:  rgba(200,150,58,0.12);
  --danger:       #d95f5f;
  --danger-dim:   rgba(217,95,95,0.12);
  --info:         #4a8dd4;
  --space-1: 0.25rem;  --space-2: 0.5rem;  --space-3: 0.75rem;
  --space-4: 1rem;     --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem;     --space-10: 2.5rem; --space-12: 3rem;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px;
  --radius-xl: 16px; --radius-full: 9999px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 28px rgba(0,0,0,0.6);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.7);
  --font-ui:   'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
}

body.light-theme {
  --bg-base:      #f0f4f8;
  --bg-surface:   #ffffff;
  --bg-elevated:  #f8fafc;
  --bg-overlay:   #eef2f7;
  --bg-hover:     #e8edf5;
  --bg-input:     #ffffff;
  --border:       #d1d9e6;
  --border-subtle:#e4eaf4;
  --text-primary:   #1a2236;
  --text-secondary: #4a5568;
  --text-muted:     #9aa3b2;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.12);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.14);
}

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

html { font-size: 15px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(circle, rgba(74,141,212,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

body.light-theme::before {
  background-image: radial-gradient(circle, rgba(74,141,212,0.06) 1px, transparent 1px);
}

/* ── Typography ─────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-ui); font-weight: 600; line-height: 1.3; color: var(--text-primary); }
p { color: var(--text-secondary); }
a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); }
code, pre, .mono { font-family: var(--font-mono); font-size: 0.875em; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,17,23,0.90);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  height: 60px;
  display: flex; align-items: center;
  transition: background var(--transition-slow), border-color var(--transition-slow);
}
body.light-theme .navbar { background: rgba(255,255,255,0.94); border-bottom-color: var(--border); }

.nav-container {
  width: 100%; max-width: 1440px; margin: 0 auto;
  padding: 0 var(--space-8);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-6);
}

.logo-section { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }
.logo-section img { height: 36px; width: auto; opacity: 0.9; filter: drop-shadow(0 0 8px rgba(74,141,212,0.3)); }
.brand h1 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); margin: 0; }
.brand p  { font-size: 0.7rem; color: var(--text-muted); margin: 0; letter-spacing: 0.04em; text-transform: uppercase; }

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

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-ui); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast);
  white-space: nowrap; text-decoration: none; line-height: 1;
}
.btn-primary   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px var(--accent-glow); }
.btn-secondary { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-focus); }
.btn-danger    { background: var(--danger-dim); color: var(--danger); border-color: rgba(217,95,95,0.3); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost     { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-sm        { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.btn-lg        { padding: 0.7rem 1.6rem; font-size: 0.95rem; }
.btn-block     { width: 100%; justify-content: center; }

/* ── User Avatar ────────────────────────────────────────────── */
.user-avatar {
  width: 34px; height: 34px; border-radius: var(--radius-full);
  background: var(--accent-dim); border: 1.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 700; color: var(--accent);
  cursor: pointer; transition: all var(--transition-fast); flex-shrink: 0;
}
.user-avatar:hover { background: var(--accent); color: #fff; transform: scale(1.05); }

/* ── Layout ─────────────────────────────────────────────────── */
.main-container {
  max-width: 1440px; margin: 0 auto;
  padding: var(--space-8); position: relative; z-index: 1;
}

.dashboard-grid {
  display: grid; grid-template-columns: 272px 1fr;
  gap: var(--space-6); align-items: start;
}

/* ── Profile Card ───────────────────────────────────────────── */
.profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  position: sticky; top: 76px;
}

.profile-header {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-bottom: var(--space-5); margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}

.profile-avatar {
  width: 68px; height: 68px; border-radius: var(--radius-full);
  background: var(--accent-dim); border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; color: var(--accent);
  margin-bottom: var(--space-3);
  box-shadow: 0 0 0 4px rgba(74,141,212,0.08);
}

.profile-name  { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.profile-email { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); }
.profile-section { margin-bottom: var(--space-5); }
.profile-section-label {
  font-size: 0.68rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--space-3);
}

/* Subscription badge */
.subscription-badge {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
}
.sub-active   { border-color: rgba(58,184,122,0.3) !important; background: var(--success-dim) !important; }
.sub-expiring { border-color: rgba(200,150,58,0.3) !important; background: var(--warning-dim) !important; }
.sub-expired  { border-color: rgba(217,95,95,0.3)  !important; background: var(--danger-dim)  !important; }
.sub-unlimited{ border-color: rgba(74,141,212,0.3) !important; background: var(--accent-dim)  !important; }
.badge-icon   { font-size: 1.1rem; flex-shrink: 0; }
.badge-title  { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.badge-subtitle { font-size: 0.75rem; color: var(--text-secondary); margin-top: 1px; }

/* Profile stats */
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.stat-item {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: var(--space-3); text-align: center;
}
.stat-value { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 600; color: var(--accent); line-height: 1; margin-bottom: 2px; }
.stat-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Action buttons */
.profile-actions { display: flex; flex-direction: column; gap: var(--space-1); }
.action-btn {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3); border-radius: var(--radius-md);
  color: var(--text-secondary); text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  transition: all var(--transition-fast); border: 1px solid transparent;
}
.action-btn .action-icon {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; flex-shrink: 0; transition: all var(--transition-fast);
}
.action-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.action-btn:hover .action-icon { background: var(--accent-dim); border-color: var(--accent); }

/* ── Main Content ───────────────────────────────────────────── */
.main-content { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }

/* Quick stats */
.quick-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-3); }
.stat-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--space-5);
  transition: all var(--transition-base); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform var(--transition-base);
}
.stat-card:hover { border-color: var(--border); box-shadow: var(--shadow-md); }
.stat-card:hover::after { transform: scaleX(1); }
.stat-card-icon { font-size: 1.1rem; margin-bottom: var(--space-3); opacity: 0.7; }
.stat-card-value { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 600; color: var(--text-primary); line-height: 1; margin-bottom: var(--space-1); }
.stat-card-label { font-size: 0.73rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }

/* ── Section ────────────────────────────────────────────────── */
.section {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); padding: var(--space-6);
  transition: border-color var(--transition-base);
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-5); padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.section-title {
  font-size: 0.95rem; font-weight: 600; color: var(--text-primary);
  letter-spacing: -0.01em; display: flex; align-items: center; gap: var(--space-2);
}

/* ── Modules ────────────────────────────────────────────────── */
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: var(--space-4); }
.module-card {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--space-5);
  cursor: pointer; transition: all var(--transition-base);
  display: flex; flex-direction: column; gap: var(--space-3);
  position: relative; overflow: hidden;
}
.module-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0; transition: opacity var(--transition-base);
}
.module-card:hover { border-color: var(--accent); box-shadow: 0 4px 20px var(--accent-dim); transform: translateY(-2px); }
.module-card:hover::before { opacity: 1; }
.module-card.disabled { opacity: 0.45; cursor: not-allowed; }
.module-card.disabled:hover { transform: none; border-color: var(--border-subtle); box-shadow: none; }

.module-header { display: flex; align-items: center; gap: var(--space-3); }
.module-icon-wrap {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--accent-dim); border: 1px solid rgba(74,141,212,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.module-title { font-size: 0.92rem; font-weight: 600; color: var(--text-primary); }
.module-description { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; flex: 1; }
.module-footer {
  display: flex; align-items: center; justify-content: flex-end;
  padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); margin-top: auto;
}
.module-btn {
  font-size: 0.8rem; font-weight: 600; color: var(--accent);
  display: flex; align-items: center; gap: var(--space-1);
  text-decoration: none; transition: gap var(--transition-fast);
}
.module-btn:hover { gap: var(--space-2); color: var(--accent-hover); }

/* ── Activity list ──────────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: var(--space-2); }
.activity-item {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
  background: var(--bg-elevated); transition: all var(--transition-fast);
}
.activity-item:hover { border-color: var(--border); background: var(--bg-hover); }
.activity-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--accent-dim); display: flex; align-items: center;
  justify-content: center; font-size: 0.9rem; flex-shrink: 0;
}
.activity-title { font-size: 0.85rem; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
.activity-meta  { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ── Project rows ───────────────────────────────────────────── */
.project-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle); background: var(--bg-elevated);
  transition: all var(--transition-fast); gap: var(--space-4);
}
.project-row:hover { border-color: var(--border); background: var(--bg-hover); }
.project-row-left { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.project-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--accent-dim); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; }
.project-name { font-size: 0.87rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-meta { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: var(--radius-full); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.badge-success { background: var(--success-dim); color: var(--success); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-danger  { background: var(--danger-dim);  color: var(--danger); }
.badge-info    { background: var(--accent-dim);  color: var(--accent); }

/* ── Features + Clients ─────────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: var(--space-3); }
.feature-card {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--space-4);
  transition: all var(--transition-base);
}
.feature-card:hover { border-color: var(--border); transform: translateY(-2px); }
.feature-icon  { font-size: 1.3rem; margin-bottom: var(--space-3); display: block; }
.feature-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-2); }
.feature-text  { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }

.clients-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: var(--space-3); }
.client-card {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--space-4);
  display: flex; align-items: center; gap: var(--space-3);
  transition: all var(--transition-fast);
}
.client-card:hover { border-color: var(--border); background: var(--bg-hover); }
.client-icon { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--accent-dim); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.client-name     { font-size: 0.83rem; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.client-location { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 1000; align-items: center; justify-content: center; padding: var(--space-6); }
.modal.active { display: flex; }
.modal-content { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: var(--space-6); width: 100%; max-width: 520px; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow-xl); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-5); padding-bottom: var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.modal-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: var(--space-2); }
.modal-close { width: 28px; height: 28px; border-radius: var(--radius-sm); background: transparent; border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; transition: all var(--transition-fast); padding: 0; box-shadow: none; }
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); transform: none; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-4); }
.form-label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); margin-bottom: var(--space-2); }
.form-input { width: 100%; padding: 0.6rem 0.9rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-primary); font-family: var(--font-ui); font-size: 0.9rem; transition: all var(--transition-fast); outline: none; }
.form-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-dim); }
.form-input::placeholder { color: var(--text-muted); }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead tr { background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
th { padding: 0.7rem 1rem; text-align: left; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
td { padding: 0.7rem 1rem; color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: var(--bg-hover); }
td input[type="text"], td input[type="number"] { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font-mono); font-size: 0.82rem; padding: 0.3rem 0.5rem; width: 100%; outline: none; transition: border-color var(--transition-fast); }
td input[type="text"]:focus, td input[type="number"]:focus { border-color: var(--border-focus); box-shadow: 0 0 0 2px var(--accent-dim); }

/* ── Flash messages ─────────────────────────────────────────── */
.flash { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 0.85rem; margin-bottom: var(--space-4); border: 1px solid; }
.flash.error   { background: var(--danger-dim);  border-color: rgba(217,95,95,0.3);  color: var(--danger); }
.flash.success { background: var(--success-dim); border-color: rgba(58,184,122,0.3); color: var(--success); }
.flash.warning { background: var(--warning-dim); border-color: rgba(200,150,58,0.3); color: var(--warning); }
.flash.info    { background: var(--accent-dim);  border-color: rgba(74,141,212,0.3); color: var(--accent); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer { text-align: center; padding: var(--space-8) var(--space-8) var(--space-6); color: var(--text-muted); font-size: 0.78rem; border-top: 1px solid var(--border-subtle); margin-top: var(--space-8); position: relative; z-index: 1; }
.footer a { color: var(--text-muted); text-decoration: none; margin: 0 var(--space-3); transition: color var(--transition-fast); }
.footer a:hover { color: var(--accent); }

/* ── Side Menu (Geodetic Modules) ───────────────────────────── */
#side-menu { position: fixed; top: 0; left: 0; width: 58px; height: 100%; background: var(--bg-surface); border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; padding-top: var(--space-4); transition: width 0.28s cubic-bezier(0.4,0,0.2,1); z-index: 200; overflow: hidden; }
#side-menu:hover { width: 220px; }
#side-menu ul { list-style: none; width: 220px; }
#side-menu ul li a { display: flex; align-items: center; gap: var(--space-3); padding: 0.6rem var(--space-4); color: var(--text-secondary); text-decoration: none; font-size: 0.85rem; font-weight: 500; white-space: nowrap; transition: all var(--transition-fast); margin: 2px var(--space-2); border-radius: var(--radius-md); }
#side-menu ul li a:hover { background: var(--bg-hover); color: var(--text-primary); }
#side-menu ul li a.active { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(74,141,212,0.2); }
#side-menu ul li a i { width: 20px; text-align: center; flex-shrink: 0; font-size: 1rem; }
#side-menu span { opacity: 0; transition: opacity 0.2s ease; }
#side-menu:hover span { opacity: 1; }
#side-menu hr { border: none; border-top: 1px solid var(--border-subtle); margin: var(--space-3); }

.has-sidemenu .navbar         { margin-left: 58px; }
.has-sidemenu .main-container { margin-left: 58px; }

/* ── Drop Zone / Canvas ─────────────────────────────────────── */
#drop-zone { margin-top: var(--space-5); padding: var(--space-8); border: 1.5px dashed var(--border); border-radius: var(--radius-lg); text-align: center; color: var(--text-muted); cursor: pointer; transition: all var(--transition-base); font-size: 0.88rem; }
#drop-zone:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
#drop-zone.drag-over { border-color: var(--accent); background: rgba(74,141,212,0.1); color: var(--accent); transform: scale(1.01); }

#network-container { position: relative; width: 100%; height: 340px; background: var(--bg-base); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-top: var(--space-5); }
#network-svg-layer    { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }
#network-points-layer { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; }

.network-point { position: absolute; width: 12px; height: 12px; background: var(--accent); border: 2px solid var(--bg-surface); border-radius: 50%; box-shadow: 0 0 0 2px var(--accent-glow); transform: translate(-50%,-50%); cursor: move; transition: all 0.15s ease; }
.network-point.fixed { background: var(--danger); cursor: not-allowed; box-shadow: 0 0 0 2px rgba(217,95,95,0.25); }
.network-point:hover:not(.fixed) { background: var(--success); transform: translate(-50%,-50%) scale(1.4); }

.point-label { position: absolute; top: 12px; left: 12px; font-size: 0.7rem; font-weight: 600; font-family: var(--font-mono); color: var(--text-primary); background: rgba(22,27,34,0.92); padding: 2px 6px; border-radius: var(--radius-sm); pointer-events: none; border: 1px solid var(--border-subtle); }
body.light-theme .point-label { background: rgba(255,255,255,0.94); color: var(--text-primary); }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs-nav { display: flex; gap: 2px; border-bottom: 1px solid var(--border-subtle); margin-bottom: var(--space-5); overflow-x: auto; }
.tab-btn { background: transparent; border: none; border-bottom: 2px solid transparent; padding: var(--space-3) var(--space-4); color: var(--text-muted); font-family: var(--font-ui); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all var(--transition-fast); display: flex; align-items: center; gap: var(--space-2); white-space: nowrap; margin-bottom: -1px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; box-shadow: none; }
.tab-btn:hover  { background: var(--bg-hover); color: var(--text-secondary); transform: none; }
.tab-btn.active { border-bottom-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── FAB ────────────────────────────────────────────────────── */
#adjust-button { position: fixed; right: var(--space-8); bottom: var(--space-8); background: var(--accent); color: #fff; padding: 0.85rem 1.8rem; font-family: var(--font-ui); font-size: 0.92rem; font-weight: 600; border-radius: var(--radius-lg); border: none; box-shadow: 0 4px 20px var(--accent-glow); z-index: 100; cursor: pointer; transition: all var(--transition-base); letter-spacing: 0.02em; }
#adjust-button:hover { background: var(--accent-hover); transform: translateY(-3px); box-shadow: 0 8px 28px var(--accent-glow); }
#recenter-button { background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-secondary); padding: 0.5rem 0.8rem; font-size: 1rem; box-shadow: var(--shadow-sm); }
#recenter-button:hover { background: var(--bg-hover); color: var(--text-primary); transform: none; box-shadow: var(--shadow-sm); }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: var(--space-12) var(--space-6); }
.empty-state .empty-icon { font-size: 2rem; margin-bottom: var(--space-3); opacity: 0.4; }
.empty-state p { font-size: 0.85rem; color: var(--text-muted); }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.animate-fade-up { animation: fadeUp 0.4s ease both; }
.stagger > * { animation: fadeUp 0.4s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1200px) { .quick-stats { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .profile-card { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
  .profile-header { grid-column: 1 / -1; }
  .has-sidemenu .navbar, .has-sidemenu .main-container { margin-left: 0; }
  #side-menu { display: none; }
}
@media (max-width: 768px) {
  .main-container { padding: var(--space-4); }
  .nav-container  { padding: 0 var(--space-4); }
  .quick-stats    { grid-template-columns: repeat(2,1fr); }
  .modules-grid   { grid-template-columns: 1fr; }
  .features-grid  { grid-template-columns: repeat(2,1fr); }
  .clients-grid   { grid-template-columns: 1fr; }
  .profile-card   { display: flex; flex-direction: column; }
}
@media (max-width: 480px) {
  .quick-stats   { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .navbar { height: auto; padding: var(--space-3) 0; }
  .nav-container { flex-wrap: wrap; }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  #side-menu, #adjust-button, .navbar, .profile-actions, .modal { display: none !important; }
  body { background: #fff; color: #000; }
  .main-container { margin: 0; padding: 0; }
  body::before { display: none; }
}
/* ============================================================
   BUTTON VARIANTS & SHAPES — v2
   ============================================================ */

/* ── Shapes ─────────────────────────────────────────────────── */
.btn-pill   { border-radius: var(--radius-full) !important; }
.btn-sharp  { border-radius: 2px !important; }
.btn-square { border-radius: 0 !important; }

/* ── Size variants ──────────────────────────────────────────── */
.btn-xs {
    padding: .2rem .55rem;
    font-size: .72rem;
    border-radius: var(--radius-sm);
}

.btn-xl {
    padding: .9rem 2rem;
    font-size: 1rem;
    font-weight: 600;
}

/* ── Colour variants ────────────────────────────────────────── */

/* Success */
.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover {
    background: #2fa868;
    border-color: #2fa868;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58,184,122,.3);
}

/* Warning */
.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}
.btn-warning:hover {
    background: #b5832e;
    border-color: #b5832e;
    color: #fff;
    transform: translateY(-1px);
}

/* Outlined variants */
.btn-outline-primary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline-primary:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-outline-danger:hover {
    background: var(--danger);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-success {
    background: transparent;
    color: var(--success);
    border-color: var(--success);
}
.btn-outline-success:hover {
    background: var(--success);
    color: #fff;
    transform: translateY(-1px);
}

/* ── Icon-only button ───────────────────────────────────────── */
.btn-icon {
    padding: .45rem;
    width: 34px;
    height: 34px;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.btn-icon.btn-sm {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: .8rem;
    border-radius: var(--radius-sm);
}

/* ── Loading state ──────────────────────────────────────────── */
.btn-loading {
    pointer-events: none;
    opacity: .75;
}

.btn-loading::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin .6s linear infinite;
    margin-right: .4rem;
}

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

/* ── Gradient buttons ───────────────────────────────────────── */
.btn-gradient {
    background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
    color: #fff;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-gradient::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 60%);
    pointer-events: none;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #4f46e5 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,.35);
}

/* ── Subtle / muted ─────────────────────────────────────────── */
.btn-subtle {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}
.btn-subtle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border);
}

/* ── Button group ───────────────────────────────────────────── */
.btn-group {
    display: inline-flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.btn-group .btn:last-child  { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.btn-group .btn:not(:last-child) { border-right-width: 0; }
.btn-group .btn:hover { z-index: 1; border-right-width: 1px; }

/* Pill group */
.btn-group.btn-pill .btn:first-child { border-radius: var(--radius-full) 0 0 var(--radius-full); }
.btn-group.btn-pill .btn:last-child  { border-radius: 0 var(--radius-full) var(--radius-full) 0; }

/* ── Animated accent button ─────────────────────────────────── */
.btn-glow {
    background: var(--accent);
    color: #fff;
    border: none;
    box-shadow: 0 0 0 0 var(--accent-glow);
    animation: glow-pulse 2.5s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50%       { box-shadow: 0 0 0 8px transparent; }
}

.btn-glow:hover {
    background: var(--accent-hover);
    color: #fff;
    animation: none;
    box-shadow: 0 6px 20px var(--accent-glow);
    transform: translateY(-1px);
}

/* ── Light theme adjustments ────────────────────────────────── */
body.light-theme .btn-subtle {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569;
}
body.light-theme .btn-subtle:hover {
    background: #e8edf5;
    color: #1a2236;
}

/* ============================================================
   FILE UPLOAD COMPONENTS
   ============================================================ */

/* Skriveni native input */
.file-upload-hidden {
    position: absolute;
    width: 0.1px; height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

/* Upload zona — custom styled */
.upload-zone {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Glavno dugme za odabir fajla */
.upload-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
    width: 100%;
}

.upload-trigger:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.upload-trigger-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-md);
    background: var(--accent-dim);
    border: 1px solid rgba(74,141,212,.2);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    font-size: 1rem;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.upload-trigger:hover .upload-trigger-icon {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.upload-trigger-text { flex: 1; text-align: left; }
.upload-trigger-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}
.upload-trigger-hint {
    font-size: .72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.upload-trigger-arrow {
    color: var(--text-muted);
    font-size: .8rem;
    flex-shrink: 0;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.upload-trigger:hover .upload-trigger-arrow {
    transform: translateX(3px);
    color: var(--accent);
}

/* Filename display */
.upload-filename {
    display: none;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--success-dim);
    border: 1px solid rgba(58,184,122,.25);
    border-radius: var(--radius-md);
    font-size: .78rem;
    font-family: var(--font-mono);
    color: var(--success);
}

.upload-filename.visible { display: flex; }
.upload-filename i { flex-shrink: 0; }

/* Action dugme (Učitaj) */
.upload-action {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: .55rem var(--space-4);
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    justify-content: center;
}

.upload-action:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.upload-action:active { transform: none; box-shadow: none; }

.upload-action:disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Drop zone (XLSX) */
#drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-5);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: .82rem;
    color: var(--text-muted);
    background: transparent;
}

#drop-zone .dz-icon {
    font-size: 1.6rem;
    opacity: .5;
    transition: all var(--transition-fast);
}

#drop-zone:hover,
#drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}

#drop-zone:hover .dz-icon,
#drop-zone.drag-over .dz-icon {
    opacity: 1;
    transform: translateY(-3px);
}

#drop-zone .dz-label { font-weight: 600; }
#drop-zone .dz-hint  { font-size: .72rem; font-family: var(--font-mono); }

/* ============================================================
   RESULTS — JS-generated HTML styling
   Ove klase koriste script.js, script_1d.js, script_proj.js
   ============================================================ */

/* Results header */
#results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: var(--space-3);
}

#results-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Export button group */
.button-group {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.button-group button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: .4rem .9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: none;
}

.button-group button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-focus);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.button-group button.pdf {
    border-color: rgba(217,95,95,.3);
    color: var(--danger);
}

.button-group button.pdf:hover {
    background: var(--danger-dim);
    color: var(--danger);
    border-color: var(--danger);
}

/* Results section headings */
#results-container h2 {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--space-6) 0 var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

#results-container h2:first-child { margin-top: 0; }

#results-container h3 {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: var(--space-4) 0 var(--space-2);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Highlight rows */
.highlight-min-rii {
    background: rgba(217,95,95,.08) !important;
}
.highlight-min-rii td {
    color: var(--danger) !important;
    font-weight: 600;
}

.highlight-max-sigma {
    background: rgba(200,150,58,.08) !important;
}
.highlight-max-sigma td {
    color: var(--warning) !important;
    font-weight: 600;
}

/* Error & loading messages */
.error-message {
    color: var(--danger);
    font-size: .88rem;
    background: var(--danger-dim);
    border: 1px solid rgba(217,95,95,.3);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin: var(--space-4) 0;
}

/* Network info box (generated by JS) */
#network h2, #network h3 {
    font-size: .82rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

/* Sidebar stat values populated by JS */
#S0, #minri, #maxSP, #maxSH {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}

/* Global test result colors */
.test-passed  { color: var(--success) !important; font-weight: 600; }
.test-failed  { color: var(--danger)  !important; font-weight: 600; }

/* Save notice (JS generated) */
.save-notice {
    background: var(--success-dim);
    border: 1px solid rgba(58,184,122,.3);
    color: var(--success);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: .82rem;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    animation: fadeUp .3s ease both;
}

/* Table cell alignment override for results */
#results-container td {
    text-align: center;
}

#results-container td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* Adjust/Design floating button */
#adjust-button,
#design-button {
    position: fixed;
    right: var(--space-8);
    bottom: var(--space-8);
    background: linear-gradient(135deg, var(--accent) 0%, #3a6cc4 100%);
    color: #fff;
    padding: .9rem 2rem;
    font-family: var(--font-ui);
    font-size: .95rem;
    font-weight: 700;
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: 0 4px 24px var(--accent-glow), 0 2px 8px rgba(0,0,0,.3);
    z-index: 200;
    cursor: pointer;
    transition: all var(--transition-base);
    letter-spacing: .02em;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

#adjust-button::before,
#design-button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 60%);
    pointer-events: none;
}

#adjust-button:hover,
#design-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px var(--accent-glow), 0 4px 12px rgba(0,0,0,.4);
}

#adjust-button:active,
#design-button:active {
    transform: translateY(-1px);
}

/* Light theme adjustments */
body.light-theme .button-group button {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #4a5568;
}

body.light-theme .button-group button:hover {
    background: #eef2f7;
    color: #1a2236;
}

body.light-theme .highlight-min-rii {
    background: rgba(217,95,95,.06) !important;
}

body.light-theme .highlight-max-sigma {
    background: rgba(200,150,58,.06) !important;
}

body.light-theme #results-container td:first-child {
    color: #1a2236;
}
