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

/* ─── CSS Variables / Design Tokens ─── */
:root {
  --bg-base: #080d1a;
  --bg-surface: #0e1526;
  --bg-card: #131c30;
  --bg-card-hover: #192236;
  --bg-elevated: #1a2540;
  --bg-glass: rgba(19, 28, 48, 0.7);

  --accent-blue: #4f8ef7;
  --accent-blue-light: #7bb3ff;
  --accent-teal: #00d4aa;
  --accent-teal-light: #4de8c9;
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-green: #22c55e;

  --text-primary: #e8edf8;
  --text-secondary: #94a3b8;
  --text-muted: #4a5568;
  --text-accent: #7bb3ff;

  --border-subtle: rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.1);
  --border-accent: rgba(79,142,247,0.3);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px rgba(79,142,247,0.15);
  --shadow-glow-teal: 0 0 40px rgba(0,212,170,0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 150ms cubic-bezier(0.4,0,0.2,1);
  --transition-base: 250ms cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 400ms cubic-bezier(0.4,0,0.2,1);

  --nav-height: 64px;
  --sidebar-width: 0px;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
h1,h2,h3,h4,h5 { font-family: 'Outfit', sans-serif; line-height: 1.3; }
a { color: var(--accent-blue); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border-default); }

/* ─── Background mesh ─── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(79,142,247,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0,212,170,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(139,92,246,0.04) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ─── Navigation ─── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-height);
  background: rgba(8,13,26,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 32px;
}
.navbar-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800; font-size: 20px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  white-space: nowrap; letter-spacing: -0.5px;
}
.navbar-logo .logo-icon { font-size: 24px; -webkit-text-fill-color: initial; }
.navbar-tabs { display: flex; gap: 4px; flex: 1; }
.nav-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: none; background: transparent;
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-tab.active {
  color: var(--accent-blue-light);
  background: rgba(79,142,247,0.1);
}
.nav-tab.active::after {
  content: '';
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 70%; height: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal));
  border-radius: var(--radius-full);
}
.nav-tab .tab-icon { font-size: 16px; }
.navbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.navbar-search-hint {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted); font-size: 13px;
  cursor: pointer; transition: all var(--transition-fast);
}
.navbar-search-hint:hover { border-color: var(--border-accent); color: var(--text-secondary); }
.kbd { font-size: 11px; padding: 2px 5px; background: var(--bg-elevated); border-radius: 4px; }

/* ─── Page Content ─── */
.page-content { flex: 1; display: none; }
.page-content.active { display: flex; flex-direction: column; }

/* ─── Home Page ─── */
.home-hero {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 24px 40px;
  min-height: calc(100vh - var(--nav-height));
}
.home-tagline {
  font-size: 13px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent-teal); margin-bottom: 16px;
}
.home-title {
  font-size: clamp(32px, 6vw, 56px); font-weight: 800;
  text-align: center; line-height: 1.15;
  background: linear-gradient(135deg, #fff 0%, var(--accent-blue-light) 50%, var(--accent-teal) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 12px;
}
.home-subtitle { color: var(--text-secondary); font-size: 16px; text-align: center; margin-bottom: 48px; }

/* Search Bar */
.search-container { width: 100%; max-width: 680px; position: relative; margin-bottom: 24px; }
.search-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}
.search-bar:focus-within {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(79,142,247,0.15), 0 0 60px rgba(79,142,247,0.1);
}
.search-icon { font-size: 20px; color: var(--text-muted); flex-shrink: 0; }
.search-input {
  flex: 1; border: none; background: transparent;
  color: var(--text-primary); font-size: 18px;
  outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-shortcut { color: var(--text-muted); font-size: 13px; white-space: nowrap; }

/* Search Autocomplete Dropdown */
.search-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden; display: none; z-index: 200;
  max-height: 460px; overflow-y: auto;
}
.search-dropdown.visible { display: block; animation: slideDown 0.15s ease; }
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

.dropdown-section-title {
  padding: 10px 16px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}
.dropdown-section-title:first-child { border-top: none; }
.dropdown-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  cursor: pointer; transition: background var(--transition-fast);
}
.dropdown-item:hover, .dropdown-item.selected { background: var(--bg-elevated); }
.dropdown-item-icon { font-size: 18px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--bg-elevated); flex-shrink: 0; }
.dropdown-item-info { flex: 1; min-width: 0; }
.dropdown-item-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.dropdown-item-subtitle { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-item-cmd { font-family: monospace; font-size: 12px; color: var(--accent-teal); background: rgba(0,212,170,0.08); padding: 2px 8px; border-radius: 4px; }

/* Quick Access Cards */
.quick-access { width: 100%; max-width: 680px; }
.quick-access-title { font-size: 13px; font-weight: 600; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; }
.quick-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-card {
  padding: 16px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  cursor: pointer; transition: all var(--transition-base); text-align: center;
}
.quick-card:hover { border-color: var(--border-accent); background: var(--bg-card-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick-card-icon { font-size: 28px; margin-bottom: 8px; }
.quick-card-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.quick-card-count { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ─── Page Header ─── */
.page-header {
  padding: 32px 32px 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.page-header-left {}
.page-title { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md); border: none;
  font-size: 14px; font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #3b6fd4);
  color: #fff;
  box-shadow: 0 4px 16px rgba(79,142,247,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(79,142,247,0.4); filter: brightness(1.1); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-default); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-accent); }
.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 16px; transition: all var(--transition-fast); }
.btn-icon:hover { color: var(--text-primary); border-color: var(--border-accent); background: var(--bg-elevated); }

/* ─── Filter / Sort Bar ─── */
.filter-bar {
  padding: 20px 32px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.filter-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-full);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast);
}
.filter-chip:hover { border-color: var(--border-accent); color: var(--text-primary); }
.filter-chip.active { background: rgba(79,142,247,0.12); border-color: var(--accent-blue); color: var(--accent-blue-light); }
.filter-sep { flex: 1; }
.sort-select {
  padding: 6px 12px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); font-size: 13px; cursor: pointer;
  outline: none; appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.sort-select:focus { border-color: var(--border-accent); }

/* ─── Grid ─── */
.grid-container { padding: 0 32px 32px; }
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ─── Item Card ─── */
.item-card {
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}
.item-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(79,142,247,0.1);
}
.item-card-thumb {
  height: 140px;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; position: relative; overflow: hidden;
}
.item-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-card-thumb .type-overlay {
  position: absolute; top: 8px; right: 8px;
  padding: 3px 8px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
}
.type-image { background: rgba(79,142,247,0.2); color: var(--accent-blue-light); }
.type-document { background: rgba(239,68,68,0.2); color: #f87171; }
.type-sheet { background: rgba(34,197,94,0.2); color: #4ade80; }
.type-link { background: rgba(139,92,246,0.2); color: #a78bfa; }
.type-other { background: rgba(245,158,11,0.2); color: #fbbf24; }

.item-card-body { padding: 14px 16px 16px; }
.item-card-name { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-card-desc { font-size: 12px; color: var(--text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item-card-footer { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.item-card-date { font-size: 11px; color: var(--text-muted); flex: 1; }
.item-card-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition-fast); }
.item-card:hover .item-card-actions { opacity: 1; }
.item-card-action { width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); background: var(--bg-elevated); color: var(--text-muted); font-size: 13px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition-fast); }
.item-card-action:hover { color: var(--text-primary); border-color: var(--border-accent); }
.item-card-action.delete:hover { color: #f87171; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.1); }

/* Tags */
.tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.tag { padding: 2px 8px; border-radius: var(--radius-full); font-size: 11px; background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border-subtle); }

/* ─── Empty State ─── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 24px; text-align: center; gap: 12px; width: 100%;
}
.empty-state-icon { font-size: 56px; opacity: 0.4; }
.empty-state-title { font-size: 18px; font-weight: 600; color: var(--text-secondary); }
.empty-state-subtitle { font-size: 14px; color: var(--text-muted); max-width: 360px; }

/* ─── Presentations Page ─── */
.presentations-tabs {
  display: flex; gap: 4px;
  padding: 20px 32px 0;
}
.pres-tab {
  padding: 10px 24px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid transparent; border-bottom: none;
  background: transparent; color: var(--text-secondary);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all var(--transition-fast);
}
.pres-tab:hover { color: var(--text-primary); background: var(--bg-card); }
.pres-tab.active {
  background: var(--bg-card); color: var(--accent-blue-light);
  border-color: var(--border-default);
}
.pres-content { flex: 1; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg); margin: 0 32px; padding: 24px; }

/* ─── Core Sales Page ─── */
.core-sales-subtabs-wrapper {
  padding: 20px 32px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.core-sales-subtabs {
  display: flex; gap: 2px;
  overflow-x: auto; padding-bottom: 0;
  scrollbar-width: none;
}
.core-sales-subtabs::-webkit-scrollbar { display: none; }
.cs-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid transparent; border-bottom: none;
  background: transparent; color: var(--text-muted);
  font-size: 13px; font-weight: 500; cursor: pointer;
  white-space: nowrap; transition: all var(--transition-fast);
  position: relative; bottom: -1px;
}
.cs-tab:hover { color: var(--text-primary); background: var(--bg-card); border-color: var(--border-subtle); }
.cs-tab.active {
  background: var(--bg-card); color: var(--accent-blue-light);
  border-color: var(--border-default); border-bottom-color: var(--bg-card);
}
.cs-tab-add {
  color: var(--accent-teal); border: 1px dashed rgba(0,212,170,0.3);
  background: transparent;
}
.cs-tab-add:hover { background: rgba(0,212,170,0.05); border-color: var(--accent-teal); }
.cs-tab .tab-delete { opacity: 0; font-size: 12px; margin-left: 4px; color: var(--text-muted); transition: opacity var(--transition-fast); }
.cs-tab:hover .tab-delete { opacity: 1; }
.cs-tab .tab-delete:hover { color: #f87171; }

.cs-content { flex: 1; padding: 24px 32px; }
.cs-content-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.cs-content-title { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.cs-entries-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* Entry Card */
.entry-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  transition: all var(--transition-base); position: relative;
}
.entry-card:hover { border-color: var(--border-accent); box-shadow: var(--shadow-sm); }
.entry-card.pinned { border-color: rgba(245,158,11,0.3); }
.entry-card.pinned::before { content: '📌'; position: absolute; top: 12px; right: 12px; font-size: 14px; }
.entry-card-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); padding-right: 24px; }
.entry-card-content { font-size: 14px; color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; max-height: 120px; overflow: hidden; position: relative; }
.entry-card-content.expanded { max-height: none; }
.entry-card-fade { position: absolute; bottom: 0; left: 0; right: 0; height: 40px; background: linear-gradient(transparent, var(--bg-card)); }
.entry-card-actions { display: flex; gap: 6px; margin-top: 12px; opacity: 0; transition: opacity var(--transition-fast); }
.entry-card:hover .entry-card-actions { opacity: 1; }

/* ─── Modal ─── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; visibility: hidden;
  transition: all var(--transition-base);
}
.modal-backdrop.visible { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-base);
  overflow: hidden;
}
.item-card-body { padding: 10px 12px 12px; }
.item-card-footer { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }

.modal-backdrop.fullscreen-mode .modal {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  background: #05070a !important;
}
.modal-backdrop.fullscreen-mode .modal-body {
  max-height: calc(100vh - 100px) !important;
  height: calc(100vh - 100px) !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px !important;
  overflow: hidden !important;
}
.modal-backdrop.fullscreen-mode .image-preview-container {
  width: 100% !important;
  height: 100% !important;
  max-height: calc(100vh - 120px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}
.modal-backdrop.fullscreen-mode img {
  max-width: 95vw !important;
  max-height: 78vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 6px;
}
.modal-backdrop.fullscreen-mode iframe {
  height: calc(100vh - 140px) !important;
  width: 98vw !important;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: var(--radius-sm); border: none; background: var(--bg-elevated); color: var(--text-secondary); font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition-fast); }
.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
}
.preview-content-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}
.preview-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: flex-end; gap: 10px; }

/* ─── Form Elements ─── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.form-input, .form-textarea, .form-select {
  padding: 10px 14px;
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px;
  outline: none; transition: border-color var(--transition-fast);
  width: 100%;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent-blue); }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-select { appearance: none; cursor: pointer; }
.form-select option { background: var(--bg-surface); }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border-default); border-radius: var(--radius-lg);
  padding: 32px; text-align: center; cursor: pointer;
  transition: all var(--transition-base);
}
.upload-zone:hover, .upload-zone.dragging { border-color: var(--accent-blue); background: rgba(79,142,247,0.05); }
.upload-zone-icon { font-size: 36px; margin-bottom: 12px; }
.upload-zone-text { font-size: 14px; color: var(--text-secondary); }
.upload-zone-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.upload-progress { display: none; margin-top: 12px; }
.upload-progress.visible { display: block; }
.progress-bar { height: 4px; background: var(--bg-elevated); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal)); border-radius: var(--radius-full); transition: width 0.3s ease; }
.upload-preview { margin-top: 12px; padding: 10px; background: var(--bg-elevated); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }

/* ─── Toast Notifications ─── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  display: flex; flex-direction: column-reverse; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  font-size: 14px; font-weight: 500; color: var(--text-primary);
  min-width: 280px;
  animation: slideInRight 0.25s ease;
}
@keyframes slideInRight { from { opacity:0; transform: translateX(30px); } to { opacity:1; transform: translateX(0); } }
.toast.success { border-color: rgba(34,197,94,0.3); }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.info { border-color: rgba(79,142,247,0.3); }
.toast-icon { font-size: 18px; }
.toast-out { animation: slideOutRight 0.25s ease forwards; }
@keyframes slideOutRight { to { opacity:0; transform: translateX(30px); } }

/* ─── Loading Spinner ─── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; width: 100%;
}

/* ─── Badge ─── */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--accent-blue); color: #fff;
  border-radius: var(--radius-full); font-size: 11px; font-weight: 700;
}

/* ─── Stat Cards on Home ─── */
.stats-bar {
  display: flex; gap: 16px; justify-content: center;
  margin-top: 40px; flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-value { font-size: 28px; font-weight: 700; font-family: 'Outfit', sans-serif; background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-divider { width: 1px; background: var(--border-subtle); align-self: stretch; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .quick-cards { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; }
  .filter-bar { padding: 16px; }
  .grid-container { padding: 0 16px 24px; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .home-hero { padding: 48px 16px 24px; }
  .core-sales-subtabs-wrapper { padding: 16px 16px 0; }
  .cs-content { padding: 16px; }
  .pres-content { margin: 0 16px; }
  .presentations-tabs { padding: 16px 16px 0; }
}
