/* =====================================================
   Voice Quote App — South Africa Edition
   Warm earth tones, professional animations, bold layout
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&family=IBM+Plex+Mono:wght@400;500;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --bg-deep:     #121016;
  --bg-primary:  #1a1720;
  --bg-card:     #221f28;
  --bg-elevated: #2a2630;
  --bg-input:    #1e1b24;

  --warm-100: #fff5eb;
  --warm-200: #ffdeb8;
  --warm-300: #f0b06a;
  --warm-400: #e8943c;
  --warm-500: #d07a28;
  --warm-600: #b5621e;
  --warm-700: #8a4a18;

  --text-primary:   #f0eaf5;
  --text-secondary: #ada3b4;
  --text-muted:     #756b7e;
  --text-inverse:   #121016;

  --accent-green:  #5cb8a5;
  --accent-red:    #f06060;
  --accent-blue:   #60a5fa;
  --accent-gold:   #f5c542;

  --border-subtle: rgba(255,255,255,0.08);
  --border-warm:   rgba(232,148,60,0.3);
  --border-focus:  rgba(232,148,60,0.6);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 40px rgba(232,148,60,0.12);

  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

/* ---------- Light Mode Overrides ---------- */
[data-theme="light"] {
  --bg-deep:      #f7f0e8;
  --bg-primary:   #fdf9f4;
  --bg-card:      #fffcf8;
  --bg-elevated:  #f5ece0;
  --bg-input:     #f0e8dc;

  --warm-300: #d08a3c;
  --warm-400: #c47a28;

  --text-primary:   #1a1520;
  --text-secondary: #5a5265;
  --text-muted:     #8a8295;
  --text-inverse:   #f0eaf5;

  --border-subtle: rgba(0,0,0,0.08);
  --border-warm:   rgba(185,100,30,0.25);
  --border-focus:  rgba(185,100,30,0.5);

  --shadow-sm:   0 2px 8px rgba(0,0,0,0.05);
  --shadow-md:   0 8px 30px rgba(0,0,0,0.07);
  --shadow-lg:   0 20px 60px rgba(0,0,0,0.09);
  --shadow-glow: 0 0 40px rgba(232,148,60,0.06);
}
[data-theme="light"] .page-bg {
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(232,148,60,0.06) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(92,184,165,0.03) 0%, transparent 50%),
    var(--bg-deep);
}
[data-theme="light"] .page-bg::after { opacity: 0.012; }
[data-theme="light"] .sidebar {
  background: var(--bg-primary);
  box-shadow: 2px 0 12px rgba(0,0,0,0.04);
}
[data-theme="light"] .nav-link.active {
  background: rgba(196,122,40,0.1);
}
[data-theme="light"] .card {
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
[data-theme="light"] .card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
[data-theme="light"] .stat-card::after {
  background: linear-gradient(135deg, rgba(232,148,60,0.06), rgba(92,184,165,0.04));
}
[data-theme="light"] .flash {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}
[data-theme="light"] .mobile-toggle {
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
[data-theme="light"] .btn-secondary {
  background: rgba(0,0,0,0.04);
  color: var(--text-primary);
}
[data-theme="light"] .btn-secondary:hover {
  background: rgba(0,0,0,0.08);
}
[data-theme="light"] .data-table thead th {
  background: var(--bg-elevated);
}
[data-theme="light"] .user-avatar {
  background: linear-gradient(135deg, var(--warm-400), var(--warm-600));
  color: #fff;
}
[data-theme="light"] .quota-track {
  background: rgba(0,0,0,0.06);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}
[data-theme="light"] .data-table thead {
  background: rgba(0,0,0,0.02);
}
[data-theme="light"] .data-table td {
  border-bottom-color: rgba(0,0,0,0.04);
}
[data-theme="light"] .data-table tbody tr:hover td {
  background: rgba(232,148,60,0.04);
}
[data-theme="light"] .pricing-card {
  background: var(--bg-card);
  border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .pricing-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 0 0 1px rgba(232,148,60,0.15);
}
[data-theme="light"] .pricing-card.popular {
  background: linear-gradient(180deg, rgba(232,148,60,0.04) 0%, var(--bg-card) 40%);
}
[data-theme="light"] .insight-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
[data-theme="light"] .insight-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
[data-theme="light"] .skeleton {
  background: linear-gradient(90deg,
    rgba(0,0,0,0.04) 25%,
    rgba(0,0,0,0.06) 50%,
    rgba(0,0,0,0.04) 75%
  );
  background-size: 200% 100%;
}
[data-theme="light"] [data-tooltip]::after {
  background: var(--bg-card);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
[data-theme="light"] .sidebar-actions {
  border-top-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .sidebar-action-link:hover {
  background: rgba(240,96,96,0.04);
}
[data-theme="light"] .theme-toggle-btn {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .theme-toggle-btn:hover {
  background: rgba(232,148,60,0.06);
  border-color: rgba(232,148,60,0.2);
}
[data-theme="light"] .sub-nav {
  background: rgba(0,0,0,0.02);
}
[data-theme="light"] .sub-nav-tab:hover {
  background: rgba(0,0,0,0.02);
}
[data-theme="light"] .sub-nav-count {
  background: rgba(0,0,0,0.06);
}
[data-theme="light"] .form-input {
  background: var(--bg-input);
  border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .form-input:focus {
  border-color: var(--warm-400);
}
[data-theme="light"] .nav-link:hover {
  background: rgba(0,0,0,0.04);
}
[data-theme="light"] .nav-section-label {
  color: var(--text-muted);
}

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

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

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

/* ---------- Page Background ---------- */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(232,148,60,0.07) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(92,184,165,0.04) 0%, transparent 50%),
    var(--bg-deep);
}

.page-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulseRecord {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(217,85,80,0.5); }
  50%      { opacity: 0.85; box-shadow: 0 0 0 18px rgba(217,85,80,0); }
}
@keyframes waveform {
  0%, 100% { height: 6px; }
  50%      { height: var(--bar-height, 30px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes progressBar {
  from { width: 0%; }
  to   { width: 100%; }
}

.animate-in     { animation: fadeInUp 0.6s ease-out both; }
.animate-in-1   { animation-delay: 0.1s; }
.animate-in-2   { animation-delay: 0.2s; }
.animate-in-3   { animation-delay: 0.3s; }
.animate-in-4   { animation-delay: 0.4s; }
.animate-in-5   { animation-delay: 0.5s; }
.animate-fade   { animation: fadeIn 0.5s ease both; }
.animate-scale  { animation: scaleIn 0.4s ease both; }

/* ---------- Layout ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
}

.sidebar-header {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.sidebar-logo:hover {
  opacity: 0.85;
}

/* Dark theme: show dark logo, hide light logo */
.sidebar-logo-light { display: none !important; }
.sidebar-logo-dark  { display: inline-block; }

/* Light theme: show light logo, hide dark logo */
[data-theme="light"] .sidebar-logo-light { display: inline-block !important; }
[data-theme="light"] .sidebar-logo-dark  { display: none !important; }

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--warm-400), var(--warm-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.logo-sub {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--warm-400);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(232,148,60,0.10);
  color: var(--warm-300);
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--warm-400);
  box-shadow: 0 0 8px rgba(232,148,60,0.3);
}

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.nav-icon-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.nav-link:hover .nav-icon-svg {
  transform: scale(1.08);
}

.nav-link.active .nav-icon-svg {
  stroke-width: 2;
}

.nav-section-label {
  padding: 16px 20px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-divider {
  margin: 8px 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.sidebar-action-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.sidebar-action-link:hover {
  color: var(--accent-red);
  background: rgba(240,96,96,0.06);
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-body);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.theme-toggle-btn:hover {
  border-color: var(--border-warm);
  color: var(--text-primary);
  background: rgba(232,148,60,0.06);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02);
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
}

.user-pill:hover {
  background: rgba(255,255,255,0.05);
  transform: translateX(2px);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--warm-500), var(--warm-700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--warm-100);
}

.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
}

.page-header {
  padding: 28px 40px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, transparent 100%);
}

.page-title {
  font-family: var(--font-body);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.page-body {
  padding: 28px 40px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover {
  border-color: rgba(232,148,60,0.12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15), var(--shadow-glow);
}

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

.card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--warm-400);
}

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--warm-400), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

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

.stat-value {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 24px;
  opacity: 0.3;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--warm-400), var(--warm-600));
  color: #fff;
  box-shadow: 0 4px 15px rgba(232,148,60,0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(232,148,60,0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-warm);
}

.btn-danger {
  background: rgba(217,85,80,0.12);
  color: var(--accent-red);
  border: 1px solid rgba(217,85,80,0.2);
}

.btn-success {
  background: rgba(92,184,165,0.12);
  color: var(--accent-green);
  border: 1px solid rgba(92,184,165,0.25);
}

.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-icon { width: 42px; height: 42px; padding: 0; border-radius: var(--radius-md); }
.btn-full { width: 100%; }

/* ---------- Form Elements ---------- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(232,148,60,0.1);
}

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

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.7;
}

.input-group {
  display: flex;
  gap: 12px;
}

.input-group > * { flex: 1; }

/* ---------- Selection chips ---------- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  border-color: var(--border-warm);
  color: var(--text-primary);
}

.chip.active, .chip.selected {
  border-color: var(--warm-400);
  background: rgba(232,148,60,0.12);
  color: var(--warm-300);
}

/* Style cards */
.style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.style-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  color: var(--text-secondary);
}

.style-card:hover {
  border-color: var(--border-warm);
  background: rgba(255,255,255,0.02);
}

.style-card.selected {
  border-color: var(--warm-400);
  background: rgba(232,148,60,0.08);
  color: var(--warm-300);
}

.style-icon { font-size: 22px; display: block; margin-bottom: 6px; }
.style-name { font-size: 14px; font-weight: 600; display: block; }
.style-desc { font-size: 11px; opacity: 0.6; margin-top: 2px; }

/* ---------- Record Button ---------- */
.record-container { text-align: center; padding: 40px 0; }

.record-btn {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid rgba(232,148,60,0.3);
  background: radial-gradient(circle at 40% 35%, rgba(232,148,60,0.2), rgba(232,148,60,0.05));
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 50px rgba(232,148,60,0.08);
  position: relative;
}

.record-btn:hover {
  transform: scale(1.06);
  border-color: rgba(232,148,60,0.6);
  box-shadow: 0 0 70px rgba(232,148,60,0.15);
}

.record-btn.recording {
  border-color: var(--accent-red);
  background: radial-gradient(circle at 40% 35%, rgba(217,85,80,0.25), rgba(217,85,80,0.08));
  animation: pulseRecord 2s ease-in-out infinite;
}

.record-btn .mic-icon {
  width: 36px;
  height: 36px;
  stroke: var(--warm-400);
  stroke-width: 1.5;
  fill: none;
  transition: stroke 0.2s;
}

.record-btn.recording .mic-icon { stroke: var(--accent-red); }

.record-btn .label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--warm-400);
}

.record-btn.recording .label { color: var(--accent-red); }

/* ---------- Waveform ---------- */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 60px;
  margin: 20px 0;
}

.waveform .bar {
  width: 4px;
  border-radius: 2px;
  background: var(--warm-400);
  animation: waveform 0.8s ease-in-out infinite;
}

.timer {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 3px;
}

/* ---------- Transcript Editor ---------- */
.transcript-box {
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
}

.transcript-box:focus-within {
  border-color: var(--border-focus);
}

.transcript-box textarea {
  width: 100%;
  min-height: 150px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  resize: vertical;
  outline: none;
}

.transcript-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- Quote Display ---------- */
.quote-display {
  background: linear-gradient(145deg, rgba(232,148,60,0.05), rgba(0,0,0,0.15));
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  font-size: 14px;
  line-height: 1.9;
  color: var(--warm-200);
  white-space: pre-wrap;
}

.quote-display::before {
  content: '"';
  position: absolute;
  top: 12px;
  left: 24px;
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  color: rgba(232,148,60,0.12);
}

/* ---------- Alerts / Flash Messages ---------- */
.flash-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(400px, calc(100vw - 40px));
}

.flash {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  animation: fadeInUp 0.3s ease both;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(20px);
}

.flash-success {
  background: rgba(92,184,165,0.15);
  border: 1px solid rgba(92,184,165,0.3);
  color: var(--accent-green);
}

.flash-error {
  background: rgba(217,85,80,0.15);
  border: 1px solid rgba(217,85,80,0.3);
  color: var(--accent-red);
}

.flash-info {
  background: rgba(91,155,213,0.15);
  border: 1px solid rgba(91,155,213,0.3);
  color: var(--accent-blue);
}

.flash-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.6;
}

/* ---------- Tables ---------- */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.data-table thead {
  background: rgba(255,255,255,0.02);
}

.data-table th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1.5px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 15px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: all 0.2s ease;
}

.data-table tbody tr {
  position: relative;
  transition: background 0.2s ease;
}

.data-table tbody tr:hover td {
  background: rgba(232,148,60,0.03);
  color: var(--text-primary);
}

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

/* Clickable table rows */
.data-table tbody tr[onclick],
.data-table tbody tr[data-href] {
  cursor: pointer;
}

/* Table status dot */
.data-table .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge::before {
  content:'';
  width:6px; height:6px;
  border-radius:50%;
  flex-shrink:0;
}

.badge-generated,
.badge-sent {
  background: rgba(92,184,165,0.12);
  color: var(--accent-green);
}
.badge-generated::before, .badge-sent::before { background: var(--accent-green); }

.badge-draft {
  background: rgba(212,168,83,0.12);
  color: var(--accent-gold);
}
.badge-draft::before { background: var(--accent-gold); }

.badge-paid,
.badge-accepted {
  background: rgba(92,184,165,0.15);
  color: #4dcea0;
  border: 1px solid rgba(92,184,165,0.2);
}
.badge-paid::before, .badge-accepted::before { background: #4dcea0; }

.badge-overdue,
.badge-expired {
  background: rgba(240,96,96,0.12);
  color: var(--accent-red);
}
.badge-overdue::before, .badge-expired::before { background: var(--accent-red); }

.badge-complete {
  background: rgba(96,165,250,0.12);
  color: var(--accent-blue);
}
.badge-complete::before { background: var(--accent-blue); }

.badge-pending {
  background: rgba(96,165,250,0.12);
  color: var(--accent-blue);
}
.badge-pending::before { background: var(--accent-blue); }

.badge-converted {
  background: rgba(232,148,60,0.12);
  color: var(--warm-300);
}
.badge-converted::before { background: var(--warm-300); }

/* ---------- Language Selector ---------- */
.lang-group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-group-title:first-child { margin-top: 0; }

/* ---------- Progress Steps ---------- */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 0 8px;
}

.step {
  flex: 1;
  text-align: center;
  position: relative;
}

.step-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  z-index: 1;
}

.step.active .step-dot {
  border-color: var(--warm-400);
  background: rgba(232,148,60,0.15);
  color: var(--warm-400);
  box-shadow: 0 0 0 4px rgba(232,148,60,0.08), 0 0 20px rgba(232,148,60,0.1);
}

.step.done .step-dot {
  border-color: var(--accent-green);
  background: rgba(92,184,165,0.15);
  color: var(--accent-green);
}

.step-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

.step.active .step-label { color: var(--warm-400); font-weight: 600; }
.step.done .step-label { color: var(--accent-green); }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border-subtle);
  margin: 0 -8px;
  margin-top: -20px;
  position: relative;
  z-index: 0;
  transition: background 0.3s;
}

.step-line.done {
  background: linear-gradient(90deg, var(--accent-green), rgba(92,184,165,0.4));
}

/* ---------- Spinner ---------- */
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--warm-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.loading-text {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ---------- Empty States ---------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 16px;
  display: block;
}

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

.empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text { height: 14px; margin-bottom: 10px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-heading { height: 24px; width: 45%; margin-bottom: 16px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 120px; border-radius: var(--radius-lg); }

/* ---------- Auth pages ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  animation: scaleIn 0.5s ease both;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-icon {
  width: 56px;
  height: 56px;
  font-size: 28px;
  margin: 0 auto 16px;
}

.auth-logo h1 {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--warm-400);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover { text-decoration: underline; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

/* ---------- SA Flag Bar (legacy) ---------- */
.sa-flag-bar {
  height: 4px;
  display: flex;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 24px;
}

.sa-flag-bar span {
  flex: 1;
}

/* ---------- Auth Logo Image ---------- */
.auth-logo-img {
  height: 64px;
  width: auto;
  margin: 0 auto 16px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(232,148,60,0.2));
}

/* ---------- Auth Background Animation ---------- */
.auth-bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  will-change: transform;
}

.auth-orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--warm-400), transparent 70%);
  top: -10%;
  left: -5%;
  animation: authOrbFloat1 20s ease-in-out infinite;
}

.auth-orb-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-green), transparent 70%);
  bottom: -5%;
  right: -5%;
  animation: authOrbFloat2 25s ease-in-out infinite;
}

.auth-orb-3 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--accent-blue), transparent 70%);
  top: 50%;
  left: 60%;
  animation: authOrbFloat3 18s ease-in-out infinite;
}

@keyframes authOrbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(60px, 40px) scale(1.1); }
  50%      { transform: translate(30px, 80px) scale(0.95); }
  75%      { transform: translate(-20px, 40px) scale(1.05); }
}

@keyframes authOrbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(-40px, -30px) scale(1.05); }
  50%      { transform: translate(-70px, -60px) scale(1.1); }
  75%      { transform: translate(-30px, -20px) scale(0.95); }
}

@keyframes authOrbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-50px, 30px) scale(1.1); }
  66%      { transform: translate(30px, -40px) scale(0.9); }
}

[data-theme="light"] .auth-page {
  background:
    radial-gradient(ellipse 80% 60% at 30% 0%, rgba(232,148,60,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 70% 100%, rgba(92,184,165,0.05) 0%, transparent 50%),
    #f7f0e8;
}
[data-theme="light"] .auth-orb {
  opacity: 0.06;
}
[data-theme="light"] .auth-card {
  background: #fffcf8;
  box-shadow: 0 8px 40px rgba(140,100,50,0.08);
}

/* Ensure auth card sits above the orbs */
.auth-page .auth-container {
  position: relative;
  z-index: 1;
}

/* ---------- Analytics charts ---------- */
.chart-bar-container {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding-top: 10px;
}

.chart-bar {
  flex: 1;
  min-width: 8px;
  background: linear-gradient(to top, var(--warm-600), var(--warm-400));
  border-radius: 3px 3px 0 0;
  transition: all 0.3s ease;
  position: relative;
}

.chart-bar:hover {
  background: linear-gradient(to top, var(--warm-500), var(--warm-300));
}

.chart-bar:hover::after {
  content: attr(data-value);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-warm);
  border-radius: 6px;
  font-size: 10px;
  color: var(--warm-300);
  font-family: var(--font-mono);
  white-space: nowrap;
  margin-bottom: 4px;
}

.donut-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
}

.donut-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.donut-label { flex: 1; color: var(--text-secondary); }
.donut-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
}

/* ---------- Sub-navigation Tabs ---------- */
.sub-nav {
  display: flex;
  gap: 2px;
  padding: 0 40px;
  background: rgba(0,0,0,0.08);
  border-bottom: 1px solid var(--border-subtle);
}
.sub-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  margin-bottom: -1px;
  position: relative;
}
.sub-nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.02);
}
.sub-nav-tab.active {
  color: var(--warm-300);
  border-bottom-color: var(--warm-400);
  font-weight: 600;
}
.sub-nav-tab svg {
  opacity: 0.5;
  transition: opacity 0.2s;
}
.sub-nav-tab:hover svg,
.sub-nav-tab.active svg {
  opacity: 1;
}
/* Tab count badge */
.sub-nav-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.sub-nav-tab.active .sub-nav-count {
  background: rgba(232,148,60,0.15);
  color: var(--warm-400);
}
@media (max-width: 768px) {
  .sub-nav {
    padding: 0 16px;
  }
  .sub-nav-tab {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* ---------- Floating Sign-out ---------- */
.floating-signout {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 90;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.4;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.floating-signout:hover {
  opacity: 1;
  color: var(--accent-red);
  border-color: rgba(240,96,96,0.3);
  background: rgba(240,96,96,0.06);
  transform: scale(1.08);
}

/* ---------- Responsive ---------- */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, box-shadow 0.2s;
}

.mobile-toggle:hover {
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

/* Sidebar overlay on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

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

@media (max-width: 768px) {
  .mobile-toggle { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-header { padding: 20px 20px 18px; padding-top: 68px; }
  .page-title { font-size: 22px; }
  .page-body { padding: 20px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .style-grid { grid-template-columns: 1fr; }
  .input-group { flex-direction: column; }
  .card { padding: 18px; }
  .card-header { margin-bottom: 14px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; gap: 10px; }
  .page-header { padding: 16px 16px 14px; padding-top: 64px; }
  .page-title { font-size: 20px; }
  .page-body { padding: 16px; }
  .btn-lg { padding: 14px 24px; font-size: 14px; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* =========================================================
   WhatsApp OTP Login Styles
   ========================================================= */

/* Phone input with +27 prefix */
.phone-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-dark, #1a1511);
  border: 1.5px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.phone-input-wrap:focus-within {
  border-color: var(--accent, #e8943c);
}
.phone-prefix {
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted, #8a7d72);
  white-space: nowrap;
  user-select: none;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.phone-input {
  border: none !important;
  border-radius: 0 !important;
  font-size: 18px !important;
  letter-spacing: 1.5px;
  font-weight: 500;
}
.phone-input:focus {
  box-shadow: none !important;
}
.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted, #8a7d72);
}

/* OTP digit inputs */
.otp-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.25);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text-light, #e8ddd3);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.otp-digit:focus {
  border-color: var(--accent, #e8943c);
  background: rgba(232,148,60,0.08);
}
.otp-sep {
  color: var(--text-muted, #8a7d72);
  font-size: 18px;
  user-select: none;
}

/* OTP sent badge with WhatsApp icon */
.otp-sent-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(37,211,102,0.08);
  border: 1px solid rgba(37,211,102,0.2);
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-mid, #a89888);
}
.wa-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(37,211,102,0.12);
  border-radius: 50%;
  flex-shrink: 0;
}

/* OTP action buttons */
.otp-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent, #e8943c);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
}
.btn-link:hover {
  text-decoration: underline;
}
.btn-link:disabled {
  color: var(--text-muted, #8a7d72);
  cursor: not-allowed;
  text-decoration: none;
}

/* Dev mode notice */
.dev-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255,180,0,0.12);
  border: 2px solid rgba(255,180,0,0.35);
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-light, #e8e0d8);
}
.dev-notice code {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--accent, #e8943c);
  display: inline-block;
  padding: 6px 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}

/* Auth error */
.auth-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  margin-top: 16px;
  background: rgba(222,56,49,0.08);
  border: 1px solid rgba(222,56,49,0.2);
  border-radius: 10px;
  font-size: 13px;
  color: #e8a08a;
  animation: fadeInUp 0.3s ease;
}

/* Button loader spinner */
.btn-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Quote / Invoice Builder
   ========================================================= */

.quote-builder {
  max-width: 1100px;
}

.builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.builder-grid > div {
  display: flex;
  flex-direction: column;
}
.builder-grid > div > .card {
  flex: 1;
  display: flex;
  flex-direction: column;
}
@media (max-width: 768px) {
  .builder-grid { grid-template-columns: 1fr; }
}

.builder-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Line items table */
.line-items-table {
  margin-top: 8px;
}
.li-header {
  display: grid;
  grid-template-columns: 60px 70px 1fr 110px 110px 36px;
  gap: 6px;
  padding: 8px 6px;
  background: var(--bg-dark, #1a1511);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #8a7d72);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.li-row {
  display: grid;
  grid-template-columns: 60px 70px 1fr 110px 110px 36px;
  gap: 6px;
  padding: 6px;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.15s;
}
.li-row:hover {
  background: rgba(232,148,60,0.04);
}
.li-row .form-input {
  padding: 8px 10px;
  font-size: 13px;
}
.li-qty { text-align: center; }
.li-total {
  text-align: right;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-light, #e8ddd3);
  font-family: var(--font-body);
  padding-right: 4px;
}
/* Currency prefix on unit price input */
.li-rate-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.li-rate-currency {
  position: absolute;
  left: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #6b6058);
  pointer-events: none;
  z-index: 1;
}
.li-rate-wrap .li-rate {
  padding-left: 24px;
}
.li-del {
  background: none;
  border: none;
  color: var(--text-muted, #8a7d72);
  font-size: 18px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}
.li-del:hover {
  background: rgba(222,56,49,0.1);
  color: #e8a08a;
}

.li-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
}

/* Totals */
.totals-section {
  margin-top: 20px;
  margin-left: auto;
  max-width: 300px;
}
.totals-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-mid, #a89888);
}
.totals-row span:last-child {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-light, #e8ddd3);
}
.total-grand {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 2px solid var(--accent, #e8943c);
  font-size: 16px;
}
.total-grand span:last-child {
  font-size: 18px;
  color: var(--accent, #e8943c);
}

/* Toggle row */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-mid, #a89888);
  cursor: pointer;
}
.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent, #e8943c);
}

/* Builder actions */
.builder-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* Button sizes */
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}
.btn-accent {
  background: var(--accent, #e8943c);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}
.btn-accent:hover {
  opacity: 0.85;
}
.btn-success {
  background: rgba(92,184,165,0.15);
  color: var(--accent-green);
  border: 1px solid rgba(92,184,165,0.25);
}

/* Preview modal */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 24px;
}
.modal-content {
  background: var(--bg-card, #231e18);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.06);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-light, #e8ddd3);
}
.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
}
.modal-body {
  padding: 24px;
}

.preview-quote {
  font-size: 13px;
  color: var(--text-mid, #a89888);
  line-height: 1.6;
}
.preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 12px;
}
.preview-table th {
  background: var(--bg-dark, #1a1511);
  padding: 8px 10px;
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.preview-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.preview-table tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}

@media (max-width: 768px) {
  .li-header, .li-row {
    grid-template-columns: 50px 1fr 80px 36px;
  }
  .li-col-unit, .li-row select.li-unit,
  .li-col-total, .li-row .li-total { display: none; }
  .li-row .form-input {
    padding: 8px 6px;
    font-size: 13px;
  }
}

/* =========================================================
   Payment Method Rows
   ========================================================= */
.pm-row {
  position: relative;
  padding: 12px 36px 12px 12px;
  margin-bottom: 10px;
  background: rgba(0,0,0,0.12);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.04);
}
.pm-fields { margin-top: 6px; }
.auth-divider {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #e8943c);
  margin: 20px 0 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* =========================================================
   Pricing Grid
   ========================================================= */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 560px) { .pricing-grid { grid-template-columns: 1fr; } }

.pricing-card {
  position: relative;
  background: var(--bg-card, #231e18);
  border: 1.5px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.pricing-card:hover {
  border-color: rgba(232,148,60,0.25);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.2), 0 0 0 1px rgba(232,148,60,0.1);
}
.pricing-card.active {
  border-color: var(--warm-400, #e8943c);
  box-shadow: 0 0 0 1px var(--warm-400, #e8943c), 0 8px 32px rgba(232,148,60,0.15);
}
.pricing-card.popular {
  background: linear-gradient(180deg, rgba(232,148,60,0.06) 0%, var(--bg-card) 40%);
  border-color: rgba(232,148,60,0.2);
}
.popular-badge, .current-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.popular-badge {
  background: linear-gradient(135deg, var(--warm-400, #e8943c), var(--warm-600, #b5621e));
  color: #fff;
  box-shadow: 0 4px 12px rgba(232,148,60,0.3);
}
.current-badge {
  background: rgba(92,184,165,0.15);
  color: #5cb89a;
  border: 1px solid rgba(92,184,165,0.25);
}
.plan-header { text-align: center; margin-bottom: 22px; }
.plan-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary, #e8ddd3);
  margin-bottom: 10px;
  letter-spacing: -0.2px;
}
.plan-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}
.price-currency {
  font-size: 18px;
  color: var(--warm-400);
  font-weight: 600;
}
.price-amount {
  font-size: 38px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -1px;
}
.price-period {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 2px;
}
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  flex: 1;
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--text-secondary, #a89888);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: color 0.2s;
}
.plan-features li:last-child {
  border-bottom: none;
}
.pricing-card:hover .plan-features li {
  color: var(--text-primary);
}
.feature-check {
  color: var(--accent-green, #5cb89a);
  font-weight: 700;
  font-size: 14px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(92,184,165,0.08);
}

/* =========================================================
   Quota Bar (sidebar)
   ========================================================= */
.quota-bar {
  padding: 12px 16px;
  margin: 8px 10px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.quota-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted, #8a7d72);
  margin-bottom: 6px;
}
.quota-track {
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 5px;
  overflow: hidden;
}
.quota-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--warm-400), var(--warm-300));
  border-radius: 5px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px rgba(232,148,60,0.3);
}
.plan-badge {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(232,148,60,0.12);
  color: var(--accent, #e8943c);
  margin-left: auto;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =========================================================
   Insights Strip (used across quotes, invoices, catalogue pages)
   ========================================================= */
.insights-strip {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.insight-card {
  flex: 1;
  min-width: 120px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.insight-card:hover {
  border-color: rgba(232,148,60,0.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.insight-card.primary {
  border-color: rgba(92,184,165,0.2);
  background: rgba(92,184,165,0.04);
}
.insight-card.insight-alert {
  border-color: rgba(240,96,96,0.2);
}
.insight-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.insight-data {
  display: flex;
  flex-direction: column;
}
.insight-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.2;
}
.insight-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-top: 2px;
}
.insight-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 99px;
}
@media (max-width: 768px) {
  .insights-strip { gap: 8px; }
  .insight-card { min-width: 90px; padding: 14px 14px; }
  .insight-value { font-size: 18px; }
}
@media (max-width: 480px) {
  .insight-card { min-width: 70px; padding: 10px; flex-direction: column; text-align: center; gap: 6px; }
  .insight-value { font-size: 16px; }
  .insight-label { font-size: 8px; }
}

/* =========================================================
   Ad Cards ("Please Call Me" style)
   ========================================================= */
.ad-banner {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(232,148,60,0.06) 0%, rgba(0,0,0,0.1) 100%);
  border: 1px solid rgba(232,148,60,0.15);
  border-radius: 12px;
}
.ad-banner-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted, #8a7d72);
  margin-bottom: 8px;
}
.ad-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: background 0.15s;
  cursor: pointer;
  text-decoration: none;
}
.ad-card:hover {
  background: rgba(232,148,60,0.08);
}
.ad-card:last-child { margin-bottom: 0; }
.ad-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(37,211,102,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.ad-content { flex: 1; }
.ad-headline {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light, #e8ddd3);
}
.ad-body {
  font-size: 11px;
  color: var(--text-muted, #8a7d72);
  margin-top: 2px;
}
.ad-cta {
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(37,211,102,0.15);
  color: #5cb89a;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(37,211,102,0.2);
}

/* =========================================================
   Payment Links on Quote View
   ========================================================= */
.payment-methods-section {
  margin-top: 20px;
  padding: 16px;
  background: rgba(0,119,73,0.04);
  border: 1px solid rgba(0,119,73,0.12);
  border-radius: 12px;
}
.payment-methods-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 10px;
}
.pay-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin: 4px 4px 4px 0;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-mid);
  text-decoration: none;
  transition: all 0.15s;
}
.pay-link:hover {
  background: rgba(232,148,60,0.1);
  border-color: rgba(232,148,60,0.2);
  color: var(--accent);
}

/* =========================================================
   Named Grid Classes
   ========================================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
.catalogue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Catalogue category groups */
.cat-group-header {
  user-select: none;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px !important;
  transition: background 0.15s;
  border-radius: var(--radius-sm);
  margin: -4px -8px 0;
  padding: 8px !important;
}
.cat-group-header:hover {
  background: var(--bg-elevated);
}
.cat-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.cat-group-body {
  margin-top: 8px;
}
.cat-subgroup {
  margin-top: 4px;
}
.cat-subgroup-header {
  user-select: none;
  transition: background 0.15s;
  border-radius: var(--radius-sm);
}
.cat-subgroup-header:hover {
  background: rgba(232,148,60,0.04);
}
.cat-sub-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.record-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

/* =========================================================
   Enhanced Mobile Responsive
   ========================================================= */

/* Sidebar overlay backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-backdrop.active {
  display: block;
}

@media (max-width: 768px) {
  .dashboard-grid,
  .catalogue-grid,
  .record-layout {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: 22px;
  }
  .page-subtitle {
    font-size: 13px;
  }
  .card {
    padding: 20px;
    border-radius: var(--radius-md);
  }
  .data-table th,
  .data-table td {
    padding: 10px 8px;
    font-size: 12px;
  }
  .page-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .page-header .btn {
    align-self: flex-start;
  }
  /* Builder grid stacks */
  .builder-row {
    grid-template-columns: 1fr;
  }
  /* Steps (progress bar) */
  .steps {
    margin-bottom: 20px;
  }
  .step-dot {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  .step-label {
    font-size: 9px;
  }
  /* Floating sign-out adjustments */
  .floating-signout {
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
  }
  /* Profile layout */
  .profile-layout {
    grid-template-columns: 1fr;
  }
  /* Settings form grids */
  .pm-method-body .builder-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 16px 12px;
  }
  .stat-value {
    font-size: 22px;
  }
  .stat-label {
    font-size: 10px;
  }
  .btn {
    min-height: 44px;
    font-size: 13px;
  }
  .btn-sm {
    min-height: 34px;
  }
  .form-input, select.form-input {
    font-size: 16px; /* prevent iOS zoom */
    padding: 14px;
  }
  .page-body {
    padding: 12px;
  }
  .card {
    padding: 16px;
  }
  .card-header {
    margin-bottom: 12px;
  }
  .catalogue-grid,
  .dashboard-grid,
  .record-layout {
    gap: 16px;
  }
  .page-header {
    padding: 20px 12px 16px;
    padding-top: 64px;
  }
  /* Sub-nav full-width on mobile */
  .sub-nav {
    padding: 0 12px;
  }
  .sub-nav-tab {
    flex: 1;
    justify-content: center;
    padding: 8px 8px;
    font-size: 12px;
  }
  /* Make modals full width on small screens */
  #stockModal > div,
  #editModal > div,
  #custDetailModal > div {
    width: 96%;
    max-width: none;
    padding: 20px;
  }
  /* Pricing grid single column */
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  /* Table horizontal scroll */
  .data-table {
    font-size: 11px;
  }
  .data-table th,
  .data-table td {
    padding: 8px 6px;
    font-size: 11px;
  }
  /* Timer and record button sizing */
  .timer {
    font-size: 24px;
  }
  .record-btn {
    width: 110px;
    height: 110px;
  }
  .record-btn .mic-icon {
    width: 28px;
    height: 28px;
  }
  .record-btn .label {
    font-size: 9px;
  }
  /* Line items: tighter on small phones */
  .li-header, .li-row {
    grid-template-columns: 44px 1fr 70px 36px;
    gap: 4px;
  }
  .li-row .form-input {
    padding: 8px 4px;
    font-size: 14px; /* 16px causes iOS zoom, 14px is OK since we set it on .form-input already */
  }
  .li-header {
    font-size: 10px;
    padding: 6px 4px;
  }
  /* Card title and labels bigger for readability */
  .card-title {
    font-size: 12px;
  }
  .form-label {
    font-size: 12px;
  }
  /* Totals section tighter */
  .totals-section {
    padding: 12px 0;
  }
  .totals-row {
    font-size: 13px;
  }
  /* Builder row stacks on mobile */
  .builder-row {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }
  /* Voice builder actions */
  .li-actions {
    flex-wrap: wrap;
  }
  /* Floating sign-out smaller on phones */
  .floating-signout {
    width: 30px;
    height: 30px;
  }
  /* Steps smaller */
  .step-line {
    width: 20px;
  }
}

/* =========================================================
   Ultra-narrow phones (320-380px)
   ========================================================= */
@media (max-width: 380px) {
  .page-body {
    padding: 8px;
  }
  .card {
    padding: 12px;
    border-radius: 10px;
  }
  .page-header {
    padding: 16px 8px 12px;
    padding-top: 60px;
  }
  .page-title {
    font-size: 20px;
  }
  /* Line items: minimal on tiny phones */
  .li-header, .li-row {
    grid-template-columns: 38px 1fr 60px 32px;
    gap: 3px;
  }
  .li-del {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 16px;
  }
  .li-row .form-input {
    padding: 6px 3px;
    font-size: 14px;
  }
  .li-header {
    font-size: 9px;
    padding: 5px 3px;
  }
  .btn-lg {
    padding: 12px 16px;
    font-size: 14px;
  }
  .sub-nav-tab {
    padding: 6px 4px;
    font-size: 11px;
  }
  .sub-nav-tab svg {
    display: none;
  }
  /* Steps even smaller */
  .step-dot {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
  .step-label {
    font-size: 8px;
  }
  .step-line {
    width: 14px;
  }
}

/* =========================================================
   Global Utility Classes
   ========================================================= */

/* Text utilities */
.text-amber { color: var(--warm-400); }
.text-green { color: var(--accent-green); }
.text-red   { color: var(--accent-red); }
.text-blue  { color: var(--accent-blue); }
.text-gold  { color: var(--accent-gold); }
.text-muted { color: var(--text-muted); }
.text-mono  { font-family: var(--font-mono); }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 10px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Flex utilities */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm  { gap: 6px; }
.gap-md  { gap: 12px; }
.gap-lg  { gap: 20px; }

/* Spacing utilities */
.mt-0 { margin-top: 0; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 28px; }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 28px; }

/* Visibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* Truncate */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 20px 0;
}

/* Tooltip */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 12px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  z-index: 50;
  border: 1px solid var(--border-subtle);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Focus ring for accessibility */
:focus-visible {
  outline: 2px solid var(--warm-400);
  outline-offset: 2px;
}

/* Smooth scroll globally */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .sidebar,
  .mobile-toggle,
  .page-bg,
  .btn,
  .sidebar-overlay,
  .sidebar-backdrop {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
  }
  .page-body {
    padding: 0 !important;
  }
  .card {
    border: 1px solid #ddd;
    box-shadow: none;
    break-inside: avoid;
  }
  body {
    background: #fff;
    color: #000;
  }
}
