/* ==========================================================================
   ALFAIN POD - UNIFIED DESIGN SYSTEM & THEMES
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 1. Theme: Classic Slate (Default) */
[data-theme="classic"] {
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-text: #ffffff;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-text: #ffffff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --code-bg: #0f172a;
  --code-text: #38bdf8;
}

/* 2. Theme: Midnight Dark */
[data-theme="dark"] {
  --bg-app: #090d16;
  --bg-card: #111827;
  --bg-card-alt: #1f2937;
  --border-color: #374151;
  --border-focus: #60a5fa;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-light: #6b7280;
  --primary: #3b82f6;
  --primary-hover: #1d4ed8;
  --primary-text: #ffffff;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-text: #ffffff;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --code-bg: #030712;
  --code-text: #93c5fd;
}

/* 3. Theme: Sunset Orange */
[data-theme="orange"] {
  --bg-app: #fffaf5;
  --bg-card: #ffffff;
  --bg-card-alt: #fff1e6;
  --border-color: #fed7aa;
  --border-focus: #f97316;
  --text-main: #431407;
  --text-muted: #9a3412;
  --text-light: #c2410c;
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-text: #ffffff;
  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-text: #ffffff;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --code-bg: #2a1205;
  --code-text: #fdba74;
}

/* 4. Theme: Sakura Blossom */
[data-theme="sakura"] {
  --bg-app: #fff5f7;
  --bg-card: #ffffff;
  --bg-card-alt: #ffe4e9;
  --border-color: #fbcfe8;
  --border-focus: #ec4899;
  --text-main: #500724;
  --text-muted: #9d174d;
  --text-light: #be185d;
  --primary: #db2777;
  --primary-hover: #be185d;
  --primary-text: #ffffff;
  --accent: #9333ea;
  --accent-hover: #7e22ce;
  --accent-text: #ffffff;
  --success: #059669;
  --warning: #d97706;
  --danger: #e11d48;
  --code-bg: #200511;
  --code-text: #f472b6;
}

/* 5. Theme: Cyberpunk Neon */
[data-theme="cyber"] {
  --bg-app: #050508;
  --bg-card: #0d0e15;
  --bg-card-alt: #161726;
  --border-color: #262940;
  --border-focus: #00ffcc;
  --text-main: #00ffcc;
  --text-muted: #8892b0;
  --text-light: #525975;
  --primary: #00ffcc;
  --primary-hover: #00cca3;
  --primary-text: #050508;
  --accent: #ff007f;
  --accent-hover: #cc0066;
  --accent-text: #ffffff;
  --success: #00ff66;
  --warning: #ffb700;
  --danger: #ff0055;
  --code-bg: #000000;
  --code-text: #00ffcc;
}

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

html, body {
  min-height: 100vh;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Layout Elements */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.brand-logo.lg {
  width: 56px;
  height: 56px;
  font-size: 2rem;
  margin: 0 auto 1rem;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-title {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-card-alt);
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid var(--border-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.app-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

/* Visibility Utilities */
.hidden { display: none !important; }
.view-section { display: none; }
.view-section.active { display: block; animation: fadeIn 0.3s ease; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.25s ease; }

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

/* Typography & Global Headings */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-main);
}
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-xs { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn-block { width: 100%; }

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-text);
}
.btn-primary:hover:not(:disabled) { background-color: var(--primary-hover); }

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover:not(:disabled) { background-color: var(--bg-card-alt); }

.btn-accent {
  background-color: var(--accent);
  color: var(--accent-text);
}
.btn-accent:hover:not(:disabled) { background-color: var(--accent-hover); }

.btn-success {
  background-color: var(--success);
  color: #fff;
}
.btn-danger {
  background-color: var(--danger);
  color: #fff;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group small {
  font-size: 0.75rem;
  color: var(--text-light);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrapper i {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon-wrapper input {
  padding-left: 2.25rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

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

.form-subheading {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
}

/* Custom Checkbox */
.custom-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  width: 18px;
  height: 18px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
}

.custom-checkbox input:checked ~ .checkmark::after {
  content: "✔";
  color: #fff;
  font-size: 11px;
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-color);
  transition: 0.3s;
  border-radius: 34px;
}

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

input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

/* Card System */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card-header {
  margin-bottom: 1.25rem;
}

.card-header h3 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Tabs & Pills */
.tab-pill-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card-alt);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.tab-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-pill.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.pill-counter {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: var(--border-color);
  color: var(--text-main);
  border-radius: 999px;
}

.tab-pill.active .pill-counter {
  background: var(--primary);
  color: var(--primary-text);
}

/* VIEW 1: AUTH CARD */
.auth-card-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 4rem);
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-xl);
}

.auth-card-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-card-header h2 {
  font-size: 1.5rem;
}

.auth-card-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.auth-pills {
  margin-bottom: 1.5rem;
}

.auth-form { display: none; }
.auth-form.active { display: flex; flex-direction: column; gap: 0.25rem; }

/* VIEW 2: PENDING ADMIN */
.status-card-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 10rem);
}

.status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  max-width: 480px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.status-icon-bubble {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.status-icon-bubble.warning {
  background: #fef3c7;
  color: #d97706;
}

.status-meta {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-card-alt);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

/* VIEW 3: WIZARD */
.wizard-wrapper {
  max-width: 800px;
  margin: 2rem auto;
}

.wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.wizard-header {
  text-align: center;
  margin-bottom: 2rem;
}

.wizard-steps-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.wizard-step-node {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.4;
  transition: opacity var(--transition-fast);
}

.wizard-step-node.active { opacity: 1; }

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card-alt);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.wizard-step-node.active .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}

.step-label {
  font-weight: 600;
  font-size: 0.85rem;
}

.step-connector {
  width: 40px;
  height: 2px;
  background: var(--border-color);
}

.wizard-actions {
  display: flex;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}
.wizard-actions.right-align { justify-content: flex-end; }
.wizard-actions.space-between { justify-content: space-between; }

/* Filter Cards & Toolbars */
.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.25rem 0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-upload-btn {
  cursor: pointer;
}
.hidden-file-input { display: none; }

.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: flex-end;
}

.admin-filter-grid {
  grid-template-columns: 2fr 1fr 1.25fr 1fr 1fr 1fr 1fr;
}

@media (max-width: 1024px) {
  .filter-grid, .admin-filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  padding: 0;
}

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

.data-table th {
  background: var(--bg-card-alt);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: var(--bg-card-alt);
}

.table-empty {
  text-align: center;
  padding: 3rem 1rem !important;
  color: var(--text-muted);
}

.table-user-cell {
  display: flex;
  flex-direction: column;
}

.table-user-cell .name { font-weight: 600; }
.table-user-cell .sub { font-size: 0.75rem; color: var(--text-muted); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-Received { background: #e0e7ff; color: #4338ca; }
.badge-Verified { background: #dbeafe; color: #1d4ed8; }
.badge-Printing { background: #fef3c7; color: #b45309; }
.badge-Packed { background: #ede9fe; color: #6d28d9; }
.badge-Shipped { background: #e0f2fe; color: #0369a1; }
.badge-Delivered { background: #d1fae5; color: #047857; }
.badge-Cancelled { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }

/* Admin Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.bg-blue { background: #e0e7ff; color: #3b82f6; }
.bg-emerald { background: #d1fae5; color: #10b981; }
.bg-amber { background: #fef3c7; color: #f59e0b; }
.bg-purple { background: #ede9fe; color: #8b5cf6; }

.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.stat-value { font-size: 1.5rem; font-weight: 700; margin-top: 0.15rem; }

/* Settings & Integrations */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
}

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

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

.toggle-title { font-weight: 600; font-size: 0.85rem; }
.toggle-desc { font-size: 0.75rem; color: var(--text-muted); }

.schema-checkboxes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.integration-tabs-scroller {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.sub-pills .tab-pill {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.integration-code-box {
  background: var(--code-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.code-box-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.integration-code-box pre {
  padding: 1rem;
  margin: 0;
  overflow-x: auto;
}

.code-display {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--code-text);
  line-height: 1.45;
}

.code-textarea {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.guide-notes {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-card-alt);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalScale 0.2s ease;
}

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

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.inspector-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  background: var(--bg-card-alt);
  padding: 1rem;
  border-radius: var(--radius-md);
}

.summary-box .label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  display: block;
  margin-bottom: 0.25rem;
}

.summary-box p, .summary-box strong { font-size: 0.8rem; }

.item-thumb-img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* Floating Settings & Theme Dock */
.floating-settings-dock {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
}

.cog-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.cog-btn:hover { transform: rotate(45deg) scale(1.05); }

.theme-menu {
  position: absolute;
  bottom: 55px;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  width: 220px;
  box-shadow: var(--shadow-xl);
}

.theme-menu-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.theme-btn:hover { background: var(--bg-card-alt); }
.theme-btn.active { border-color: var(--primary); font-weight: 700; }

.theme-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.theme-swatch.classic { background: #3b82f6; }
.theme-swatch.dark { background: #111827; }
.theme-swatch.orange { background: #ea580c; }
.theme-swatch.sakura { background: #db2777; }
.theme-swatch.cyber { background: #00ffcc; }

.theme-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.75rem 0;
}

.desktop-mode-wrapper { font-size: 0.8rem; }

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

.toast {
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideToast 0.25s ease;
}

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

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

/* Spinner */
.spinner {
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
#set-image-provider {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3Cpolyline points='6 9 12 15 18 9'%3e%3C/polyline%3e%3C/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border-color: var(--border-color);
  background-color: var(--bg-card-alt);
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
  
  .card {
    padding: 1rem !important;
  }

  .theme-options-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .app-main {
    padding: 1rem !important;
  }
}

/* Advanced Toggle Row Styling */
.toggle-row-advanced {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-alt);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.toggle-info-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toggle-title-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.info-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--bg-card);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.info-icon-btn:hover {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.toggle-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* Blue Tap/Click Glitch Hatanay Ka Code */
* {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none;
    outline: none !important;
}


/* Netlify Badge Remover */
#netlify-logo, a[href^="https://www.netlify.com"] {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ================= SMART GLOBAL LOADER STYLING ================= */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45); /* Soft slate glass backdrop */
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 9999999;                   /* Always on top */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.loader-overlay.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.loader-spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary, #3b82f6); /* Automatically adapts to active theme */
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

.loader-text {
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 14px;
  letter-spacing: 0.03em;
  font-family: var(--font-sans);
}
