/* ==========================================================================
   PO MOTOR BEKAS PT - MODERN PREMIUM STYLESHEET
   Aesthetics: Sleek Automotive Dark Mode, Emerald/Neon Accents, Glassmorphism
   ========================================================================== */

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

:root {
  /* Colors */
  --bg-main: #0a0e17;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(24, 33, 53, 0.95);
  --bg-card-solid: #111827;
  --bg-input: #1a2234;
  --bg-glass: rgba(17, 24, 39, 0.7);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(16, 185, 129, 0.6);
  --border-glow: rgba(16, 185, 129, 0.3);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Brand Accents */
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-light: rgba(16, 185, 129, 0.15);
  --primary-glow: 0 0 25px rgba(16, 185, 129, 0.35);

  --accent-blue: #3b82f6;
  --accent-blue-light: rgba(59, 130, 246, 0.15);

  --status-lunas: #10b981;
  --status-lunas-bg: rgba(16, 185, 129, 0.18);
  --status-dp: #f59e0b;
  --status-dp-bg: rgba(245, 158, 11, 0.18);
  --status-unpaid: #ef4444;
  --status-unpaid-bg: rgba(239, 68, 68, 0.18);

  /* Elevation & Blur */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(59, 130, 246, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Container */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography Utilities */
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-weight: 700;
}

.mono {
  font-family: var(--font-mono);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 0;
  transition: all var(--transition-normal);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.05));
  border: 1px solid var(--border-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Status Indicator Dot */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sync-indicator:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 8px var(--primary);
  animation: pulse 2s infinite;
}

.sync-dot.offline {
  background-color: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.sync-dot.error {
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-family: var(--font-body);
  user-select: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.btn-outline-wa {
  background: rgba(37, 211, 102, 0.1);
  color: #25d366;
  border: 1px solid rgba(37, 211, 102, 0.3);
}

.btn-outline-wa:hover {
  background: #25d366;
  color: #0b141a;
  box-shadow: 0 0 15px rgba(37, 211, 102, 0.4);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.75rem 1.6rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-icon-only {
  padding: 0.55rem;
  width: 38px;
  height: 38px;
}

/* Hero Section */
.hero-section {
  padding: 2rem 0 1.5rem;
}

.hero-banner {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.9) 0%, rgba(13, 20, 36, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 65%);
  pointer-events: none;
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hero-title-area h2 {
  font-size: 1.85rem;
  line-height: 1.2;
  margin-bottom: 0.35rem;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title-area p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.target-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

/* Progress Big Bar */
.progress-container {
  margin-bottom: 1.75rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.6rem;
}

.progress-labels {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.current-units {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.target-units {
  font-size: 1.2rem;
  color: var(--text-muted);
  font-weight: 600;
}

.progress-pct-badge {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.progress-track {
  width: 100%;
  height: 18px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669 0%, #10b981 60%, #34d399 100%);
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sisa-highlight {
  color: #f59e0b;
  font-weight: 700;
}

/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-fast);
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.stat-icon.amber {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.stat-icon.blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.stat-icon.purple {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

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

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

/* Payment Status Summary Pills */
.payment-summary-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.payment-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.payment-pill.lunas {
  background: var(--status-lunas-bg);
  color: var(--status-lunas);
  border-color: rgba(16, 185, 129, 0.3);
}

.payment-pill.dp {
  background: var(--status-dp-bg);
  color: var(--status-dp);
  border-color: rgba(245, 158, 11, 0.3);
}

.payment-pill.unpaid {
  background: var(--status-unpaid-bg);
  color: var(--status-unpaid);
  border-color: rgba(239, 68, 68, 0.3);
}

.payment-pill.active {
  box-shadow: 0 0 12px currentColor;
  transform: scale(1.03);
}

.payment-pill .badge-count {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

/* Ketentuan PO Card (Rules Card) */
.rules-section {
  margin-bottom: 2rem;
}

.rules-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  position: relative;
  backdrop-filter: blur(12px);
}

.rules-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.rules-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  color: #ffffff;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.rule-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.rule-icon {
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
}

.rule-item-content h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.rule-item-content p {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

.rule-item-content .highlight {
  color: var(--primary);
  font-weight: 700;
}

/* Main Content Area */
.main-content {
  padding-bottom: 4rem;
}

/* Section Header with Controls */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.section-title-wrap h3 {
  font-size: 1.35rem;
  color: #ffffff;
}

.section-title-wrap p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  min-width: 220px;
}

.search-input-wrap input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.2rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input-wrap input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.85rem;
  pointer-events: none;
}

.filter-select {
  padding: 0.55rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--border-focus);
}

/* Orders Table */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.order-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.9rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.order-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  transition: background var(--transition-fast);
}

.order-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

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

.cell-index {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.8rem;
  width: 48px;
}

.cell-name {
  font-weight: 600;
  color: #ffffff;
}

.cell-phone {
  font-family: var(--font-mono);
  color: #22c55e;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.cell-phone:hover {
  background: rgba(34, 197, 94, 0.15);
  text-decoration: underline;
}

.cell-units {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  white-space: nowrap;
}

.units-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.city-badge {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.luar-kota-tag {
  display: inline-block;
  font-size: 0.68rem;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  margin-left: 0.35rem;
  font-weight: 500;
}

/* Payment Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status-badge.lunas {
  background: var(--status-lunas-bg);
  color: var(--status-lunas);
  border-color: rgba(16, 185, 129, 0.3);
}

.status-badge.dp {
  background: var(--status-dp-bg);
  color: var(--status-dp);
  border-color: rgba(245, 158, 11, 0.3);
}

.status-badge.unpaid {
  background: var(--status-unpaid-bg);
  color: var(--status-unpaid);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Action Dropdown / Buttons in Table */
.action-btn-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-table-wa {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid rgba(34, 197, 94, 0.25);
  transition: all var(--transition-fast);
}

.btn-table-wa:hover {
  background: #22c55e;
  color: #052e16;
}

.btn-edit-status {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.btn-edit-status:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

/* Table Footer / Pagination */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.825rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

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

.modal-dialog {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(20px) scale(0.98);
  transition: transform var(--transition-smooth);
}

.modal-overlay.active .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-dialog.modal-lg {
  max-width: 720px;
}

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

.modal-header h3 {
  font-size: 1.25rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: #ffffff;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

/* Forms */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-label .required {
  color: #ef4444;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.9rem;
  font-family: var(--font-body);
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.form-textarea {
  min-height: 75px;
  resize: vertical;
}

.form-helper {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* Units Stepper Input */
.unit-stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stepper-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.stepper-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #042f1a;
}

.unit-stepper input {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  width: 90px;
}

/* Checkbox Card */
.checkbox-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.checkbox-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.checkbox-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Price Calculation Summary Box inside Form */
.form-calc-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin: 1.25rem 0;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.calc-row.total {
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.calc-row.total .total-price {
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideInToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast.warning {
  border-left-color: #f59e0b;
}

@keyframes slideInToast {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Code Snippet Box in Modal */
.code-box {
  background: #0b0f19;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #cbd5e1;
  max-height: 220px;
  overflow-y: auto;
  position: relative;
  white-space: pre;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .hero-banner {
    padding: 1.25rem;
  }

  .hero-title-area h2 {
    font-size: 1.4rem;
  }

  .current-units {
    font-size: 1.75rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input-wrap {
    min-width: 100%;
  }

  .filter-select {
    width: 100%;
  }

  .nav-brand .brand-subtitle {
    display: none;
  }

  .order-table th, .order-table td {
    padding: 0.75rem 0.6rem;
  }
}

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