/* ============================================================
   GROWBOARD — Design System CSS v2
   Kompaktnější layout, top bar, collapsible sidebar
   ============================================================ */

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

:root {
  --navy-900: #0B1E36;
  --navy-800: #132337;
  --navy-600: #1E3550;
  --navy-400: #2E5480;
  --navy-200: #4A7FB5;
  --navy-100: #89B4D9;
  --navy-050: #C5DDF0;

  --emerald-500: #10B981;
  --emerald-400: #34D399;
  --emerald-300: #6EE7B7;
  --emerald-600: #059669;
  
  --violet-500: #8B5CF6;
  --violet-400: #A78BFA;
  --violet-300: #C4B5FD;
  --violet-600: #7C3AED;

  --accent: #10B981;
  --accent-hover: #059669;
  --accent-light: rgba(16, 185, 129, 0.15);

  --success: #22C55E;
  --danger:  #EF4444;
  --warning: #F59E0B;
  --info:    #3B82F6;

  --bg:             #F0F4F8;
  --card:           #FFFFFF;
  --card-shadow:    0 1px 3px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 2px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
  --border:         #E2EAF0;
  --divider:        #EEF2F7;

  --text:           #0B1E36;
  --text-mid:       #374151;
  --text-light:     #6B7280;
  --text-muted:     #9CA3AF;

  --sidebar-bg:     #0B1E36;
  --sidebar-text:   #7A97B0;
  --sidebar-active: #FFFFFF;

  --font-display: 'Plus Jakarta Sans', ui-sans-serif, sans-serif;
  --font-logo: 'Raleway', ui-sans-serif, sans-serif;
  --font: 'DM Sans', ui-sans-serif, sans-serif;

  --radius-sm:  4px;
  --radius:     6px;
  --radius-lg:  8px;
  
  --sidebar-width: 220px;
  --sidebar-collapsed: 60px;
  --top-bar-height: 48px;
  --transition: 0.18s ease;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
}

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

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding-top: var(--top-bar-height);
  min-width: 0;
  transition: margin-left var(--transition);
}

body.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed);
}

.page-wrapper {
  padding: 20px 28px 40px;
  width: 100%;
}

/* ════════════════════════════════════
   TOP BAR (dark)
   ════════════════════════════════════ */
.top-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--top-bar-height);
  background: var(--navy-900);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 50;
  gap: 12px;
  transition: left var(--transition);
}

body.sidebar-collapsed .top-bar {
  left: var(--sidebar-collapsed);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
}

.top-bar-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.top-bar-spacer { flex: 1; }

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-bar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.12s;
}
.top-bar-user:hover {
  background: rgba(255,255,255,0.08);
}

.top-bar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald-500), var(--violet-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}

.top-bar-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}

/* Top bar buttons override for dark bg */
.top-bar .btn-secondary {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
}
.top-bar .btn-secondary:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--emerald-400);
  color: #fff;
}
.top-bar .btn-ghost {
  color: rgba(255,255,255,0.6);
}
.top-bar .btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.06);
  transition: width var(--transition);
  overflow: hidden;
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  height: var(--top-bar-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  position: relative;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  font-family: var(--font-logo);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-logo .logo-grow { color: var(--emerald-400); }
.sidebar-logo .logo-board { color: var(--violet-400); }

body.sidebar-collapsed .sidebar-logo .logo-board {
  display: none;
}

/* Jarvis-style collapse button - circle on edge */
.sidebar-toggle {
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy-800);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  z-index: 10;
}
.sidebar-toggle:hover {
  background: var(--navy-600);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}

.sidebar-toggle svg {
  transition: transform 0.2s;
}

body.sidebar-collapsed .sidebar-toggle {
  right: -12px;
}

body.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

.sidebar-section {
  padding: 0 8px;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  padding: 12px 8px 6px;
  white-space: nowrap;
  overflow: hidden;
}

body.sidebar-collapsed .sidebar-label {
  opacity: 0;
}

.sidebar-nav {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  transition: all 0.12s;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}
.nav-link.active {
  background: rgba(16, 185, 129, 0.15);
  color: #fff;
  font-weight: 500;
}
.nav-link.active .nav-icon {
  color: var(--emerald-400);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-icon svg {
  width: 16px;
  height: 16px;
}

.nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.sidebar-collapsed .nav-label {
  opacity: 0;
  width: 0;
}

body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px;
}

.sb-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 8px 12px;
}

/* Sidebar footer hidden when collapsed */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

body.sidebar-collapsed .sidebar-footer {
  display: none;
}

/* ════════════════════════════════════
   BUTTONS
   ════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 12px 16px;
}

.card-body.compact {
  padding: 8px 12px;
}

/* ════════════════════════════════════
   DASHBOARD SPECIFIC
   ════════════════════════════════════ */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.dash-welcome h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.dash-welcome p {
  font-size: 13px;
  color: var(--text-light);
}

.dash-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

/* Mini stats grid */
.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 200px;
}

.mini-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
}

.mini-stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.mini-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Two column layout */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

@media (min-width: 1400px) {
  .dash-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-header {
    flex-direction: column;
  }
  .mini-stats {
    width: 100%;
  }
}

/* List items */
.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background 0.1s;
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
}
.list-item:last-child {
  border-bottom: none;
}
.list-item:hover {
  background: var(--bg);
}

.list-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--emerald-500), var(--violet-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.list-info {
  flex: 1;
  min-width: 0;
}

.list-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.list-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
}

.badge-draft { background: #F3F4F6; color: #6B7280; }
.badge-testing { background: #FEF3C7; color: #D97706; }
.badge-production { background: #D1FAE5; color: #059669; }
.badge-active { background: #DBEAFE; color: #2563EB; }
.badge-completed { background: #E0E7FF; color: #4F46E5; }

/* Costs section */
.costs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 700px) {
  .costs-grid {
    grid-template-columns: 1fr;
  }
}

.cost-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.cost-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.cost-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.cost-tokens {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.cost-chart {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.cost-chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 12px;
}

/* Simple bar chart */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
}

.chart-bar {
  flex: 1;
  background: var(--emerald-400);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 0.3s;
}

.chart-bar:hover {
  background: var(--emerald-500);
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 9px;
  color: var(--text-muted);
}

/* ════════════════════════════════════
   STATUS BADGES
   ════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
}

.status-draft { background: #F3F4F6; color: #6B7280; }
.status-testing { background: #FEF3C7; color: #D97706; }
.status-production { background: #D1FAE5; color: #059669; }
.status-exported { background: #E0E7FF; color: #4F46E5; }

/* ════════════════════════════════════
   EMPTY STATE
   ════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ════════════════════════════════════
   UTILITIES
   ════════════════════════════════════ */
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }

/* ════════════════════════════════════
   CHAT (for Architect page)
   ════════════════════════════════════ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--top-bar-height) - 60px);
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.chat-message {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald-500), var(--violet-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.chat-message.user .chat-avatar {
  background: var(--navy-400);
}

.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.chat-message.assistant .chat-bubble {
  background: var(--bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-message.user .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
}

.chat-input-wrapper:focus-within {
  border-color: var(--accent);
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  resize: none;
  min-height: 20px;
  max-height: 100px;
  outline: none;
}

.chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-send-btn:hover {
  background: var(--accent-hover);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* ════════════════════════════════════
   FORMS
   ════════════════════════════════════ */
.form-input, .form-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--card);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ════════════════════════════════════
   AGENTS & SESSIONS GRID
   ════════════════════════════════════ */
.agent-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.12s;
}
.agent-card:hover {
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1000px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.table th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
}

.table tbody tr:hover {
  background: var(--bg);
}

/* ════════════════════════════════════
   DARK MODE
   ════════════════════════════════════ */
body.dark-mode {
  --bg:             #0F172A;
  --card:           #1E293B;
  --card-shadow:    0 1px 3px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
  --card-shadow-hover: 0 2px 8px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.3);
  --border:         #334155;
  --divider:        #334155;

  --text:           #F1F5F9;
  --text-mid:       #CBD5E1;
  --text-light:     #94A3B8;
  --text-muted:     #64748B;
}

body.dark-mode .card {
  border-color: var(--border);
}

body.dark-mode .btn-secondary {
  background: var(--card);
  border-color: var(--border);
  color: var(--text-light);
}
body.dark-mode .btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

body.dark-mode .list-item:hover {
  background: rgba(255,255,255,0.05);
}

body.dark-mode .mini-stat {
  background: var(--card);
  border-color: var(--border);
}

body.dark-mode .cost-card {
  background: var(--card);
  border-color: var(--border);
}

body.dark-mode .cost-chart {
  background: var(--card);
  border-color: var(--border);
}

body.dark-mode .form-input,
body.dark-mode .form-select {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

body.dark-mode .table th {
  background: var(--bg);
}

body.dark-mode .badge-draft { background: #374151; color: #9CA3AF; }
body.dark-mode .badge-testing { background: #78350F; color: #FDE68A; }
body.dark-mode .badge-production { background: #064E3B; color: #6EE7B7; }
body.dark-mode .badge-active { background: #1E3A5F; color: #93C5FD; }

/* ════════════════════════════════════
   USER MENU DROPDOWN
   ════════════════════════════════════ */
.user-menu {
  position: fixed;
  top: calc(var(--top-bar-height) + 4px);
  right: 16px;
  width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  z-index: 200;
  overflow: hidden;
}

body.dark-mode .user-menu {
  background: #1E293B;
  border-color: #334155;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.user-menu-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.user-menu-email {
  font-size: 11px;
  color: var(--text-muted);
}

.user-menu-divider {
  height: 1px;
  background: var(--border);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-mid);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.user-menu-item:hover {
  background: var(--bg);
}

body.dark-mode .user-menu-item:hover {
  background: rgba(255,255,255,0.05);
}

/* ════════════════════════════════════
   MODAL
   ════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.modal-content {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.dark-mode .modal-content {
  background: #1E293B;
  border: 1px solid #334155;
}

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

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.modal-close:hover {
  background: var(--danger);
  color: #fff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-mid);
}

.modal-body h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 10px 0;
}

.modal-body h3:first-of-type {
  margin-top: 16px;
}

.modal-body ul, .modal-body ol {
  margin: 0 0 0 20px;
  padding: 0;
}

.modal-body li {
  margin-bottom: 6px;
}

.about-intro {
  font-size: 14px;
  color: var(--text);
  padding: 12px 16px;
  background: var(--accent-light);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

.about-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}

.about-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--divider);
  font-size: 12px;
}

.about-table td:first-child {
  width: 140px;
  white-space: nowrap;
}

.about-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
  font-size: 11px;
  color: var(--text-muted);
}

/* ════════════════════════════════════
   MOBILE LAYOUT
   ════════════════════════════════════ */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--navy-900);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  z-index: 200;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

.mobile-logo {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
}

.mobile-quick-add {
  font-size: 24px;
  text-decoration: none;
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 149;
}

.mobile-menu-overlay.active {
  display: block;
}

.fab-quick-add {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: var(--accent);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  text-decoration: none;
  z-index: 100;
}

.desktop-only {
  display: inline-flex;
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }
  
  .fab-quick-add {
    display: flex;
  }
  
  .desktop-only {
    display: none;
  }
  
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 150;
    transition: left 0.3s ease;
  }
  
  .sidebar.mobile-open {
    left: 0;
  }
  
  .main-content {
    margin-left: 0;
    padding-top: 56px;
  }
  
  .top-bar {
    display: none;
  }
  
  .page-wrapper {
    padding: 16px;
  }
  
  body.menu-open {
    overflow: hidden;
  }
}

/* Collapsed sidebar */
.sidebar.collapsed {
  width: 60px;
}

.sidebar.collapsed .logo-board,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-label {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 12px;
}

.sidebar.collapsed .sidebar-toggle {
  position: static;
  transform: rotate(180deg);
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 12px;
}

.sidebar.collapsed .nav-emoji {
  margin-right: 0;
}

.sidebar.collapsed + .main-content {
  margin-left: 60px;
}

.nav-emoji {
  font-size: 16px;
  margin-right: 10px;
}
