/* ==========================================================================
   ShyForge Client Portal — Design System & Theme Engine
   Light / Dark mode with CSS custom properties
   ========================================================================== */

/* ── Theme Tokens ───────────────────────────────────────────── */
:root, [data-theme="dark"] {
  --bg: #08080a;
  --bg-secondary: #0c0c10;
  --surface: #121216;
  --surface-hover: #191920;
  --surface-elevated: #1e1e26;
  --text: #e8eaed;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --primary: #ff6600;
  --primary-dim: #d95500;
  --primary-glow: rgba(255, 102, 0, 0.25);
  --primary-bg: rgba(255, 102, 0, 0.1);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #38bdf8;
  --info-bg: rgba(56, 189, 248, 0.12);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.12);
  --indigo: #818cf8;
  --indigo-bg: rgba(129, 140, 248, 0.12);
  --shadow: rgba(0, 0, 0, 0.6);
  --shadow-sm: rgba(0, 0, 0, 0.3);
  --glass-bg: rgba(18, 18, 22, 0.82);
  --input-bg: #0d0d14;
  --input-border: rgba(255, 255, 255, 0.1);
  --topbar-bg: rgba(10, 14, 23, 0.92);
  --sidebar-bg: #080a10;
  --scrollbar-track: #121216;
  --scrollbar-thumb: #ff6600;
  --overlay: rgba(0, 0, 0, 0.75);
}

[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-secondary: #eeeef0;
  --surface: #ffffff;
  --surface-hover: #f8f8fa;
  --surface-elevated: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --primary: #e85d00;
  --primary-dim: #cc5200;
  --primary-glow: rgba(232, 93, 0, 0.2);
  --primary-bg: rgba(232, 93, 0, 0.08);
  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.1);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);
  --info: #0284c7;
  --info-bg: rgba(2, 132, 199, 0.1);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.1);
  --indigo: #6366f1;
  --indigo-bg: rgba(99, 102, 241, 0.1);
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-sm: rgba(0, 0, 0, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.88);
  --input-bg: #f9f9fb;
  --input-border: rgba(0, 0, 0, 0.12);
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --sidebar-bg: #ffffff;
  --scrollbar-track: #eeeef0;
  --scrollbar-thumb: #e85d00;
  --overlay: rgba(0, 0, 0, 0.4);
}

/* ── Typography ────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Poppins:wght@400;600;700;800;900&family=JetBrains+Mono:wght@400;600;700&display=swap');

/* ── Global Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }

/* ── Layout ────────────────────────────────────────────────── */
.client-layout {
  display: flex;
  min-height: 100vh;
}

.client-sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.3s ease;
}

.client-main {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Sidebar Brand ─────────────────────────────────────────── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand img {
  height: 36px;
  width: auto;
}
.sidebar-brand-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
}
.sidebar-brand-sub {
  font-size: 0.65rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Sidebar Navigation ───────────────────────────────────── */
.sidebar-nav { padding: 12px 0; flex: 1; overflow-y: auto; }

.sidebar-nav-label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 16px 20px 6px;
  margin: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 2px 10px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  border: 1px solid transparent;
}
.sidebar-link:hover {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary-bg);
}
.sidebar-link.active {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: rgba(255, 102, 0, 0.3);
  font-weight: 700;
}
.sidebar-link i {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
}
.sidebar-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid rgba(255, 102, 0, 0.25);
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Topbar ────────────────────────────────────────────────── */
.client-topbar {
  height: 60px;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.topbar-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-title i { color: var(--primary); }

/* ── Theme Toggle ─────────────────────────────────────────── */
.theme-toggle {
  width: 44px;
  height: 24px;
  border-radius: 99px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  padding: 2px;
}
.theme-toggle::before {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  left: 3px;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 4px var(--shadow-sm);
}
[data-theme="light"] .theme-toggle::before {
  transform: translateX(20px);
}
.theme-toggle .icon-dark, .theme-toggle .icon-light {
  font-size: 0.55rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.theme-toggle .icon-dark { left: 7px; color: #fbbf24; }
.theme-toggle .icon-light { right: 6px; color: #64748b; }

/* ── Cards ─────────────────────────────────────────────────── */
.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}
.card-panel:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 20px var(--shadow-sm);
}
.card-panel-elevated {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 8px 30px var(--shadow-sm);
}

/* ── KPI Cards ─────────────────────────────────────────────── */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.kpi-card.accent-primary::before { background: var(--primary); }
.kpi-card.accent-success::before { background: var(--success); }
.kpi-card.accent-info::before { background: var(--info); }
.kpi-card.accent-warning::before { background: var(--warning); }
.kpi-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary-forge {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-primary-forge:hover {
  background: var(--primary-dim);
  box-shadow: 0 4px 16px var(--primary-glow);
  transform: translateY(-1px);
  color: #ffffff;
}

.btn-outline-forge {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn-outline-forge:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.btn-ghost {
  background: var(--surface-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn-ghost:hover {
  background: var(--surface-elevated);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Tables ─────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.data-table th {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text);
  vertical-align: middle;
}
.data-table tr:hover td {
  background: var(--surface-hover);
}

/* ── Status Badges ─────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}
.status-pending { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(251, 191, 36, 0.3); }
.status-pending .dot { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.status-processing { background: var(--info-bg); color: var(--info); border: 1px solid rgba(56, 189, 248, 0.3); }
.status-processing .dot { background: var(--info); box-shadow: 0 0 6px var(--info); }
.status-ready { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.status-ready .dot { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-delivered { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.35); }
.status-delivered .dot { background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.status-cancelled { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.status-cancelled .dot { background: var(--danger); }

/* ── Product Cards ─────────────────────────────────────────── */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow);
  border-color: var(--primary);
}
.product-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}
.product-card-body { padding: 1.2rem; }
.product-card-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 6px;
}
.product-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}
.product-card-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

/* ── Keychain Preview ──────────────────────────────────────── */
.keychain-preview {
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 18px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 0 30px var(--primary-glow);
  position: relative;
}
.keychain-preview::before {
  content: '';
  width: 14px; height: 14px;
  border: 3px solid var(--primary);
  border-radius: 50%;
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
}
.keychain-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.keychain-value-lg {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  word-break: break-word;
}
.keychain-value-sm {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Lock Toggle ───────────────────────────────────────────── */
.lock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
}
.lock-toggle.locked {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
}
.lock-toggle:hover {
  border-color: var(--primary);
}

/* ── Toast Notification ────────────────────────────────────── */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface-elevated);
  border: 1px solid var(--success);
  border-radius: 14px;
  padding: 14px 22px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 10px 40px var(--shadow);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 0.4s ease, toastSlideOut 0.4s ease 2.5s forwards;
  max-width: 400px;
}
.toast-notification.error { border-color: var(--danger); }
.toast-notification i { font-size: 1.1rem; }

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

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.empty-state > i,
.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--border-strong);
}
.empty-state a i,
.empty-state button i,
.empty-state .btn-create-order-empty i {
  font-size: 0.72rem !important;
  margin: 0 !important;
  line-height: 1 !important;
}
.btn-create-order-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff !important;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff6600 0%, #e65100 100%);
  box-shadow: 0 3px 12px rgba(255, 102, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  letter-spacing: 0.25px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-create-order-empty:hover {
  background: linear-gradient(135deg, #ff771a 0%, #f05a00 100%);
  box-shadow: 0 5px 18px rgba(255, 102, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  color: #ffffff !important;
}
.btn-create-order-empty:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}
.empty-state h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.empty-state p {
  font-size: 0.82rem;
  max-width: 320px;
  margin: 0 auto 1.2rem;
}

/* ── Grid Utilities ────────────────────────────────────────── */
.grid-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ── Page Content ──────────────────────────────────────────── */
.page-content { padding: 1.5rem; }

/* ── Cart Item ─────────────────────────────────────────────── */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  transition: all 0.2s ease;
}
.cart-item:hover {
  border-color: var(--border-strong);
}
.cart-item-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cart-item-icon i { color: var(--primary); font-size: 1.2rem; }
.cart-item-details { flex: 1; min-width: 0; }
.cart-item-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 4px;
}
.cart-item-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.cart-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Topbar Navigation System ─────────────────────────────── */
.client-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: 58px;
  box-sizing: border-box;
  gap: 12px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title i {
  color: var(--primary);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.topbar-company-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--primary-bg);
  border: 1px solid rgba(255, 102, 0, 0.25);
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  max-width: 180px;
}
.topbar-company-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-cart-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.header-cart-icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.header-cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  padding: 1px 6px;
  border-radius: 99px;
  border: 2px solid var(--surface);
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  min-width: 18px;
  text-align: center;
}
.mobile-sidebar-close {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}
.mobile-sidebar-close:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ── Keychain Order Workspace Grid ────────────────────────── */
.entry-fields-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr 1.2fr;
  gap: 12px;
  align-items: end;
}

/* ── Mobile Responsive System ──────────────────────────────── */
.mobile-sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1045;
}

@media (max-width: 1040px) {
  .entry-fields-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .showroom-workspace-grid {
    grid-template-columns: 1fr !important;
  }
  .showroom-sidebar-col {
    position: static !important;
    top: auto !important;
    order: 2;
  }
}

@media (max-width: 768px) {
  /* Prevent iOS Safari auto-zoom on input focus */
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="date"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }

  body.mobile-nav-active {
    overflow: hidden !important;
  }

  .client-sidebar {
    width: 280px;
    max-width: 85vw;
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 1050;
  }
  .client-sidebar.open {
    transform: translateX(0);
    box-shadow: 15px 0 45px rgba(0, 0, 0, 0.75);
  }
  .sidebar-brand {
    justify-content: space-between;
  }
  .mobile-sidebar-close {
    display: flex;
  }
  .client-main {
    margin-left: 0;
    width: 100%;
    min-width: 0;
  }
  .mobile-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
  }
  .sidebar-overlay.open {
    display: block;
    z-index: 1045;
  }

  /* Topbar responsive compactness */
  .client-topbar {
    padding: 8px 12px;
    min-height: 52px;
  }
  .topbar-title {
    font-size: 0.85rem;
  }
  .topbar-title i {
    display: none;
  }
  .topbar-actions {
    gap: 6px;
  }
  .topbar-company-badge {
    padding: 3px 8px;
    max-width: 120px;
  }
  .topbar-company-name {
    display: none;
  }
  .topbar-btn-label {
    display: none !important;
  }
  .topbar-icon-btn, .topbar-admin-btn {
    padding: 7px 10px !important;
    min-width: 36px;
    justify-content: center;
  }

  /* Page Content */
  .page-content {
    padding: 0.85rem !important;
  }
  .section-header {
    margin-bottom: 1rem;
    gap: 0.75rem;
  }
  .section-title {
    font-size: 1rem;
  }

  /* Two-column layout collapse (Cart, Checkout, Dashboard) */
  .keychain-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }
  .keychain-layout > div {
    width: 100% !important;
    max-width: 100% !important;
  }
  .keychain-layout > div[style*="sticky"] {
    position: static !important;
    top: auto !important;
  }

  /* Product Catalog grid */
  .grid-products {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Keychain Form Entry Card */
  .entry-card {
    padding: 10px 12px 14px !important;
    border-radius: 10px !important;
  }
  .entry-fields-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .entry-card input, .entry-card select {
    height: 38px !important;
  }

  /* Cart Items Container */
  .cart-item-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 12px !important;
  }
  .cart-item-actions {
    width: 100%;
    justify-content: space-between;
    border-top: 1px dashed var(--border);
    padding-top: 8px;
  }

  /* Orders Filter Bar */
  .order-filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .order-filter-bar > div {
    width: 100% !important;
    min-width: 100% !important;
  }
  .tab-btn {
    padding: 8px 12px;
    font-size: 0.76rem;
  }

  /* Responsive Table Container */
  .table-responsive,
  div[style*="overflow-x: auto"] {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .data-table {
    min-width: 620px;
  }

  /* Modals */
  .modal-dialog,
  #orderDetailsModal > div,
  .modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    margin: 12px auto !important;
    padding: 14px !important;
    border-radius: 12px !important;
    overflow-y: auto !important;
  }
}

@media (max-width: 480px) {
  .topbar-company-badge {
    display: none;
  }
  .login-card {
    padding: 1.5rem 1.1rem;
    border-radius: 16px;
    margin: 8px;
  }
  .login-card h1 {
    font-size: 1.15rem;
  }
  #loginOtp {
    font-size: 1.15rem !important;
    letter-spacing: 4px !important;
  }
  .kpi-card {
    padding: 1rem;
  }
  .kpi-value {
    font-size: 1.3rem;
  }
}

/* ── Login Page ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1.5rem;
  background-image:
    radial-gradient(circle at 50% 20%, var(--primary-glow), transparent 60%),
    radial-gradient(circle at 10% 80%, rgba(129, 140, 248, 0.08), transparent 50%);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px var(--shadow), 0 0 40px var(--primary-glow);
}
.login-card h1 {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.login-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ── Coming Soon Card ──────────────────────────────────────── */
.coming-soon-card {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  padding: 2rem;
  text-align: center;
  opacity: 0.6;
}
.coming-soon-card i {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}
.coming-soon-card h4 {
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}
.coming-soon-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Section Headers ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.section-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title i { color: var(--primary); }
.section-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Checkout Summary ──────────────────────────────────────── */
.checkout-summary {
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 18px;
  padding: 1.5rem;
}
.checkout-total {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}
