:root {
  --brand-primary: #3CCBDA;
  --brand-primary-hover: #2bb7c8;
  --brand-primary-light: rgba(var(--brand-primary-rgb,60,203,218), 0.12);
  --brand-primary-strong: rgba(var(--brand-primary-rgb,60,203,218), 0.22);
  --brand-navy: #0F2744;
  --brand-navy-hover: #153a5d;
  --brand-navy-light: rgba(var(--brand-navy-rgb,15,39,68), 0.08);
  --brand-white: #FFFFFF;
  --brand-bg: #F7F9FC;
  --brand-section: #F0F4F8;
  --brand-success: #22C55E;
  --brand-warning: #F59E0B;
  --brand-danger: #EF4444;
  --brand-muted: #6B7280;
  --brand-teal: #00685E;
  --brand-teal-hover: #00897B;
  --brand-teal-light: rgba(0, 104, 94, 0.12);
  --brand-warm: #E86A33;
  --brand-warm-light: rgba(232, 106, 51, 0.12);
  --brand-warm-alt: #F9A826;
  --brand-cool: #6C63FF;
  --brand-cool-light: rgba(108, 99, 255, 0.12);
  --brand-cool-alt: #E84393;
  --brand-border: #E5E7EB;
  --brand-border-light: #F0F0F5;
  --brand-border-focus: rgba(var(--brand-primary-rgb), 0.5);

  --bs-primary: #3CCBDA;
  --bs-primary-rgb: 60, 203, 218;
  --bs-secondary: #0F2744;
  --bs-secondary-rgb: 15, 39, 68;
  --bs-success: #22C55E;
  --bs-success-rgb: 34, 197, 94;
  --bs-warning: #F59E0B;
  --bs-warning-rgb: 245, 158, 11;
  --bs-danger: #EF4444;
  --bs-danger-rgb: 239, 68, 68;
  --bs-light: #F7F9FC;
  --bs-light-rgb: 247, 249, 252;
  --bs-dark: #0F2744;
  --bs-dark-rgb: 15, 39, 68;
  --bs-body-color: #1f2937;
  --bs-body-color-rgb: 31, 41, 55;
  --bs-body-bg: #F7F9FC;
  --bs-body-bg-rgb: 247, 249, 252;
  --bs-border-color: #E5E7EB;
  --bs-border-radius: 12px;
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: 16px;
  --bs-border-radius-xl: 20px;
  --bs-border-radius-2xl: 24px;
  --bs-border-radius-pill: 9999px;
  --bs-link-color: #3CCBDA;
  --bs-link-hover-color: #2bb7c8;
  --bs-focus-ring-color: rgba(var(--brand-primary-rgb), 0.25);
  --bs-focus-ring-width: 0.25rem;
  --bs-focus-ring-opacity: 0.25;

  --shadow-xs: 0 1px 2px rgba(var(--brand-navy-rgb), 0.04);
  --shadow-sm: 0 2px 4px rgba(var(--brand-navy-rgb), 0.06);
  --shadow-md: 0 4px 12px rgba(var(--brand-navy-rgb), 0.08);
  --shadow-lg: 0 8px 24px rgba(var(--brand-navy-rgb), 0.10);
  --shadow-xl: 0 12px 40px rgba(var(--brand-navy-rgb), 0.12);
  --shadow-2xl: 0 20px 60px rgba(var(--brand-navy-rgb), 0.15);
  --shadow-primary: 0 8px 24px rgba(var(--brand-primary-rgb), 0.25);
  --shadow-primary-lg: 0 12px 40px rgba(var(--brand-primary-rgb), 0.30);

  --font-inter: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-cairo: 'Cairo', system-ui, sans-serif;

  --sidebar-w: 280px;
  --header-h: 64px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-inter);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--bs-body-color);
  background: var(--brand-bg);
  min-height: 100vh;
}
body.rtl { font-family: var(--font-cairo); }

::selection { background: var(--brand-primary-light); color: var(--brand-navy); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

a { color: var(--brand-primary); text-decoration: none; transition: color 0.2s var(--ease-out); }
a:hover { color: var(--brand-primary-hover); }

img { max-width: 100%; height: auto; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; border-radius: var(--bs-border-radius-sm); }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--brand-navy);
  letter-spacing: -0.02em;
}

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

.main-content {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem;
  margin-left: var(--sidebar-w);
  transition: margin-left 0.3s var(--ease-out);
}

.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.page-header p { color: var(--brand-muted); margin: 0.25rem 0 0; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem; font-size: 0.875rem; font-weight: 600; line-height: 1.5;
  border-radius: var(--bs-border-radius); border: 1px solid transparent;
  transition: all 0.2s var(--ease-out); white-space: nowrap; text-decoration: none;
  position: relative; overflow: hidden;
}
.btn::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.1); opacity: 0; transition: opacity 0.2s; }
.btn:hover { transform: translateY(-2px); }
.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(0); transition: all 0.05s; }
.btn:disabled, .btn.disabled { opacity: 0.5; pointer-events: none; }

.btn-primary {
  background: var(--brand-primary); color: #fff; border-color: var(--brand-primary);
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: var(--brand-primary-hover); border-color: var(--brand-primary-hover);
  color: #fff; box-shadow: var(--shadow-primary-lg);
}

.btn-secondary {
  background: var(--brand-navy); color: #fff; border-color: var(--brand-navy);
}
.btn-secondary:hover {
  background: var(--brand-navy-hover); border-color: var(--brand-navy-hover); color: #fff;
}

.btn-outline, .btn-outline-primary {
  background: #fff; border: 1px solid var(--brand-border); color: var(--bs-body-color);
}
.btn-outline:hover, .btn-outline-primary:hover {
  background: var(--brand-navy); border-color: var(--brand-navy); color: #fff;
}

.btn-danger {
  background: var(--brand-danger); color: #fff; border-color: var(--brand-danger);
}
.btn-danger:hover {
  background: #dc2626; border-color: #dc2626; box-shadow: 0 8px 20px rgba(239, 68, 68, 0.24);
}

/* ── Action Icon Buttons (frame like close-btn, brand-primary color) ── */
.btn-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--bs-border-radius);
  background: transparent;
  border: 1px solid var(--brand-border);
  color: var(--brand-muted);
  font-size: 1rem;
  transition: all 0.2s var(--ease-out);
  text-decoration: none;
}
.btn-action-icon:hover {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-action-icon:active {
  background: var(--brand-navy-hover);
  border-color: var(--brand-navy-hover);
  color: #fff;
  transform: translateY(0);
  box-shadow: none;
}
.btn-action-icon.text-danger {
  border-color: var(--brand-danger);
  color: var(--brand-danger);
}
.btn-action-icon.text-danger:hover {
  background: var(--brand-danger);
  color: #fff;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.24);
}
.btn-action-icon.text-danger:active {
  background: #b91c1c;
  border-color: #b91c1c;
}
.btn-action-icon.text-primary {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.btn-action-icon.text-primary:hover {
  background: var(--brand-primary);
  color: #fff;
}
.btn-action-icon.text-primary:active {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
}

/* ── Button active/pressed state: navy instead of light blue ── */
.btn-primary:active,
.btn-outline:active,
.btn-outline-primary:active {
  background: var(--brand-navy) !important;
  border-color: var(--brand-navy) !important;
  color: #fff !important;
  box-shadow: none !important;
}
.btn-primary:active::after,
.btn-outline:active::after,
.btn-outline-primary:active::after {
  opacity: 0;
}

/* Secondary button already uses navy, keep as is */
.btn-secondary:active {
  background: var(--brand-navy-hover) !important;
  border-color: var(--brand-navy-hover) !important;
}

/* Danger button active state */
.btn-danger:active {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
}

/* ── Status Toggle Buttons (Active/Inactive) ── */
.btn-status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease-out);
}
.btn-status-toggle.active {
  background: rgba(var(--brand-primary-rgb), 0.12);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-status-toggle.inactive {
  background: rgba(107, 114, 128, 0.12);
  color: var(--brand-muted);
  border-color: var(--brand-border);
}
.btn-status-toggle.paused {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.3);
}
.btn-status-toggle.deleted {
  background: rgba(239, 68, 68, 0.08);
  color: var(--brand-danger);
  border-color: rgba(239, 68, 68, 0.2);
}
.btn-status-toggle:hover {
  transform: translateY(-1px);
}
.btn-status-toggle:active {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #fff;
  transform: translateY(0);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; border-radius: var(--bs-border-radius-sm); }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; border-radius: var(--bs-border-radius-lg); }
.btn-icon { width: 2.25rem; height: 2.25rem; padding: 0; border-radius: var(--bs-border-radius-pill); }
.btn-icon:hover { transform: translateY(-1px); }
.btn-block { width: 100%; }

/* ── Spinner ── */
.spinner {
  display:inline-block;width:1rem;height:1rem;border:2px solid var(--brand-border);
  border-top-color:var(--brand-muted);border-radius:50%;animation:spin 0.6s linear infinite;
}
.spinner-dark { border-color:rgba(255,255,255,0.3);border-top-color:#fff; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Button Loading State (navy) ── */
.btn-loading,
.btn.btn-loading {
  pointer-events: none;
  opacity: 1;
  background: var(--brand-navy) !important;
  border-color: var(--brand-navy) !important;
  color: #fff !important;
  box-shadow: none !important;
  transform: none !important;
}
.btn-loading::after { display: none; }

.btn-light {
  background: #fff; color: var(--brand-navy); border-color: #fff;
  box-shadow: 0 4px 12px rgba(var(--brand-navy-rgb), 0.08);
}
.btn-light:hover { background: var(--brand-bg); color: var(--brand-navy); }

/* ── Cards ── */
.card {
  background: #fff;
  border: 1px solid var(--brand-border);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 1.25rem 1.5rem;
  background: transparent;
  border-bottom: 1px solid var(--brand-border);
}
.card-body { padding: 1.5rem; }
.card-footer {
  padding: 1rem 1.5rem;
  background: transparent;
  border-top: 1px solid var(--brand-border);
}
.card-title { font-size: 1.125rem; font-weight: 700; color: var(--brand-navy); margin: 0; }

/* ── Forms ── */
.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-navy);
  margin-bottom: 0.5rem;
}
.form-control, .form-select {
  border: 1px solid var(--brand-border-light);
  border-radius: var(--bs-border-radius);
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--bs-body-color);
  background: #fff;
  transition: all 0.2s var(--ease-out);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.15);
  background: #fff;
}
.form-control::placeholder { color: #9ca3af; }
.form-text { font-size: 0.75rem; color: var(--brand-muted); margin-top: 0.25rem; }
.form-switch .form-check-input { width: 2.5em; height: 1.5em; }
.form-switch .form-check-input:checked { background-color: var(--brand-primary); border-color: var(--brand-primary); }

.input-group-text {
  background: var(--brand-bg);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--bs-border-radius);
  color: var(--brand-muted);
  font-size: 0.875rem;
}

/* ── Tables ── */
.table {
  font-size: 0.875rem;
  margin-bottom: 0;
}
.table thead th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-muted);
  border-bottom: 1px solid var(--brand-border);
  padding: 0.75rem 1rem;
  background: var(--brand-bg);
}
.table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--brand-border-light);
}
.table tbody tr { transition: background 0.15s var(--ease-out); }
.table tbody tr:hover { background: rgba(var(--brand-primary-rgb), 0.04); }
.table tbody tr:last-child td { border-bottom: none; }
.table-responsive { border-radius: var(--bs-border-radius-lg); overflow: hidden; }

/* ── Badges ── */
.badge {
  font-weight: 600;
  padding: 0.35em 0.65em;
  border-radius: 999px;
  font-size: 0.75rem;
}
.bg-primary { background: var(--brand-primary) !important; }
.bg-secondary { background: var(--brand-navy) !important; }
.bg-success { background: var(--brand-success) !important; }
.bg-warning { background: var(--brand-warning) !important; }
.bg-danger { background: var(--brand-danger) !important; }
.bg-light { background: var(--brand-bg) !important; }

/* ── Modals ── */
.modal-content {
  background: #fff;
  border: none;
  border-radius: var(--bs-border-radius-2xl);
  box-shadow: var(--shadow-2xl);
  position: relative;
}
.modal-content .close-btn,
.modal-backdrop .modal .close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
}
.modal-backdrop .modal { position: relative; }
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--brand-border);
}
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--brand-border);
}
.modal-title { font-size: 1.125rem; font-weight: 700; color: var(--brand-navy); }
.btn-close:focus { box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.25); }
.modal-backdrop.show { opacity: 0.5; }
.modal.fade .modal-dialog { transition: transform 0.3s var(--ease-out), opacity 0.2s var(--ease-out); }
.modal-wrapper { position:fixed;inset:0;z-index:1055;background:rgba(0,0,0,0.35);display:flex;align-items:center;justify-content:center;padding:1rem;animation:modalFadeIn 0.2s var(--ease-out); }
@keyframes modalFadeIn { from { opacity:0; } to { opacity:1; } }
.modal-wrapper .modal-dialog { margin:0; }

/* New Folder modal — clean no-divider design */
#newFolderModal .modal-content { background:#fff;border-radius:20px;box-shadow:0 25px 60px rgba(var(--brand-navy-rgb),0.18); }
#newFolderModal .modal-header { border-bottom:none;padding:1.5rem 1.5rem 0; }
#newFolderModal .modal-body { padding:1.25rem 1.5rem; }
#newFolderModal .modal-footer { border-top:none;padding:0 1.5rem 1.5rem; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--brand-navy);
  color: rgba(255, 255, 255, 0.78);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem 1.25rem;
  color: #fff;
}
.sidebar .brand.has-logo {
  flex-direction: column;
  gap: 0;
  padding: 0 0.5rem 1.25rem;
  text-align: center;
}
.sidebar .brand .logo-grid,
.sidebar .brand .sidebar-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--bs-border-radius-sm);
  object-fit: contain;
}
.sidebar .brand .sidebar-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: var(--bs-border-radius-sm);
  object-fit: contain;
}
.sidebar .brand.has-logo .sidebar-logo {
  width: 100%;
  height: auto;
  max-height: 80px;
  border-radius: var(--bs-border-radius);
  object-fit: contain;
  margin-bottom: 0.5rem;
}
.sidebar .brand .brand-divider {
  width: 32px;
  height: 2px;
  background: rgba(255,255,255,0.15);
  border-radius: 1px;
  margin: 0 auto 0.5rem;
}
.sidebar .brand span {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar .brand.has-logo span.brand-name {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: normal;
  line-height: 1.3;
}
.sidebar nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--bs-border-radius);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s var(--ease-out);
}
.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.sidebar nav a.active {
  background: rgba(var(--brand-primary-rgb), 0.15);
  color: #fff;
}
.sidebar nav a i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.sidebar .sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Sidebar Logout Button ── */
.sidebar .logout-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--bs-border-radius);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s var(--ease-out);
  text-decoration: none;
}
.sidebar .logout-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
}

/* ── Wizard Steps (unified with analytics-tab style) ── */
.wizard-steps {
  display: flex;
  gap: 0.25rem;
  background: #fff;
  border-radius: var(--bs-border-radius-lg);
  padding: 0.25rem;
  border: 1px solid var(--brand-border);
  flex-wrap: wrap;
}
.wizard-steps .step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  padding: 0.5rem 1rem;
  border-radius: var(--bs-border-radius);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-muted);
  background: transparent;
  border: none;
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
}
.wizard-steps .step:hover { color: var(--brand-navy); background: var(--brand-navy-light); }
.wizard-steps .step .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--brand-bg);
  color: var(--brand-muted);
  flex-shrink: 0;
  transition: all 0.2s var(--ease-out);
}
.wizard-steps .step.active {
  color: var(--brand-navy);
  background: var(--brand-primary-light);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-primary-rgb),0.3);
}
.wizard-steps .step.active .num { background: var(--brand-primary); color: #fff; }
.wizard-steps .step.done {
  color: var(--brand-success);
  background: rgba(34,197,94,0.08);
  box-shadow: inset 0 0 0 1px rgba(34,197,94,0.2);
}
.wizard-steps .step.done .num { background: var(--brand-success); color: #fff; }
.wizard-steps .arrow { display: none; }

/* ── Type Selection Cards ── */
.type-card {
  border: 1px solid var(--brand-border);
  border-radius: var(--bs-border-radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: all 0.3s var(--ease-out);
  display: block;
  text-decoration: none;
  color: inherit;
}
.type-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-primary);
  box-shadow: 0 12px 32px rgba(var(--brand-primary-rgb), 0.16);
  color: inherit;
}
.type-card.selected {
  border-color: var(--brand-primary);
  background: var(--brand-primary-light);
  box-shadow: 0 4px 16px rgba(var(--brand-primary-rgb), 0.15);
}
.type-card.selected .icon {
  background: var(--brand-primary);
  color: #fff;
}
.type-card .icon {
  width: 48px;
  height: 48px;
  border-radius: var(--bs-border-radius);
  background: var(--brand-primary-light);
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.125rem;
  transition: all 0.3s var(--ease-out);
}
.type-card:hover .icon {
  background: var(--brand-primary);
  color: #fff;
}
.type-card h4 { font-size: 0.875rem; font-weight: 700; color: var(--brand-navy); margin: 0 0 0.25rem; }
.type-card .type-desc { font-size: 0.75rem; color: var(--brand-muted); line-height: 1.4; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Folder cards (My QR Codes) - rename/delete overlay in the top-right corner */
.type-card.folder-card { position: relative; cursor: default; }
.folder-card-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
  z-index: 2;
}
.folder-action-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--bs-border-radius-sm, 6px);
  background: #fff;
  border: 1px solid var(--brand-border);
  color: var(--brand-muted);
  font-size: 0.6875rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.folder-action-icon:hover {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #fff;
}
.folder-action-icon.text-danger:hover {
  background: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

/* ── Stat Cards ── */
.stat-card {
  background: #fff;
  border: 1px solid var(--brand-border);
  border-radius: var(--bs-border-radius-lg);
  padding: 1.25rem 1.5rem;
  transition: all 0.3s var(--ease-out);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ── Stat Card Hover Variants ── */
.stat-card.teal { border-left: 3px solid var(--brand-teal); }
.stat-card.warm { border-left: 3px solid var(--brand-warm); }
.stat-card.cool { border-left: 3px solid var(--brand-cool); }

/* ── Analytics Tabs ── */
.analytics-tabs {
  display: flex;
  gap: 0.25rem;
  background: #fff;
  border-radius: var(--bs-border-radius-lg);
  padding: 0.25rem;
  border: 1px solid var(--brand-border);
}
.analytics-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: var(--bs-border-radius);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-muted);
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}
.analytics-tab:hover { color: var(--brand-navy); background: var(--brand-navy-light); text-decoration: none; }
.analytics-tab.active {
  color: var(--brand-navy);
  background: var(--brand-primary-light);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-primary-rgb),0.3);
}

/* ── Gradient Stat Card ── */
.stat-card-gradient {
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-hover) 100%);
  color: #fff;
  border: none;
  border-radius: var(--bs-border-radius-lg);
  padding: 1.5rem;
  transition: all 0.3s var(--ease-out);
}
.stat-card-gradient:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}
.stat-card-gradient .stat-label { color: rgba(255,255,255,0.7); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.stat-card-gradient .stat-value { font-size: 2rem; font-weight: 800; color: #fff; letter-spacing: -0.03em; }
.stat-card-gradient .stat-icon { font-size: 1.5rem; color: var(--brand-primary); opacity: 0.8; }

.stat-card-gradient.cyan {
  background: linear-gradient(135deg, #0F766E 0%, var(--brand-teal) 100%);
}
.stat-card-gradient.warm {
  background: linear-gradient(135deg, #C2410C 0%, var(--brand-warm) 100%);
}
.stat-card-gradient.cool {
  background: linear-gradient(135deg, #4338CA 0%, var(--brand-cool) 100%);
}

/* ── Password Strength Bar ── */
.pw-strength { margin-top: 0.5rem; }
.pw-strength-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--brand-border);
  overflow: hidden;
  transition: all 0.3s var(--ease-out);
}
.pw-strength-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: all 0.3s var(--ease-out);
}
.pw-strength-bar-fill.weak { width: 25%; background: var(--brand-danger); }
.pw-strength-bar-fill.fair { width: 50%; background: var(--brand-warning); }
.pw-strength-bar-fill.good { width: 75%; background: var(--brand-teal); }
.pw-strength-bar-fill.strong { width: 100%; background: var(--brand-success); }
.pw-strength-text {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-weight: 600;
  transition: color 0.3s var(--ease-out);
}
.pw-strength-text.weak { color: var(--brand-danger); }
.pw-strength-text.fair { color: var(--brand-warning); }
.pw-strength-text.good { color: var(--brand-teal); }
.pw-strength-text.strong { color: var(--brand-success); }
.pw-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--brand-muted);
}
.pw-requirements span { display: flex; align-items: center; gap: 0.25rem; }
.pw-requirements span i { font-size: 0.625rem; }
.pw-requirements span.met { color: var(--brand-success); }
.pw-requirements span.met i { color: var(--brand-success); }
.pw-requirements span.unmet { color: var(--brand-muted); }

/* ── Sidebar Category Sections ── */
.sidebar .nav-category {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  padding: 0.75rem 0.875rem 0.25rem;
  font-weight: 700;
  pointer-events: none;
}

/* ── Auth Pages Enhanced ── */
.auth-wrap-enhanced {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-bg) 0%, #e8f4f8 100%);
}
.auth-wrap-enhanced::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 10% 20%, rgba(var(--brand-primary-rgb), 0.08), transparent 40%),
    radial-gradient(ellipse at 90% 80%, rgba(var(--brand-navy-rgb), 0.06), transparent 35%);
  pointer-events: none;
}
.auth-card-enhanced {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: var(--bs-border-radius-2xl);
  padding: 2.5rem;
  border: 1px solid var(--brand-border);
  box-shadow: 0 20px 60px rgba(var(--brand-navy-rgb), 0.12);
  animation: authIn 0.5s var(--ease-out);
  overflow: hidden;
}
.auth-card-enhanced::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-teal));
  z-index: 0;
}
.auth-card-enhanced .auth-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}
.auth-card-enhanced .auth-brand svg,
.auth-card-enhanced .auth-brand img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.auth-card-enhanced .auth-brand span {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--brand-navy);
  letter-spacing: -0.03em;
}
.auth-card-enhanced h2 {
  margin: 0 0 0.375rem;
  font-size: 1.5rem;
  color: var(--brand-navy);
  letter-spacing: -0.03em;
  font-weight: 800;
}
.auth-card-enhanced .auth-lead {
  color: var(--brand-muted);
  margin: 0 0 1.5rem;
  line-height: 1.6;
  font-size: 0.875rem;
}

/* ── Phone Landing Preview (step2) ── */
.phone-landing-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}
.plp-redirect {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}
.plp-redirect .plp-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(var(--brand-primary-rgb),0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--brand-primary);
  margin-bottom: 1rem;
}
.plp-redirect .plp-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin: 0 0 0.25rem;
}
.plp-redirect .plp-sub {
  font-size: 0.75rem;
  color: var(--brand-muted);
  margin: 0;
  word-break: break-all;
}
.plp-hero {
  background: var(--brand-navy);
  padding: 1.5rem 1rem 1.25rem;
  text-align: center;
  color: #fff;
  flex-shrink: 0;
}
.plp-hero .plp-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.625rem;
  font-size: 1.125rem;
}
.plp-hero .plp-title {
  font-size: 0.8125rem;
  font-weight: 700;
  margin: 0;
}
.plp-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  background: #F5FBFD;
}
.plp-empty {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--brand-muted);
  padding: 2rem 1rem;
  margin: 0;
}
.plp-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.plp-field {
  background: #fff;
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.plp-field .plp-label {
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-muted);
}
.plp-field .plp-value {
  font-size: 0.6875rem;
  color: var(--brand-navy);
  line-height: 1.4;
  word-break: break-word;
}

/* ── Enhanced QR Preview ── */
.qr-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1060;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modalFadeIn 0.2s var(--ease-out);
}
.qr-preview-modal-content {
  background: #fff;
  border-radius: var(--bs-border-radius-2xl);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  animation: authIn 0.3s var(--ease-out);
}
.qr-preview-modal-header {
  position: relative;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--brand-border);
}
.qr-preview-modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--brand-navy);
}
.qr-preview-modal-body {
  padding: 1.5rem;
  text-align: center;
}
.qr-preview-modal-body img {
  max-width: 240px;
  border-radius: var(--bs-border-radius);
  border: 2px solid var(--brand-border-light);
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
}
.qr-preview-modal-body .scan-preview {
  border: 1px solid var(--brand-border);
  border-radius: var(--bs-border-radius-lg);
  overflow: hidden;
  margin-top: 1rem;
  max-height: 360px;
  overflow-y: auto;
}
.qr-preview-modal-body .scan-preview iframe {
  width: 100%;
  height: 320px;
  border: none;
}

/* ── Analytics Chart Enhancements ── */
.chart-container {
  position: relative;
  height: 300px;
}
.chart-container-sm {
  position: relative;
  height: 200px;
  max-width: 220px;
  margin: 0 auto;
}

/* ── Real Preview Toggle ── */
.preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  background: #fff;
  color: var(--brand-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.preview-toggle:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-primary-light);
}
.preview-toggle.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* ── Section Kicker ── */
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  background: var(--brand-primary-light);
  color: var(--brand-navy);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Alerts ── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--bs-border-radius);
  border: 1px solid transparent;
  font-size: 0.875rem;
}
.alert-error, .alert-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.18);
}
.alert-success {
  background: rgba(34, 197, 94, 0.08);
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.18);
}
.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.18);
}
.alert-icon {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.alert-icon i {
  font-size: 1.125rem;
  flex-shrink: 0;
}

/* ── Close Button ── */
.close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--bs-border-radius);
  background: #fff;
  border: 1px solid var(--brand-border);
  color: var(--brand-muted);
  font-size: 1.25rem;
  transition: all 0.2s var(--ease-out);
  text-decoration: none;
}
.close-btn:hover { background: var(--brand-bg); color: var(--brand-navy); transform: rotate(90deg); }

/* ── Color Swatch ── */
.color-swatch {
  width: 100%;
  height: 44px;
  border-radius: var(--bs-border-radius);
  display: flex;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s var(--ease-out);
}
.color-swatch:hover { transform: translateY(-2px); }
.color-swatch.selected { border-color: var(--brand-navy); }
.color-swatch span { flex: 1; }

/* ── Drop Zone ── */
.drop-zone {
  position: relative;
  border: 2px dashed var(--brand-border);
  border-radius: var(--bs-border-radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  background: var(--brand-bg);
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--brand-primary);
  background: var(--brand-primary-light);
}
.drop-zone .dz-icon { font-size: 2rem; color: var(--brand-muted); margin-bottom: 0.75rem; }
.drop-zone .dz-text { font-weight: 600; color: var(--brand-navy); font-size: 0.9375rem; }
.drop-zone .dz-hint { font-size: 0.8125rem; color: var(--brand-muted); margin-top: 0.25rem; }
/* The real <input type="file"> lives inside .drop-zone (see app.js) so drag-drop
   and native validation still work, but it must stay visually hidden - otherwise
   the browser's own "Browse... / No file selected" bar renders stacked underneath
   the custom icon/text, which is the double-UI bug seen across every upload field. */
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
}
.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
}
.empty-state h3 { font-size: 1.125rem; font-weight: 700; margin: 0 0 0.5rem; }
.empty-state p { color: var(--brand-muted); margin: 0 0 1.5rem; max-width: 320px; }

/* ── Landing Page ── */
.site-navbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--brand-border);
  transition: background 0.3s var(--ease-out);
}
.site-navbar.scrolled { background: rgba(255, 255, 255, 0.96); }
.site-navbar .navbar-brand { color: var(--brand-navy); font-weight: 800; letter-spacing: -0.03em; }
.site-navbar .navbar-nav .nav-link {
  color: var(--brand-muted); font-weight: 600; font-size: 0.875rem;
  position: relative; padding: 0.5rem 1rem;
}
.site-navbar .navbar-nav .nav-link::after {
  content: ''; position: absolute; bottom: 0; left: 1rem; right: 1rem;
  height: 2px; background: var(--brand-primary); border-radius: 1px;
  transform: scaleX(0); transition: transform 0.3s var(--ease-out);
}
.site-navbar .navbar-nav .nav-link:hover::after,
.site-navbar .navbar-nav .nav-link.active::after { transform: scaleX(1); }
.site-navbar .navbar-nav .nav-link:hover,
.site-navbar .navbar-nav .nav-link.active { color: var(--brand-primary); }

.landing-hero {
  position: relative; padding: 4rem 0 5rem; overflow: hidden;
}
.landing-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 80% 10%, rgba(var(--brand-primary-rgb), 0.15), transparent 40%),
    radial-gradient(ellipse at 20% 90%, rgba(var(--brand-navy-rgb), 0.08), transparent 35%),
    radial-gradient(ellipse at 50% 50%, rgba(var(--brand-primary-rgb), 0.05), transparent 50%);
  pointer-events: none;
}
.landing-hero::after {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--brand-primary-rgb), 0.08), transparent 60%);
  pointer-events: none;
}
.landing-hero > .container { position: relative; z-index: 1; }

.hero-title {
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
  color: var(--brand-navy);
  font-weight: 900;
}
.hero-title .highlight { color: var(--brand-primary); }

.hero-lead {
  color: var(--brand-muted);
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 42rem;
}

.hero-stats { display: flex; gap: 0; flex-wrap: wrap; }
.hero-stat {
  padding: 0.5rem 1.75rem;
  text-align: center;
  position: relative;
}
.hero-stat + .hero-stat { border-left: 1px solid rgba(var(--brand-navy-rgb),0.08); }
.hero-stat strong {
  display: block;
  color: var(--brand-navy);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.hero-stat span {
  display: block;
  color: var(--brand-muted);
  font-size: 0.8125rem;
  margin-top: 2px;
  font-weight: 500;
}

.hero-preview-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-preview-wrap::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 120%; height: 120%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(var(--brand-primary-rgb), 0.12), transparent 60%);
  pointer-events: none;
}
/* Smaller phone mockup for side-panel previews */
.phone-mock.phone-mock-sm .phone-bezel {
  max-width: 260px;
  padding: 8px;
  border-radius: 32px;
}
.phone-mock.phone-mock-sm .phone-bezel .screen {
  border-radius: 22px;
}
.phone-mock.phone-mock-sm .phone-status {
  padding: 4px 14px 0;
  font-size: 0.5625rem;
}
.phone-mock.phone-mock-sm .dynamic-island {
  top: 4px;
  padding: 3px 10px;
  gap: 3px;
}
.phone-mock.phone-mock-sm .dynamic-island .sensor { width: 5px; height: 5px; }
.phone-mock.phone-mock-sm .dynamic-island .cam { width: 4px; height: 4px; }
.phone-mock.phone-mock-sm .dynamic-island .mic { width: 3px; height: 3px; }
.phone-mock.phone-mock-sm .plp-hero { padding: 1rem 0.75rem 0.875rem; }
.phone-mock.phone-mock-sm .plp-hero .plp-icon { width: 32px; height: 32px; font-size: 0.875rem; margin-bottom: 0.375rem; }
.phone-mock.phone-mock-sm .plp-hero .plp-title { font-size: 0.6875rem; }
.phone-mock.phone-mock-sm .plp-body { padding: 0.5rem; }
.phone-mock.phone-mock-sm .plp-field { padding: 0.375rem 0.5rem; }
.phone-mock.phone-mock-sm .plp-field .plp-label { font-size: 0.5rem; }
.phone-mock.phone-mock-sm .plp-field .plp-value { font-size: 0.5625rem; }
.phone-mock.phone-mock-sm .plp-redirect { padding: 1rem 0.75rem; }
.phone-mock.phone-mock-sm .plp-redirect .plp-icon { width: 40px; height: 40px; font-size: 1rem; margin-bottom: 0.5rem; }
.phone-mock.phone-mock-sm .plp-redirect .plp-title { font-size: 0.75rem; }
.phone-mock.phone-mock-sm .plp-redirect .plp-sub { font-size: 0.5625rem; }

@media (max-width: 575.98px) {
  .phone-mock.phone-mock-sm .phone-bezel {
    max-width: 220px;
    padding: 6px;
    border-radius: 24px;
  }
}

/* Homepage hero phone is a standalone marketing visual (not next to a
   filter sidebar like the dashboard's create-qr phone), so it can afford
   to be noticeably bigger - the default 300px cap felt small/cramped here. */
.phone-mock.phone-mock-lg {
  max-width: 380px;
}
.phone-mock.phone-mock-lg .phone-bezel {
  max-width: 380px;
  padding: 14px;
}
@media (max-width: 575.98px) {
  .phone-mock.phone-mock-lg,
  .phone-mock.phone-mock-lg .phone-bezel {
    max-width: 300px;
  }
}

.landing-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.875rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--brand-border);
  color: var(--brand-navy); font-size: 0.8125rem; font-weight: 600;
}
.landing-chip i { color: var(--brand-primary); }

.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 3rem 3rem; border-radius: var(--bs-border-radius-2xl);
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-hover) 100%);
  color: #fff; position: relative; overflow: hidden;
}
.cta-band::before {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--brand-primary-rgb), 0.12), transparent 60%);
  pointer-events: none;
}
.cta-band h2 { color: #fff; margin: 0 0 0.5rem; font-size: clamp(1.5rem, 2.5vw, 2rem); letter-spacing: -0.03em; }
.cta-band p { color: rgba(255, 255, 255, 0.75); margin: 0; line-height: 1.7; font-size: 0.9375rem; max-width: 500px; }

/* ── Auth Pages ── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem; position: relative; overflow: hidden;
}
.auth-wrap::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at top left, rgba(var(--brand-primary-rgb), 0.15), transparent 35%),
    radial-gradient(circle at bottom right, rgba(var(--brand-navy-rgb), 0.1), transparent 30%);
  pointer-events: none;
}
.auth-card {
  position: relative; width: 100%; max-width: 480px;
  background: #fff; border-radius: var(--bs-border-radius-2xl);
  padding: 2.5rem; border: 1px solid var(--brand-border);
  box-shadow: var(--shadow-xl);
  animation: authIn 0.5s var(--ease-out);
  overflow: hidden;
}
@keyframes authIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Landing Animations ── */
.animate-fade-in { animation: fadeInUp 0.6s var(--ease-out) both; }
@keyframes fadeInUp {
  from { opacity:0; transform:translateY(24px); }
  to { opacity:1; transform:translateY(0); }
}
.animate-float { animation: float 4s var(--ease-out) infinite; }
.animate-slide-right { animation: slideInRight 0.7s var(--ease-out) both; }
@keyframes slideInRight {
  from { opacity:0; transform:translateX(60px); }
  to { opacity:1; transform:translateX(0); }
}
@keyframes float {
  0%,100% { transform:translateY(0); }
  50% { transform:translateY(-8px); }
}
.landing-hero .btn { transition: all 0.3s var(--ease-out); }
.landing-hero .btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(var(--brand-navy-rgb),0.12); }
.landing-hero .btn-primary:hover { box-shadow: 0 12px 28px rgba(var(--brand-primary-rgb),0.3); }
.auth-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-navy));
  border-radius: var(--bs-border-radius-2xl) var(--bs-border-radius-2xl) 0 0;
  z-index: 0;
}
.auth-card h2 { margin-top: 0; font-size: 1.75rem; color: var(--brand-navy); letter-spacing: -0.03em; }
.auth-card .auth-lead { color: var(--brand-muted); margin: 0 0 1.5rem; line-height: 1.6; }
.auth-kicker {
  display: flex; align-items: center; gap: 0.5rem; justify-content: flex-start;
  padding: 0.75rem 2.5rem;
  background: var(--brand-primary-light); color: var(--brand-navy);
  font-weight: 700; font-size: 0.8125rem;
  margin: -2.5rem -2.5rem 1.5rem;
  margin-top: -2.5625rem;
  margin-left: -2.5625rem;
  margin-right: -2.5625rem;
  border-radius: var(--bs-border-radius-2xl) var(--bs-border-radius-2xl) 0 0;
  border: 1px solid var(--brand-border);
  border-bottom: none;
  position: relative;
  z-index: 1;
}
.auth-kicker i { color: var(--brand-primary); }
.auth-link { color: var(--brand-primary); font-weight: 700; }
.auth-link:hover { color: var(--brand-navy); }

/* ── QR Tooltip ── */
.qr-tooltip {
  position:fixed; z-index:9999; background:#fff; padding:12px; border-radius:12px;
  box-shadow:0 8px 32px rgba(var(--brand-navy-rgb),0.18); border:1px solid var(--brand-border);
  max-width:260px; animation: tooltipIn 0.2s var(--ease-out);
}
.qr-tooltip img {width:120px;height:120px;border-radius:8px;object-fit:cover;margin-bottom:8px;}
.qr-tooltip .tooltip-name {font-weight:600;color:var(--brand-navy);margin-bottom:4px;word-break:break-word;}
.qr-tooltip .tooltip-url {font-size:0.75rem;color:var(--brand-muted);word-break:break-all;}
.qr-tooltip .tooltip-copy {margin-top:8px;padding-top:8px;border-top:1px solid var(--brand-border);font-size:0.75rem;color:var(--brand-primary);cursor:pointer;text-align:center;}
@keyframes tooltipIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Toast ── */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Utilities ── */
.text-muted { color: var(--brand-muted) !important; }
.text-primary { color: var(--brand-primary) !important; }
.text-navy { color: var(--brand-navy) !important; }
.text-danger { color: var(--brand-danger) !important; }
.text-danger:hover { color: #fff !important; background: var(--brand-danger) !important; }
.text-danger.btn-action-icon:hover,
.text-danger.btn:hover {
  background: var(--brand-danger) !important;
  border-color: var(--brand-danger) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.24);
}
.text-danger:is(a, button, .btn):hover {
  background: var(--brand-danger) !important;
  color: #fff !important;
}
.text-danger:is(a, button, .btn):not(.btn-action-icon):hover {
  border-color: var(--brand-danger) !important;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.24);
}
.text-success { color: var(--brand-success) !important; }
.text-warning { color: var(--brand-warning) !important; }
.text-warning:hover { color: #fff !important; background: var(--brand-warning) !important; }
.text-warning:is(a, button, .btn):hover {
  background: var(--brand-warning) !important;
  border-color: var(--brand-warning) !important;
  color: #fff !important;
}
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-medium { font-weight: 500 !important; }

/* ── Stat Card Icon Box ── */
.stat-icon-box {
  width: 48px; height: 48px; border-radius: var(--bs-border-radius);
  display: flex; align-items: center; justify-content: center; font-size: 1.125rem;
  flex-shrink: 0;
}
.stat-icon-box.primary { background: var(--brand-primary-light); color: var(--brand-primary); }
.stat-icon-box.success { background: rgba(34, 197, 94, 0.12); color: var(--brand-success); }
.stat-icon-box.warning { background: rgba(245, 158, 11, 0.12); color: var(--brand-warning); }
.stat-icon-box.info { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }

/* ── Section Title ── */
.section-title {
  font-size: 0.9375rem; font-weight: 700; color: var(--brand-navy); margin: 0;
}

/* ── Preview Glass Card ── */
.preview-glass {
  background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(247,249,252,0.9));
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--bs-border-radius-xl);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.5);
}
.preview-glass:hover { box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255,255,255,0.5); }

/* ── Sticky Preview Sidebar ── */
.sticky-preview {
  position: sticky; top: 2rem; z-index: 10;
}
.sticky-preview .phone-mock {
  position: static;
}

/* ── Two-Row Preview Layout ── */
.preview-layout .row + .row { margin-top: 0.5rem; }
@media (max-width: 991.98px) {
  .sticky-preview { position: static; }
}

/* ── Status Pulse Dot ── */
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand-success);
}
.pulse-dot.warning { background: var(--brand-warning); }
.pulse-dot.danger { background: var(--brand-danger); }

/* ── Color Picker Group ── */
.color-picker-group {
  display: flex; align-items: center; gap: 0.75rem;
  background: #fff; border: 1px solid var(--brand-border-light);
  border-radius: var(--bs-border-radius); padding: 0.5rem 0.75rem;
  transition: all 0.2s var(--ease-out);
}
.color-picker-group:hover { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.1); }
.color-picker-group:focus-within { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.15); }
.color-picker-group input[type="color"] {
  width: 36px; height: 36px; padding: 2px; border: 2px solid var(--brand-border);
  border-radius: var(--bs-border-radius-sm); cursor: pointer; background: none;
  transition: border-color 0.2s var(--ease-out);
}
.color-picker-group input[type="color"]:hover { border-color: var(--brand-primary); }
.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper { padding: 1px; }
.color-picker-group input[type="color"]::-webkit-color-swatch { border-radius: 6px; border: none; }
.color-picker-group .color-hex {
  font-size: 0.8125rem; font-weight: 600; color: var(--brand-navy);
  font-family: 'SF Mono', 'Consolas', monospace; letter-spacing: 0.02em;
  min-width: 4.5rem;
}
.color-picker-group .color-name {
  font-size: 0.6875rem; color: var(--brand-muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* ── Table Enhancements ── */
.table-wrap {
  border-radius: var(--bs-border-radius-lg);
  border: 1px solid var(--brand-border);
  overflow: hidden; background: #fff;
}
.table-wrap .table { margin-bottom: 0; }
.table-wrap .table thead th {
  background: var(--brand-bg); position: sticky; top: 0; z-index: 1;
}

/* ── Responsive Tables (card layout on mobile) ── */
@media (max-width: 767.98px) {
  .table-responsive-card thead { display: none; }
  .table-responsive-card tbody tr {
    display: block;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s var(--ease-out);
  }
  .table-responsive-card tbody tr:hover { box-shadow: var(--shadow-md); }
  .table-responsive-card tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border: none;
    font-size: 0.8125rem;
  }
  .table-responsive-card tbody td:not(:last-child) { border-bottom: 1px solid var(--brand-border-light); }
  .table-responsive-card tbody td::before {
    content: attr(data-label);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-muted);
    flex-shrink: 0;
    min-width: 60px;
  }
  .table-responsive-card tbody td:empty { display: none; }
  .table-responsive-card tbody td:last-child {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.375rem;
    border-bottom: none;
    padding-top: 0.75rem;
  }
  .table-responsive-card tbody td:last-child::before { content: 'Actions'; }
  .table-responsive-card tbody td .d-flex.gap-1 { flex-wrap: wrap; }
}

@media (max-width: 991.98px) and (min-width: 768px) {
  .table-hide-tablet { display: none !important; }
}

@media (max-width: 767.98px) {
  .table-hide-mobile { display: none !important; }
}

/* ── Filter Card ── */
.filter-card .form-label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--brand-muted); font-weight: 600; margin-bottom: 0.375rem;
}

/* ── Page Header Pattern ── */
.page-top {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem;
}
.page-top h1 { margin: 0; }
.page-top .page-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.powered-badge {
  position: fixed;
  bottom: 10px;
  right: 12px;
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  z-index: 999;
  pointer-events: none;
}

/* ── RTL ── */
body.rtl .sidebar { left: auto; right: 0; }
body.rtl .main-content { margin-left: 0; margin-right: var(--sidebar-w); }
body.rtl .wizard-steps .arrow { transform: scaleX(-1); }
body.rtl .input-group:not(.has-validation) > .form-control:not(:last-child) { border-radius: 0 0.375rem 0.375rem 0; }
body.rtl .input-group > .input-group-text:first-child { border-radius: 0 0.375rem 0.375rem 0; }
body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4, body.rtl h5, body.rtl h6 { font-family: var(--font-cairo); }

/* ── Responsive ── */

/* Sidebar toggle button (mobile/tablet) */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 99;
  width: 40px;
  height: 40px;
  border-radius: var(--bs-border-radius);
  background: var(--brand-navy);
  border: none;
  color: #fff;
  font-size: 1.125rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  box-shadow: var(--shadow-md);
}
.sidebar-toggle:hover {
  background: var(--brand-navy-hover);
  transform: translateY(-1px);
}

/* Sidebar close button (mobile only) */
.sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: var(--bs-border-radius-sm);
  background: rgba(255,255,255,0.1);
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.sidebar-close:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.sidebar-overlay.show {
  opacity: 1;
}

@media (max-width: 991.98px) {
  .sidebar-toggle { display: inline-flex; }
  .sidebar-close { display: inline-flex; }
  .sidebar-overlay { display: block; pointer-events: none; }
  .sidebar-overlay.show { pointer-events: auto; }

  .main-content { margin-left: 0; padding: 1.5rem 1rem; padding-top: 64px; }
  .sidebar {
    width: min(var(--sidebar-w), 85vw);
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out);
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  body.rtl .sidebar { transform: translateX(100%); left: auto; right: 0; }
  body.rtl .sidebar.open { transform: translateX(0); }
  body.rtl .main-content { margin-right: 0; }

  .cta-band { flex-direction: column; align-items: flex-start; padding: 2rem 1.5rem; }
  .hero-title { font-size: clamp(2.2rem, 8vw, 3.5rem); }
  .hero-lead { font-size: 1rem; }
  .hero-stats { justify-content: center; }
  .landing-hero { padding: 2rem 0 3rem; }
}

@media (max-width: 767.98px) {
  .page-header h1 { font-size: 1.5rem; }
  .page-top { flex-direction: column; align-items: flex-start; }
  .page-top .page-actions { width: 100%; }
  .page-top .page-actions .btn { flex: 1; }

  .auth-card, .auth-card-enhanced { padding: 1.5rem; }
  .auth-kicker { margin: -1.5rem -1.5625rem 1.5rem; padding: 0.75rem 1.5rem; }
  .auth-card-enhanced h2 { font-size: 1.25rem; }

  .stat-card-gradient .stat-value { font-size: 1.5rem; }
  .stat-card-gradient { padding: 1.25rem; }

  .wizard-steps { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; }
  .wizard-steps .step { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; }

  .card-header { padding: 1rem 1.25rem; }
  .card-body { padding: 1.25rem; }

  .analytics-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .analytics-tab { flex: 0 0 auto; white-space: nowrap; }

  .type-card { padding: 1rem 0.75rem; }
  .type-card .icon { width: 40px; height: 40px; font-size: 1rem; }

  .table thead th, .table tbody td { padding: 0.5rem 0.625rem; white-space: nowrap; }
  .table-responsive { border-radius: var(--bs-border-radius); }

  .cta-band h2 { font-size: 1.25rem; }
  .cta-band p { font-size: 0.8125rem; }

  .phone-preview-sticky { margin-top: 1.5rem; }
  .sticky-preview { position: static; }

  .color-picker-group { padding: 0.375rem 0.5rem; }
  .color-picker-group input[type="color"] { width: 28px; height: 28px; }

  .preview-glass { padding: 1rem !important; }

  .empty-state { padding: 2rem 1rem; }
  .empty-state-icon { width: 56px; height: 56px; font-size: 1.25rem; }

  .modal-dialog { margin: 0.5rem; }
  .modal-content { border-radius: var(--bs-border-radius-xl); }
  .modal-body { padding: 1.25rem; }
  .modal-header { padding: 1rem 1.25rem; }

  .drop-zone { padding: 1.25rem; }

  .qr-preview-modal-content { max-width: 100%; margin: 1rem; border-radius: var(--bs-border-radius-xl); }
  .qr-preview-modal-body img { max-width: 180px; }
}

@media (max-width: 575.98px) {
  .wizard-steps .step { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
  .wizard-steps .step .num { width: 18px; height: 18px; font-size: 0.625rem; }

  .page-top h1 { font-size: 1.25rem; }

  .auth-card, .auth-card-enhanced { padding: 1.25rem; border-radius: var(--bs-border-radius-xl); }
  .auth-wrap-enhanced, .auth-wrap { padding: 1rem 0.75rem; }

  .stat-card-gradient .stat-value { font-size: 1.25rem; }
  .stat-card-gradient { padding: 1rem; }

  .btn { padding: 0.5rem 1rem; font-size: 0.8125rem; }
  .btn-action-icon { width: 36px; height: 36px; font-size: 0.875rem; }

  .row.g-3 > [class*="col-"] { padding-bottom: 0; }
  .row.g-3 { --bs-gutter-y: 0.75rem; }

  .table thead th { font-size: 0.6875rem; padding: 0.5rem; }
  .table tbody td { padding: 0.5rem; font-size: 0.8125rem; }

  .card-title { font-size: 1rem; }
  .section-title { font-size: 0.875rem; }

  .filter-card .row.g-2 > [class*="col-"] { flex: 0 0 100%; }
}

@media (max-width: 400px) {
  .sidebar { width: 100vw; }
  .main-content { padding: 1rem 0.75rem; padding-top: 60px; }
  .sidebar-toggle { top: 10px; left: 10px; width: 36px; height: 36px; font-size: 1rem; }
  .hero-title { font-size: clamp(1.8rem, 10vw, 2.2rem); }
  .landing-hero { padding: 1rem 0 2rem; }
}

/* ── FilePond ── */
.filepond--root { min-height: 160px; }
.filepond--drop-label { color: var(--brand-navy); font-weight: 600; font-size: 0.9375rem; padding: 1.5rem; cursor: pointer; }
.filepond--drop-label:hover { color: var(--brand-primary); }
.filepond--label-action { color: var(--brand-primary) !important; text-decoration: none !important; transition: all 0.2s var(--ease-out); }
.filepond--label-action:hover { color: var(--brand-primary-dark) !important; text-decoration: underline !important; }
.filepond--panel-root { background: var(--brand-bg); border: 2px dashed var(--brand-border); border-radius: var(--bs-border-radius-lg); transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out); }
.filepond--root:hover .filepond--panel-root { border-color: var(--brand-primary); background: rgba(var(--brand-primary-rgb),0.03); }
.filepond--root.filepond--hopper[data-hopper-state=drag-over] .filepond--panel-root { border-color: var(--brand-primary); background: rgba(var(--brand-primary-rgb),0.08); }
.filepond--drip-blob { background: var(--brand-navy); opacity: 0.08; }
.filepond--item-panel { background: var(--brand-navy); border-radius: 10px; }
.filepond--file-info .filepond--file-info-main { font-size: 0.8125rem; font-weight: 600; color: #fff; }
.filepond--file-info .filepond--file-info-sub { font-size: 0.6875rem; color: rgba(255,255,255,0.7); }
.filepond--file-action-button { background: rgba(255,255,255,0.2); border-radius: 50%; cursor: pointer; transition: background 0.2s var(--ease-out); }
.filepond--file-action-button:hover { background: rgba(255,255,255,0.35); }
.filepond--file-wrapper { cursor: default; }
.filepond--progress-indicator { color: #fff; }
.filepond--file { border-radius: 10px; }
.filepond--list-scroller { margin-top: 0.5rem; }
.filepond--file-status { font-size: 0.75rem; color: var(--brand-muted); }
/* FilePond on dark backgrounds */
.bg-brand-dark .filepond--drop-label { color: #fff; }
.bg-brand-dark .filepond--label-action { color: var(--brand-primary-light) !important; }
.bg-brand-dark .filepond--panel-root { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.15); }
.bg-brand-dark .filepond--root:hover .filepond--panel-root { border-color: var(--brand-primary-light); background: rgba(255,255,255,0.08); }

/* ── Modern Preview Card Styles ── */
.preview-card { transition:all 0.4s var(--ease-out); }
.preview-card:hover { box-shadow:var(--shadow-xl); transform:translateY(-2px); }
.qr-preview-wrapper img { transition:all 0.3s var(--ease-out); }
.preview-card:hover .qr-preview-wrapper img { transform:scale(1.02); box-shadow:var(--shadow-lg); }
.status-indicator .pulse-dot { animation:pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:0.5;transform:scale(1.2);} }
.preview-info { display:flex;justify-content:center;gap:1rem; }
.text-xs { font-size:0.6875rem; text-transform:uppercase; letter-spacing:0.05em; }
.text-sm { font-size:0.8125rem; }
.preview-fg, .preview-bg { font-variant-numeric:tabular-nums; }

/* ── Legacy CSS variable aliases ── */
:root {
  --color-primary: var(--brand-primary);
  --color-primary-hover: var(--brand-primary-hover);
  --color-primary-light: var(--brand-primary-light);
  --color-primary-strong: var(--brand-primary-strong);
  --color-secondary: var(--brand-navy);
  --color-secondary-hover: var(--brand-navy-hover);
  --color-secondary-light: var(--brand-navy-light);
  --color-white: var(--brand-white);
  --color-bg-primary: var(--brand-bg);
  --color-text-primary: var(--brand-navy);
  --color-text-muted: var(--brand-muted);
  --color-border-light: var(--brand-border);
  --color-success: var(--brand-success);
  --color-warning: var(--brand-warning);
  --color-danger: var(--brand-danger);
  --brand-cyan: var(--brand-primary);
  --brand-cyan-dark: var(--brand-primary-hover);
  --brand-navy-2: var(--brand-navy-hover);
  --brand-surface: var(--brand-white);
  --brand-soft: var(--brand-primary-light);
  --brand-soft-strong: var(--brand-primary-strong);
  --brand-green: var(--brand-primary);
  --brand-green-dark: var(--brand-navy);
  --brand-green-light: var(--brand-primary-light);
  --text-dark: var(--brand-navy);
  --text-muted: var(--brand-muted);
  --border-color: var(--brand-border);
  --bg-app: var(--brand-bg);
  --danger: var(--brand-danger);
  --radius: var(--bs-border-radius-lg);
  --radius-lg: var(--bs-border-radius-2xl);
  --shadow-soft: var(--shadow-lg);
  --shadow-strong: var(--shadow-2xl);
  --sidebar-w: 280px;
}
