/* ═══════════════════════════════════════════════════════════════
   TechBugs Billing System — Premium Cyberpunk SaaS Design v2.0
   ═══════════════════════════════════════════════════════════════ */

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

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

/* ═══ ROOT VARIABLES ═══ */
:root {
  --bg: #030305;
  --bg-elevated: #08080c;
  --surface: #0e0e14;
  --surface-2: #141419;
  --surface-3: #1a1a22;
  --border: rgba(255, 255, 255, 0.045);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --text: #f0f0f4;
  --text-secondary: #a0a0ab;
  --text-tertiary: #6e6e7a;
  --text-ghost: #4e4e58;

  --accent: #DC143C;
  --accent-soft: rgba(220, 20, 60, 0.1);
  --accent-medium: rgba(220, 20, 60, 0.18);
  --accent-hover: #FF1744;
  --accent-glow: 0 0 60px rgba(220, 20, 60, 0.12);
  --accent-glow-strong: 0 0 80px rgba(220, 20, 60, 0.2);

  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.1);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.1);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.1);
  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.1);
  --red-soft: rgba(239, 68, 68, 0.1);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 40px rgba(220, 20, 60, 0.06);
  --shadow-accent: 0 4px 24px rgba(220, 20, 60, 0.3);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration: 250ms;
  --duration-slow: 400ms;

  --sidebar-width: 260px;
}

/* ═══ LIGHT MODE ═══ */
.light-mode {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --surface-3: #e5e5ea;
  --border: rgba(0, 0, 0, 0.06);
  --border-subtle: rgba(0, 0, 0, 0.04);
  --border-hover: rgba(0, 0, 0, 0.12);

  --text: #09090b;
  --text-secondary: #3f3f46;
  --text-tertiary: #71717a;
  --text-ghost: #a1a1aa;

  --accent-soft: rgba(220, 20, 60, 0.06);
  --accent-medium: rgba(220, 20, 60, 0.1);
  --green-soft: rgba(34, 197, 94, 0.06);
  --amber-soft: rgba(245, 158, 11, 0.06);
  --blue-soft: rgba(59, 130, 246, 0.06);
  --purple-soft: rgba(168, 85, 247, 0.06);
  --red-soft: rgba(239, 68, 68, 0.06);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 40px rgba(220, 20, 60, 0.04);
  --shadow-accent: 0 4px 20px rgba(220, 20, 60, 0.15);
}

/* ═══ BASE ═══ */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, .brand-name, .page-title, .stat-value,
.btn-primary, .btn-secondary, .quick-create-btn {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }

::selection { background: var(--accent); color: white; }

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

.app-container { display: flex; min-height: 100vh; }

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform var(--duration) var(--ease-out);
}

/* Red glow line at top of sidebar */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  z-index: 10;
}

/* Subtle ambient glow */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(220, 20, 60, 0.04) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.logo-section {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: var(--radius-md);
  filter: drop-shadow(0 0 14px rgba(220, 20, 60, 0.35));
  transition: all var(--duration);
}

.logo:hover {
  filter: drop-shadow(0 0 22px rgba(220, 20, 60, 0.6));
  transform: scale(1.04);
}

.brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  background: linear-gradient(135deg, #fff 0%, #DC143C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══ NAVIGATION ═══ */
.nav-menu {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: var(--text-tertiary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  transition: all var(--duration-fast) var(--ease-out);
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--text-secondary);
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(220, 20, 60, 0.5);
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
  transition: transform var(--duration-fast);
}

.nav-item:hover i { transform: scale(1.1); }

/* ═══ SIDEBAR FOOTER ═══ */
.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast);
}

.user-info:hover { background: var(--surface); }

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #f87171);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(220, 20, 60, 0.25);
}

.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-weight: 600; color: var(--text); font-size: 13px; }
.user-role { font-size: 11px; color: var(--text-ghost); }

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */

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

/* ═══ HEADER ═══ */
.header {
  background: rgba(3, 3, 5, 0.75);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.light-mode .header {
  background: rgba(255, 255, 255, 0.82);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
}

.menu-toggle:hover { background: var(--surface); }

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ═══ SEARCH ═══ */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0 14px;
  height: 38px;
  border-radius: var(--radius-full);
  width: 280px;
  transition: all var(--duration);
}

.search-box:focus-within {
  border-color: rgba(220, 20, 60, 0.3);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 20px rgba(220, 20, 60, 0.06);
}

.search-box i { color: var(--text-ghost); font-size: 13px; }

.search-box input {
  border: none;
  background: none;
  outline: none;
  width: 100%;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
}

.search-box input::placeholder { color: var(--text-ghost); }

/* ═══ HEADER BUTTONS ═══ */
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast);
  position: relative;
}

.icon-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.notification-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  animation: pulse-badge 2s ease infinite;
}

@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 20, 60, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(220, 20, 60, 0); }
}

.theme-toggle { cursor: pointer; }

/* ═══ BUTTONS ═══ */
.btn-primary,
.quick-create-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #b91c3c 100%);
  color: white;
  border: none;
  padding: 0 20px;
  height: 38px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--duration) var(--ease-out);
  position: relative;
  overflow: hidden;
}

/* Shimmer effect */
.btn-primary::before,
.quick-create-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  transition: left 0.5s ease;
}

.btn-primary:hover,
.quick-create-btn:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover::before,
.quick-create-btn:hover::before {
  left: 100%;
}

.btn-primary:active,
.quick-create-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── Secondary Button ── */
.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0 20px;
  height: 38px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  border: 1px solid var(--border);
  transition: all var(--duration) var(--ease-out);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-hover);
  color: var(--text);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════ */

.dashboard-content {
  padding: 28px 32px;
  flex: 1;
}

/* ── Dashboard Greeting ── */
.greeting-section {
  margin-bottom: 28px;
  animation: fadeInUp 0.6s var(--ease-out) both;
}

.greeting-section h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.greeting-section h2 span {
  background: linear-gradient(135deg, var(--accent), #f87171);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.greeting-section p {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* ═══ STATS GRID ═══ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 22px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--duration) var(--ease-out);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

/* Gradient top border on hover */
.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--duration);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.stat-card:hover::after { opacity: 0.7; }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
}

.stat-icon.pending { background: var(--amber-soft); color: var(--amber); }
.stat-icon.success { background: var(--green-soft); color: var(--green); }
.stat-icon.info { background: var(--blue-soft); color: var(--blue); }
.stat-icon.red { background: var(--accent-soft); color: var(--accent); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }

.stat-info { min-width: 0; }

.stat-info h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'Inter', sans-serif;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-change { font-size: 12px; font-weight: 500; }
.stat-change.positive { color: var(--green); }
.stat-change.negative { color: var(--amber); }

/* ═══ CONTENT GRID ═══ */
.content-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

/* ═══ CARDS ═══ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--duration);
  animation: fadeInUp 0.5s var(--ease-out) both;
  animation-delay: 0.25s;
}

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

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

.card-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.view-all {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--duration-fast);
}

.view-all:hover { gap: 10px; color: var(--accent-hover); }

/* ═══ DASHBOARD TABLE ═══ */
.invoice-table table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
  padding: 13px 22px;
  text-align: left;
}

.invoice-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-ghost);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
}

.invoice-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: all var(--duration-fast);
}

.invoice-table tbody tr:last-child { border-bottom: none; }

.invoice-table tbody tr:hover {
  background: var(--surface-2);
}

.invoice-table td {
  font-size: 13px;
  color: var(--text-secondary);
}

.invoice-table td strong {
  color: var(--text);
  font-weight: 600;
}

/* ═══ STATUS BADGES ═══ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge.paid {
  background: var(--green-soft);
  color: var(--green);
}
.status-badge.paid::before { background: var(--green); box-shadow: 0 0 6px var(--green); }

.status-badge.pending {
  background: var(--amber-soft);
  color: var(--amber);
}
.status-badge.pending::before { background: var(--amber); box-shadow: 0 0 6px var(--amber); }

.status-badge.overdue {
  background: var(--red-soft);
  color: #ef4444;
}
.status-badge.overdue::before { background: #ef4444; box-shadow: 0 0 6px #ef4444; }

.status-badge.draft {
  background: var(--surface-3);
  color: var(--text-tertiary);
}
.status-badge.draft::before { background: var(--text-tertiary); }

.status-badge.converted,
.status-converted {
  background: var(--blue-soft);
  color: var(--blue);
}
.status-badge.converted::before { background: var(--blue); box-shadow: 0 0 6px var(--blue); }

/* ═══ QUICK ACTIONS ═══ */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 18px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-tertiary);
  transition: all var(--duration) var(--ease-out);
  text-align: center;
}

.action-btn:hover {
  background: linear-gradient(135deg, var(--accent), #b91c3c);
  color: white;
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-accent);
}

.action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--duration) var(--ease-out);
  background: var(--accent-soft);
  color: var(--accent);
}

.action-icon.estimate { background: var(--amber-soft); color: var(--amber); }
.action-icon.quotation { background: var(--purple-soft); color: var(--purple); }
.action-icon.customer { background: var(--blue-soft); color: var(--blue); }
.action-icon.product { background: var(--green-soft); color: var(--green); }
.action-icon.report { background: var(--accent-soft); color: var(--accent); }

.action-btn:hover .action-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.action-btn span {
  font-weight: 600;
  font-size: 12px;
  font-family: 'Space Grotesk', sans-serif;
}

/* ═══ ACTIVITY FEED ═══ */
.activity-list { padding: 18px; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-item:first-child { padding-top: 0; }

.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.activity-icon.paid { background: var(--green-soft); color: var(--green); }
.activity-icon.invoice { background: var(--accent-soft); color: var(--accent); }
.activity-icon.estimate { background: var(--blue-soft); color: var(--blue); }
.activity-icon.green { background: var(--green-soft); color: var(--green); }
.activity-icon.red { background: var(--accent-soft); color: var(--accent); }
.activity-icon.blue { background: var(--blue-soft); color: var(--blue); }

.activity-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-content strong { color: var(--text); }

.activity-time {
  font-size: 11px;
  color: var(--text-ghost);
  margin-top: 3px;
  display: block;
}

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex; }

.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-xl), var(--accent-glow);
  animation: modalIn var(--duration-slow) var(--ease-out);
  text-align: center;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 24px 24px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  width: 100%;
}

.close-btn {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.close-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.modal-body {
  padding: 4px 24px 24px;
  text-align: left;
}

/* ── Quick Create Options ── */
.quick-create-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.create-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-tertiary);
  transition: all var(--duration) var(--ease-out);
  text-align: center;
}

.create-option i { font-size: 24px; }
.create-option span { font-size: 12px; font-weight: 600; font-family: 'Space Grotesk', sans-serif; }

.create-option:hover {
  background: linear-gradient(135deg, var(--accent), #b91c3c);
  color: white;
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-accent);
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: 'Inter', sans-serif;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--duration);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-ghost); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Items Section ── */
.items-section {
  margin: 22px 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.items-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 14px;
  text-align: center;
}

.items-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 44px;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.items-header span {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-ghost);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 44px;
  gap: 10px;
  margin-bottom: 10px;
}

.item-row input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--duration-fast);
}

.item-row input:focus { border-color: var(--accent); }

.item-row .remove-item {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
  font-size: 13px;
}

.item-row .remove-item:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.add-item-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  background: transparent;
  color: var(--accent);
  border: 1px dashed rgba(220, 20, 60, 0.25);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  transition: all var(--duration-fast);
  font-family: 'Space Grotesk', sans-serif;
}

.add-item-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* ── Totals ── */
.totals-section {
  margin-left: auto;
  width: 280px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.totals-row:last-child { border-bottom: none; }
.totals-row span:first-child { font-size: 13px; color: var(--text-secondary); }

.totals-row.total {
  padding-top: 12px;
  margin-top: 6px;
  border-top: 2px solid var(--accent);
  border-bottom: none;
}

.totals-row.total span {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.discount-input { display: flex; align-items: center; gap: 6px; }

.discount-input input {
  width: 48px;
  padding: 5px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  text-align: right;
  color: var(--text);
  outline: none;
}

.discount-input input:focus { border-color: var(--accent); }

/* ── Form Actions ── */
.form-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HERO BANNERS — Unified Red Brand
   ═══════════════════════════════════════════════════════════════ */

.page-hero,
.customers-header,
.estimate-header,
.quotation-header,
.products-header,
.reports-header,
.settings-header {
  background: linear-gradient(135deg, var(--accent) 0%, #8B0000 60%, #1a0008 100%);
  color: white;
  padding: 32px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.page-hero::before,
.customers-header::before,
.estimate-header::before,
.quotation-header::before,
.products-header::before,
.reports-header::before,
.settings-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 280px;
  height: 280px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.page-hero::after,
.customers-header::after,
.quotation-header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
}

.page-hero h2,
.customers-header h2,
.estimate-header h2,
.quotation-header h2,
.products-header h2,
.reports-header h2,
.settings-header h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.page-hero p,
.customers-header p,
.estimate-header p,
.quotation-header p,
.products-header p,
.reports-header p,
.settings-header p {
  opacity: 0.85;
  font-size: 14px;
  position: relative;
  z-index: 1;
  line-height: 1.6;
}

/* ═══ QUOTATION BADGE ═══ */
.quotation-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  margin-top: 12px;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ═══ CONVERT BUTTON (Estimates page) ═══ */
.convert-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.convert-btn:hover {
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   CUSTOMERS PAGE
   ═══════════════════════════════════════════════════════════════ */

.customers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.customer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all var(--duration) var(--ease-out);
  position: relative;
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.customer-card:nth-child(odd) { animation-delay: 0.05s; }
.customer-card:nth-child(even) { animation-delay: 0.1s; }

.customer-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.customer-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.customer-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), #f87171);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(220, 20, 60, 0.2);
}

.customer-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.customer-email {
  font-size: 13px;
  color: var(--text-ghost);
}

.customer-details { margin-bottom: 14px; }

.customer-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.customer-detail i {
  width: 18px;
  color: var(--text-ghost);
  font-size: 12px;
}

.customer-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.customer-stat { text-align: center; }
.customer-stat-value { font-size: 18px; font-weight: 700; color: var(--text); }
.customer-stat-label { font-size: 11px; color: var(--text-ghost); }

.customer-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 6px;
}

.customer-action-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast);
  font-size: 12px;
}

.customer-action-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.customer-action-btn.delete:hover {
  background: #ef4444;
  border-color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════════
   PRODUCTS PAGE
   ═══════════════════════════════════════════════════════════════ */

.products-table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: fadeInUp 0.5s var(--ease-out) both;
  animation-delay: 0.2s;
}

.products-table { width: 100%; border-collapse: collapse; }

.products-table th,
.products-table td {
  padding: 13px 20px;
  text-align: left;
}

.products-table th {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-ghost);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
}

.products-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: all var(--duration-fast);
}

.products-table tbody tr:hover { background: var(--surface-2); }

.product-name { font-weight: 600; color: var(--text); }

.product-category {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-soft);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.product-price { font-weight: 600; color: var(--text); }
.product-actions { display: flex; gap: 6px; }

.product-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast);
  font-size: 13px;
}

.product-action-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.product-action-btn.delete:hover {
  background: #ef4444;
  border-color: #ef4444;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-ghost);
}

.empty-state i {
  font-size: 56px;
  color: var(--border-hover);
  margin-bottom: 20px;
  display: block;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════
   REPORTS PAGE
   ═══════════════════════════════════════════════════════════════ */

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.report-card:nth-child(1) { animation-delay: 0.05s; }
.report-card:nth-child(2) { animation-delay: 0.1s; }
.report-card:nth-child(3) { animation-delay: 0.15s; }
.report-card:nth-child(4) { animation-delay: 0.2s; }

.report-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.report-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent), #f87171);
}

.report-card-icon.blue { background: linear-gradient(135deg, var(--blue), #60a5fa); }
.report-card-icon.green { background: linear-gradient(135deg, var(--green), #4ade80); }
.report-card-icon.purple { background: linear-gradient(135deg, var(--purple), #c084fc); }
.report-card-icon.red { background: linear-gradient(135deg, var(--accent), #f87171); }

.report-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.report-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Summary Cards ── */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: center;
  transition: all var(--duration) var(--ease-out);
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.summary-card:nth-child(1) { animation-delay: 0.05s; }
.summary-card:nth-child(2) { animation-delay: 0.1s; }
.summary-card:nth-child(3) { animation-delay: 0.15s; }
.summary-card:nth-child(4) { animation-delay: 0.2s; }

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.summary-card-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--accent);
}

.summary-card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-family: 'Space Grotesk', sans-serif;
}

.summary-card-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Chart Container ── */
.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 28px;
  animation: fadeInUp 0.5s var(--ease-out) both;
  animation-delay: 0.25s;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.chart-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.chart-placeholder {
  height: 280px;
  background: var(--surface-2);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-ghost);
  font-size: 14px;
  gap: 8px;
}

.chart-placeholder i {
  font-size: 32px;
  color: var(--text-ghost);
  opacity: 0.5;
}

/* ── Transactions ── */
.recent-transactions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: fadeInUp 0.5s var(--ease-out) both;
  animation-delay: 0.3s;
}

.transaction-list { padding: 0; }

.transaction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast);
}

.transaction-item:hover { background: var(--surface-2); }
.transaction-item:last-child { border-bottom: none; }

.transaction-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.transaction-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.transaction-icon.income { background: var(--green-soft); color: var(--green); }
.transaction-icon.expense { background: var(--red-soft); color: #ef4444; }

.transaction-details h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.transaction-details p {
  font-size: 11px;
  color: var(--text-ghost);
}

.transaction-amount { font-weight: 600; font-size: 14px; color: var(--text); }
.transaction-amount.positive { color: var(--green); }
.transaction-amount.negative { color: #ef4444; }

/* ═══════════════════════════════════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════════════════════════════════ */

.settings-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}

.settings-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  height: fit-content;
  animation: fadeInUp 0.5s var(--ease-out) both;
  animation-delay: 0.1s;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  cursor: pointer;
  transition: all var(--duration-fast);
  font-size: 13px;
  font-weight: 500;
}

.settings-nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.settings-nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.settings-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  animation: fadeInUp 0.5s var(--ease-out) both;
  animation-delay: 0.15s;
}

.settings-section { margin-bottom: 28px; }
.settings-section:last-child { margin-bottom: 0; }

.settings-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.settings-form .form-group { margin-bottom: 0; }
.settings-form .full-width { grid-column: 1 / -1; }

/* ── Logo Upload ── */
.logo-upload {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 2px dashed var(--border-hover);
  transition: border-color var(--duration);
}

.logo-upload:hover { border-color: var(--accent); }

.logo-preview {
  width: 104px;
  height: 104px;
  background: var(--surface);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
}

.logo-preview img { max-width: 90px; max-height: 90px; object-fit: contain; }

.logo-upload-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.logo-upload-info p {
  font-size: 12px;
  color: var(--text-ghost);
  margin-bottom: 10px;
}

/* ── Color Picker ── */
.color-picker { display: flex; gap: 10px; }

.color-option {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--duration-fast);
}

.color-option:hover { transform: scale(1.15); }
.color-option.active {
  border-color: var(--text);
  box-shadow: 0 0 12px rgba(220, 20, 60, 0.3);
}

/* ── Toggle Switches ── */
.toggle-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: background var(--duration-fast);
}

.toggle-switch:hover { background: var(--surface-3); }
.toggle-switch:last-child { margin-bottom: 0; }

.toggle-label { display: flex; flex-direction: column; }
.toggle-label span:first-child { font-weight: 600; color: var(--text); font-size: 13px; }
.toggle-label span:last-child { font-size: 12px; color: var(--text-ghost); }

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--surface-3);
  transition: 0.25s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
  background-color: var(--accent);
  box-shadow: 0 0 12px rgba(220, 20, 60, 0.3);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* ── Danger Zone ── */
.danger-zone {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.danger-zone h4 {
  color: #ef4444;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.danger-zone p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.danger-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all var(--duration);
}

.danger-btn:hover {
  background: #dc2626;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ── Animation Utility Classes ── */
.animate-in {
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.animate-fade {
  animation: fadeIn 0.4s var(--ease-out) both;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .header { padding: 0 16px; }
  .search-box { display: none; }
  .dashboard-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .quick-create-options { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .items-header, .item-row { grid-template-columns: 1fr; }
  .totals-section { width: 100%; margin-left: 0; }
  .customers-grid { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

/* ═══ PRINT ═══ */
@media print {
  .sidebar, .header, .quick-actions, .activity-card,
  .page-hero, .customers-header, .estimate-header,
  .quotation-header, .products-header, .reports-header,
  .settings-header { display: none; }
  .main-content { margin-left: 0; }
}
