/* ==============================================================================
   KACHRASAIT ENTERPRISE WEB ADMIN PANEL - DESIGN SYSTEM
   Theme: Eco-Tech Dark Emerald, Vibrant Leaf Green & Crisp Mint Surfaces
   Typography: Plus Jakarta Sans
   ============================================================================== */

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

:root {
  /* Brand Primary Colors (Matches Android App Color.kt) */
  --primary: #16A34A;            /* Signature Vibrant Leaf Green */
  --primary-hover: #15803D;      /* Deep Leaf Hover */
  --primary-dark: #0F5132;       /* Brand Emerald */
  --primary-forest: #0A382C;     /* Deep Eco Forest Green */
  --primary-ultra-dark: #06241C; /* Ultra Deep Sidebar Green */
  --primary-glow: #22C55E;       /* High-visibility Eco Neon */
  --primary-light: #DCFCE7;      /* Soft Mint Chip Background */
  --primary-mint-surface: #F0FDF4;/* Ultra Soft Mint Surface */
  
  /* Accent Colors */
  --accent-gold: #F59E0B;        /* Scrap Gold Accent */
  --accent-gold-light: #FEF3C7;  /* Gold Pill Bg */
  --accent-blue: #0284C7;        /* Info / B2B Blue */
  --accent-blue-light: #E0F2FE;
  --accent-purple: #8B5CF6;      /* AI Screening / Machinery */
  --accent-purple-light: #EDE9FE;
  
  /* Status Colors */
  --status-success: #10B981;
  --status-success-bg: #ECFDF5;
  --status-warning: #F59E0B;
  --status-warning-bg: #FFFBEB;
  --status-danger: #EF4444;
  --status-danger-bg: #FEF2F2;
  --status-info: #0284C7;
  --status-info-bg: #F0F9FF;

  /* Surfaces & Backgrounds */
  --bg-page: #F6F8F6;            /* Clean Eco Page Background */
  --bg-surface: #FFFFFF;         /* Crisp White Card */
  --bg-surface-secondary: #F8FAFC;
  --bg-sidebar: #082016;         /* Deep Forest Night */
  --border-color: #E2E8F0;       /* Crisp Border */
  --border-green: #BBF7D0;       /* Mint Border */
  --border-focus: #16A34A;
  
  /* Text Colors */
  --text-primary: #0F172A;       /* Deep Slate Charcoal */
  --text-secondary: #64748B;     /* Muted Slate */
  --text-muted: #94A3B8;         /* Subtle Hint */
  --text-white: #FFFFFF;
  --text-sidebar: #9CA3AF;
  --text-sidebar-active: #FFFFFF;

  /* Layout & Elevations */
  --sidebar-width: 270px;
  --sidebar-collapsed-width: 78px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.1), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 20px rgba(34, 197, 94, 0.25);
  
  /* Transition */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Box Sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

button, input, select, textarea {
  font-family: inherit;
}

/* App Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  position: relative;
}

/* ==============================================================================
   SIDEBAR COMPONENT
   ============================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #062319 0%, #082016 45%, #051811 100%);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: width var(--transition-smooth), transform var(--transition-smooth);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

.sidebar-header {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: #0D472B;
  border: 1.5px solid rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-name .badge-pro {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.brand-tagline {
  font-size: 0.72rem;
  color: #86EFAC;
  font-weight: 500;
}

.sidebar-collapse-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9CA3AF;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFF;
}

/* Sidebar Navigation Items */
.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6EE7B7;
  opacity: 0.7;
  padding: 12px 14px 6px 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #CBD5E1;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  user-select: none;
}

.nav-item-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  color: #86EFAC;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.nav-item:hover .nav-icon {
  transform: scale(1.1);
  color: var(--primary-glow);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.3) 0%, rgba(34, 197, 94, 0.12) 100%);
  color: #FFFFFF;
  font-weight: 700;
  border: 1px solid rgba(74, 222, 128, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-item.active .nav-icon {
  color: #4ADE80;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: #22C55E;
  box-shadow: 0 0 8px #22C55E;
}

.nav-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.nav-badge.gold {
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
  border-color: rgba(245, 158, 11, 0.4);
}

.nav-badge.green {
  background: rgba(34, 197, 94, 0.2);
  color: #86EFAC;
  border-color: rgba(34, 197, 94, 0.4);
}

/* Sidebar Footer / Current Admin Card */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.admin-card-mini {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #14532D;
  border: 2px solid #22C55E;
  object-fit: cover;
  padding: 2px;
}

.admin-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFF;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.admin-role {
  font-size: 0.72rem;
  color: #86EFAC;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot-live {
  width: 6px;
  height: 6px;
  background: #22C55E;
  border-radius: 50%;
  box-shadow: 0 0 6px #22C55E;
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* ==============================================================================
   MAIN WORKSPACE & HEADER
   ============================================================================== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100vw - var(--sidebar-width));
  transition: margin-left var(--transition-smooth), width var(--transition-smooth);
}

.main-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

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

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-primary);
}

.search-container {
  position: relative;
  width: 320px;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface-secondary);
  font-size: 0.88rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  background: #FFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.search-icon-pos {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-shortcut-key {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #E2E8F0;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

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

.hub-status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-mint-surface);
  border: 1px solid var(--border-green);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.action-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #FFF;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.action-icon-btn:hover {
  background: var(--bg-surface-secondary);
  color: var(--text-primary);
  border-color: #CBD5E1;
}

.action-icon-btn .badge-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #EF4444;
  color: #FFF;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFF;
}

.btn-primary-quick {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #FFF;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
  transition: all var(--transition-fast);
}

.btn-primary-quick:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.35);
}

/* ==============================================================================
   PAGE BODY & TAB SECTIONS
   ============================================================================== */
.main-content {
  padding: 28px;
  flex: 1;
}

.page-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page-section.active {
  display: block;
}

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

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title-group h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}

.page-title-group p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.page-actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==============================================================================
   DASHBOARD STAT CARDS & BENTO GRID
   ============================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  opacity: 0.8;
}

.stat-card.gold::after { background: var(--accent-gold); }
.stat-card.blue::after { background: var(--accent-blue); }
.stat-card.purple::after { background: var(--accent-purple); }

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-mint-surface);
  color: var(--primary);
}

.stat-icon-wrap.gold { background: var(--accent-gold-light); color: var(--accent-gold); }
.stat-icon-wrap.blue { background: var(--accent-blue-light); color: var(--accent-blue); }
.stat-icon-wrap.purple { background: var(--accent-purple-light); color: var(--accent-purple); }

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.stat-subtext {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.trend-pill.up { background: #DCFCE7; color: #15803D; }
.trend-pill.down { background: #FEE2E2; color: #B91C1C; }

/* Bento Charts & Visuals Grid */
.bento-grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.bento-grid-1-1 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

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

.card-header-clean h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-actions-clean {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==============================================================================
   TABLES & DATA LISTS
   ============================================================================== */
.table-wrapper {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.table-filter-bar {
  padding: 16px 20px;
  background: #FFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-pills-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: #CBD5E1;
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFF;
}

.table-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  width: 240px;
}

.table-search-box input {
  border: none;
  background: transparent;
  font-size: 0.82rem;
  outline: none;
  width: 100%;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.custom-table th {
  background: #F8FAFC;
  color: #475569;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #F1F5F9;
  color: var(--text-primary);
  vertical-align: middle;
}

.custom-table tbody tr:hover {
  background: #F8FAF8;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-status.scheduled { background: #E0F2FE; color: #0369A1; }
.badge-status.weighing { background: #FEF3C7; color: #B45309; }
.badge-status.completed { background: #DCFCE7; color: #15803D; }
.badge-status.cancelled { background: #FEE2E2; color: #B91C1C; }
.badge-status.flagged { background: #FEE2E2; color: #DC2626; }
.badge-status.approved { background: #DCFCE7; color: #15803D; }
.badge-status.pending { background: #FEF3C7; color: #D97706; }
.badge-status.verified { background: #DCFCE7; color: #047857; }

/* Item Thumbnails in Tables */
.table-item-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-thumb {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #F1F5F9;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.table-item-text {
  display: flex;
  flex-direction: column;
}

.table-item-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.table-item-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* Action Icon Buttons inside Tables */
.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon-subtle {
  background: transparent;
  border: 1px solid transparent;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-subtle:hover {
  background: var(--bg-surface-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-icon-subtle.view:hover { color: var(--primary); background: var(--primary-light); }
.btn-icon-subtle.edit:hover { color: var(--accent-blue); background: var(--accent-blue-light); }
.btn-icon-subtle.delete:hover { color: var(--status-danger); background: var(--status-danger-bg); }

/* ==============================================================================
   BRANDING MANAGEMENT & LIVE PHONE PREVIEW
   ============================================================================== */
.branding-workbench-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 28px;
  align-items: start;
}

.branding-settings-card {
  background: #FFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.branding-section-group {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #F1F5F9;
}

.branding-section-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.group-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-palette-pickers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.color-picker-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F8FAFC;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.color-preview-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #FFF;
  box-shadow: 0 0 4px rgba(0,0,0,0.15);
  cursor: pointer;
  flex-shrink: 0;
}

.color-info-text {
  display: flex;
  flex-direction: column;
}

.color-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.color-hex {
  font-size: 0.74rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
}

/* Mobile App Mockup Preview Device */
.phone-mockup-wrapper {
  background: #0E1726;
  border-radius: 40px;
  padding: 14px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  width: 340px;
  margin: 0 auto;
  position: sticky;
  top: 100px;
}

.phone-screen {
  background: #F8FAF8;
  border-radius: 30px;
  overflow: hidden;
  height: 640px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.phone-notch-bar {
  height: 28px;
  background: #062319;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: #FFF;
  font-size: 0.65rem;
  font-weight: 600;
}

.phone-dynamic-view {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

/* Preview Tabs (Splash / Home / Onboarding / Rates) */
.preview-switch-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.preview-pill-btn {
  background: #E2E8F0;
  border: none;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 14px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.preview-pill-btn.active {
  background: var(--primary);
  color: #FFF;
}

/* Live Splash View in Phone */
.mockup-splash-view {
  height: 100%;
  background: linear-gradient(180deg, #073B22 0%, #0F5132 50%, #16A34A 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #FFF;
  padding: 24px;
  text-align: center;
  position: relative;
}

.splash-logo-circle {
  width: 90px;
  height: 90px;
  border-radius: 24px;
  background: #0D472B;
  border: 3px solid rgba(34, 197, 94, 0.6);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  overflow: hidden;
}

.splash-logo-circle img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.splash-app-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.splash-app-tagline {
  font-size: 0.75rem;
  color: #86EFAC;
  margin-top: 6px;
  max-width: 220px;
}

/* Live Home View in Phone */
.mockup-home-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #F8FAF8;
}

.mockup-header-gradient {
  background: linear-gradient(135deg, #073B22 0%, #16A34A 100%);
  color: #FFF;
  padding: 16px 14px;
  border-radius: 0 0 20px 20px;
}

.mockup-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mockup-location-pill {
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mockup-hero-card {
  background: #FFF;
  margin: -10px 14px 12px 14px;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border: 1px solid #DCFCE7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mockup-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 14px 14px 14px;
}

.mockup-cat-item {
  background: #FFF;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  padding: 8px 4px;
  text-align: center;
  font-size: 0.6rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mockup-cat-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* ==============================================================================
   FORM CONTROLS & INPUTS
   ============================================================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #FFF;
  font-size: 0.88rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.form-hint {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Toggle Switches */
.switch-control {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.switch-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: #CBD5E1;
  border-radius: 20px;
  transition: background var(--transition-fast);
}

.switch-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #FFF;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.switch-control input[type="checkbox"] {
  display: none;
}

.switch-control input[type="checkbox"]:checked + .switch-toggle {
  background: var(--primary);
}

.switch-control input[type="checkbox"]:checked + .switch-toggle::after {
  transform: translateX(20px);
}

/* ==============================================================================
   MODALS & DIALOGS
   ============================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #FFF;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.98);
  transition: transform var(--transition-normal);
  overflow: hidden;
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #F8FAFC;
}

/* ==============================================================================
   TOAST NOTIFICATION COMPONENT
   ============================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  background: #0F172A;
  color: #FFF;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s, transform 0.3s;
}

.toast.success { border-left-color: var(--status-success); }
.toast.warning { border-left-color: var(--status-warning); }
.toast.danger { border-left-color: var(--status-danger); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==============================================================================
   RESPONSIVENESS
   ============================================================================== */
@media (max-width: 1024px) {
  .bento-grid-2-1 {
    grid-template-columns: 1fr;
  }
  .branding-workbench-grid {
    grid-template-columns: 1fr;
  }
  .phone-mockup-wrapper {
    position: relative;
    top: 0;
    margin-top: 24px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
    width: 100vw;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .search-container {
    display: none;
  }
  .bento-grid-1-1 {
    grid-template-columns: 1fr;
  }
  .custom-table {
    display: block;
    overflow-x: auto;
  }
}
