/* =========================================================
   Rewaq Dashboard — Custom Styles
   Arabic-first, RTL, light/dark
   ========================================================= */

/* NOTE: --brand-rgb is intentionally NOT set here. It is defined in
   themes.css via the `:root, [data-color="indigo"]` rule (default) and
   overridden by the per-brand `[data-color="emerald|rose|...]` rules.
   Setting it again in style.css would override those (same specificity,
   later cascade) and freeze the brand color to indigo. */

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[x-cloak] { display: none !important; }

body {
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.005em;
}

/* Tabular numerals for stats / tables */
.numerals,
.tabular {
  font-variant-numeric: tabular-nums;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgb(203 213 225 / 0.6);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgb(148 163 184 / 0.7); background-clip: padding-box; }
.dark ::-webkit-scrollbar-thumb { background: rgb(51 65 85 / 0.7); background-clip: padding-box; }
.dark ::-webkit-scrollbar-thumb:hover { background: rgb(71 85 105 / 0.9); background-clip: padding-box; }

/* Firefox scrollbar (no ::-webkit-scrollbar support). */
html { scrollbar-width: thin; scrollbar-color: rgb(203 213 225 / 0.8) transparent; }
html.dark { scrollbar-color: rgb(71 85 105 / 0.85) transparent; }

/* Focus ring polish */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid rgb(var(--brand-rgb) / 0.7);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

/* Accessible "Skip to main content" link — only visible when focused */
.skip-to-content {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 0.6rem 1rem;
  background: rgb(var(--brand-500));
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 0.75rem 0.75rem;
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.15);
  text-decoration: none;
  transition: top .15s ease;
}
.skip-to-content:focus,
.skip-to-content:focus-visible {
  top: 0;
  outline: none;
}

/* Sidebar nav active state */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.75rem;
  color: rgb(71 85 105);
  font-weight: 500;
  font-size: 0.925rem;
  transition: background-color .15s ease, color .15s ease;
}
.dark .nav-link { color: rgb(148 163 184); }
.nav-link:hover { background: rgb(241 245 249); color: rgb(15 23 42); }
.dark .nav-link:hover { background: rgb(30 41 59); color: rgb(241 245 249); }

.nav-link.active {
  background: linear-gradient(135deg, rgb(var(--brand-rgb) / 0.10), rgb(var(--brand-rgb) / 0.04));
  color: rgb(var(--brand-700));
  font-weight: 600;
}
.dark .nav-link.active {
  background: linear-gradient(135deg, rgb(var(--brand-rgb) / 0.18), rgb(var(--brand-rgb) / 0.06));
  color: rgb(var(--brand-200));
}
.nav-link.active .nav-icon { color: rgb(var(--brand-rgb)); }

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgb(148 163 184);
  padding: 0 0.85rem;
  margin: 1rem 0 0.5rem;
}
.dark .nav-section-title { color: rgb(100 116 139); }

/* Card */
.card {
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: 1rem;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.04), 0 1px 3px 0 rgb(15 23 42 / 0.06);
}
.dark .card {
  background: rgb(30 41 59);
  border-color: rgb(51 65 85);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.25);
}

/* Soft badge variants */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem; font-weight: 600;
  border-radius: 9999px;
  line-height: 1;
}
.badge-success { background: rgb(220 252 231); color: rgb(22 101 52); }
.dark .badge-success { background: rgb(20 83 45 / 0.4); color: rgb(134 239 172); }
.badge-warning { background: rgb(254 243 199); color: rgb(133 77 14); }
.dark .badge-warning { background: rgb(120 53 15 / 0.4); color: rgb(253 224 71); }
.badge-danger  { background: rgb(254 226 226); color: rgb(153 27 27); }
.dark .badge-danger  { background: rgb(127 29 29 / 0.4); color: rgb(252 165 165); }
.badge-info    { background: rgb(219 234 254); color: rgb(30 64 175); }
.dark .badge-info    { background: rgb(30 58 138 / 0.4); color: rgb(147 197 253); }
.badge-neutral { background: rgb(241 245 249); color: rgb(51 65 85); }
.dark .badge-neutral { background: rgb(51 65 85); color: rgb(203 213 225); }

/* Button base */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.925rem;
  padding: 0.55rem 1rem;
  border-radius: 0.75rem;
  transition: all .15s ease;
  cursor: pointer;
}
.btn-primary {
  background: rgb(var(--brand-rgb));
  color: white;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}
.btn-primary:hover { background: rgb(var(--brand-700)); }
.btn-primary:active { transform: translateY(1px); }
.btn-outline {
  background: white;
  border: 1px solid rgb(226 232 240);
  color: rgb(51 65 85);
}
.dark .btn-outline { background: rgb(30 41 59); border-color: rgb(51 65 85); color: rgb(203 213 225); }
.btn-outline:hover { background: rgb(248 250 252); }
.dark .btn-outline:hover { background: rgb(51 65 85); }
.btn-ghost { background: transparent; color: rgb(71 85 105); }
.dark .btn-ghost { color: rgb(203 213 225); }
.btn-ghost:hover { background: rgb(241 245 249); }
.dark .btn-ghost:hover { background: rgb(51 65 85); }

/* Inputs */
.input, .select, .textarea {
  width: 100%;
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.75rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.925rem;
  color: rgb(15 23 42);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dark .input, .dark .select, .dark .textarea {
  background: rgb(15 23 42);
  border-color: rgb(51 65 85);
  color: rgb(241 245 249);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: rgb(var(--brand-rgb));
  box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / 0.18);
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table thead th {
  text-align: start;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgb(100 116 139);
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgb(226 232 240);
  background: rgb(248 250 252);
}
.dark .table thead th { color: rgb(148 163 184); border-color: rgb(51 65 85); background: rgb(15 23 42 / 0.5); }
.table tbody td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgb(241 245 249);
  font-size: 0.925rem;
}
.dark .table tbody td { border-color: rgb(51 65 85 / 0.6); }
.table tbody tr:hover { background: rgb(248 250 252); }
.dark .table tbody tr:hover { background: rgb(15 23 42 / 0.5); }
.table tbody tr:last-child td { border-bottom: 0; }

/* Stat trend pill */
.trend-up   { color: rgb(22 163 74); background: rgb(220 252 231); }
.dark .trend-up   { color: rgb(134 239 172); background: rgb(20 83 45 / 0.35); }
.trend-down { color: rgb(220 38 38); background: rgb(254 226 226); }
.dark .trend-down { color: rgb(252 165 165); background: rgb(127 29 29 / 0.35); }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, rgb(226 232 240) 0%, rgb(241 245 249) 50%, rgb(226 232 240) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 0.5rem;
}
.dark .skeleton {
  background: linear-gradient(90deg, rgb(30 41 59) 0%, rgb(51 65 85) 50%, rgb(30 41 59) 100%);
  background-size: 200% 100%;
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* Apex tooltip RTL fix */
.apexcharts-tooltip { direction: rtl; text-align: right; }
.apexcharts-tooltip-title { text-align: right !important; }

/* Sidebar transitions */
.sidebar { transition: transform .25s ease, width .25s ease; }

/* =========================================================
   Direction-aware layout (RTL Arabic vs LTR English)
   Sidebar is anchored to the start edge; main content is
   offset by the sidebar width on the same edge.
   ========================================================= */
[dir="rtl"] .side-start { right: 0; left: auto; }
[dir="ltr"] .side-start { left: 0; right: auto; }
[dir="ltr"] .sidebar { border-left: 0; border-right: 1px solid rgb(226 232 240); }
[dir="ltr"].dark .sidebar,
[dir="ltr"] .dark .sidebar { border-right-color: rgb(30 41 59); }

/* Main content offset by sidebar width on the start edge (lg+).
 * Shrinks to the slim sidebar width when html[data-sidebar="collapsed"]
 * is set by the layout store (Alpine.store('layout').sidebarCollapsed,
 * persisted in localStorage). The matching <html> attribute is also
 * applied pre-paint by the inline script in _head.html to avoid any
 * margin jump on the very first frame. */
.main-shift { transition: margin .2s ease; }
@media (min-width: 1024px) {
  [dir="rtl"] .main-shift { margin-right: 260px; }
  [dir="ltr"] .main-shift { margin-left: 260px; }
  [dir="rtl"][data-sidebar="collapsed"] .main-shift { margin-right: 76px; }
  [dir="ltr"][data-sidebar="collapsed"] .main-shift { margin-left: 76px; }
}

/* Flip directional glyphs (chevrons, arrows) in LTR mode. */
[dir="ltr"] .rtl-flip { transform: scaleX(-1); }

/* In LTR, switch font family to Inter primary for Latin readability. */
[dir="ltr"] body { font-family: 'Inter', 'Tajawal', ui-sans-serif, system-ui, sans-serif; letter-spacing: 0; }

/* Apex tooltip direction follows page direction. */
[dir="ltr"] .apexcharts-tooltip { direction: ltr; text-align: left; }
[dir="ltr"] .apexcharts-tooltip-title { text-align: left !important; }

/* Avatar gradient backgrounds */
.avatar-grad-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.avatar-grad-2 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.avatar-grad-3 { background: linear-gradient(135deg, #10b981, #06b6d4); }
.avatar-grad-4 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.avatar-grad-5 { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.avatar-grad-6 { background: linear-gradient(135deg, #8b5cf6, #ec4899); }

/* Kanban */
.kanban-card {
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.75rem;
  padding: 0.85rem;
  cursor: grab;
  transition: box-shadow .15s ease, transform .15s ease;
}
.kanban-card:hover { box-shadow: 0 6px 14px -4px rgb(15 23 42 / 0.12); transform: translateY(-1px); }
.dark .kanban-card { background: rgb(30 41 59); border-color: rgb(51 65 85); }

/* Calendar */
.calendar-cell {
  min-height: 96px;
  padding: 0.5rem;
  border: 1px solid rgb(226 232 240);
  font-size: 0.875rem;
  transition: background-color .12s ease;
}
.dark .calendar-cell { border-color: rgb(51 65 85); }
.calendar-cell:hover { background: rgb(248 250 252); }
.dark .calendar-cell:hover { background: rgb(15 23 42 / 0.5); }
.calendar-cell.today { background: rgb(99 102 241 / 0.06); border-color: rgb(99 102 241 / 0.3); }
.dark .calendar-cell.today { background: rgb(99 102 241 / 0.15); border-color: rgb(99 102 241 / 0.4); }
.calendar-cell.muted { color: rgb(148 163 184); background: rgb(248 250 252 / 0.4); }
.dark .calendar-cell.muted { color: rgb(71 85 105); background: rgb(15 23 42 / 0.3); }

/* Chat */
.chat-bubble-in,
.chat-bubble-out {
  padding: 0.6rem 0.9rem;
  border-radius: 1rem;
  max-width: 75%;
  font-size: 0.925rem;
  line-height: 1.55;
}
.chat-bubble-in  { background: rgb(241 245 249); color: rgb(15 23 42); border-bottom-right-radius: 0.25rem; }
.dark .chat-bubble-in { background: rgb(51 65 85); color: rgb(241 245 249); }
.chat-bubble-out { background: rgb(99 102 241); color: white; border-bottom-left-radius: 0.25rem; }

/* Typing indicator dots */
@keyframes pulse-dot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.85); }
  30%           { opacity: 1;   transform: scale(1.1); }
}
.animate-pulse-dot { animation: pulse-dot 1.2s ease-in-out infinite; }

/* Utility: hide scrollbar but allow scroll */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* Mobile-friendly order card list (replaces tables on small screens).
   NOTE: we intentionally do NOT set display here so that the `md:hidden`
   Tailwind utility can hide the list on md+ without specificity battles
   (style.css is loaded after tailwind.css). The default block layout of
   <ul>/<div> stacks items vertically, which is exactly what we want. */
.order-card-list > * + * { border-top: 1px solid rgb(241 245 249); }
.dark .order-card-list > * + * { border-top-color: rgb(51 65 85 / 0.6); }

/* Print */
@media print {
  .no-print { display: none !important; }
  .print-only { display: block !important; }
  body { background: white !important; color: black !important; }
  .card { box-shadow: none !important; border: 1px solid #e5e7eb !important; }
}
.print-only { display: none; }

/* =========================================================
   Theme Customizer — Radius variants
   ========================================================= */
[data-radius="none"] { --radius-scale: 0; }
[data-radius="sm"]   { --radius-scale: 0.5; }
[data-radius="md"]   { --radius-scale: 0.75; }
[data-radius="lg"]   { --radius-scale: 1; }
[data-radius="xl"]   { --radius-scale: 1.25; }

[data-radius] .card { border-radius: calc(1rem * var(--radius-scale, 1)); }
[data-radius] .btn,
[data-radius] .badge,
[data-radius] input.input,
[data-radius] select.select { border-radius: calc(0.75rem * var(--radius-scale, 1)); }

/* =========================================================
   Theme Customizer — Layout variants
   ========================================================= */
/* Horizontal nav layout (hide sidebar, show topbar nav) */
[data-layout="horizontal"] .sidebar { display: none !important; }
[data-layout="horizontal"] .main-shift { margin: 0 !important; }
.horizontal-nav { display: none; }
@media (min-width: 1024px) {
  [data-layout="horizontal"] .horizontal-nav { display: block; }
}
/* Compact links inside horizontal bar */
.horizontal-nav .nav-link {
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  border-radius: 0.6rem;
}
.horizontal-nav .nav-link .nav-icon { width: 1rem; height: 1rem; }

/* Compact sidebar (always collapsed to icon rail) */
@media (min-width: 1024px) {
  [data-layout="compact"] .sidebar { width: 72px !important; }
  [data-layout="compact"] .sidebar .nav-link span,
  [data-layout="compact"] .sidebar .nav-section-title,
  [data-layout="compact"] .sidebar .brand-text,
  [data-layout="compact"] .sidebar .upgrade-card { display: none !important; }
  [data-layout="compact"] .sidebar .nav-link { justify-content: center; }
  [dir="rtl"][data-layout="compact"] .main-shift { margin-right: 72px !important; }
  [dir="ltr"][data-layout="compact"] .main-shift { margin-left: 72px !important; }
}

/* =========================================================
   Toast notifications (richer than the simple helper)
   ========================================================= */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 380px;
  padding: 0.875rem 1rem;
  background: white;
  color: rgb(15 23 42);
  border: 1px solid rgb(226 232 240);
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -5px rgb(15 23 42 / 0.12);
  pointer-events: auto;
  animation: toast-in 0.25s cubic-bezier(0.21, 1.02, 0.73, 1);
}
.dark .toast {
  background: rgb(30 41 59);
  color: rgb(241 245 249);
  border-color: rgb(51 65 85);
}
.toast-icon { flex-shrink: 0; width: 1.25rem; height: 1.25rem; }
.toast-success .toast-icon { color: rgb(16 185 129); }
.toast-info .toast-icon    { color: rgb(var(--brand-rgb)); }
.toast-warning .toast-icon { color: rgb(245 158 11); }
.toast-danger .toast-icon  { color: rgb(244 63 94); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}
.toast.is-leaving { animation: toast-out 0.25s ease forwards; }

/* =========================================================
   Skeleton loaders
   ========================================================= */
.skeleton {
  background: linear-gradient(
    90deg,
    rgb(241 245 249) 0%,
    rgb(226 232 240) 50%,
    rgb(241 245 249) 100%
  );
  background-size: 200% 100%;
  border-radius: 0.5rem;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.dark .skeleton {
  background: linear-gradient(
    90deg,
    rgb(30 41 59) 0%,
    rgb(51 65 85) 50%,
    rgb(30 41 59) 100%
  );
  background-size: 200% 100%;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =========================================================
   Command palette (Ctrl+K)
   ========================================================= */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.55);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.cmdk-panel {
  width: 100%;
  max-width: 640px;
  margin: 0 1rem;
  background: white;
  border-radius: 1rem;
  border: 1px solid rgb(226 232 240);
  box-shadow: 0 25px 50px -12px rgb(15 23 42 / 0.35);
  overflow: hidden;
}
.dark .cmdk-panel { background: rgb(30 41 59); border-color: rgb(51 65 85); }
.cmdk-input {
  width: 100%;
  padding: 1rem 3rem;
  font-size: 1rem;
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  border-bottom: 1px solid rgb(226 232 240);
}
.dark .cmdk-input { border-bottom-color: rgb(51 65 85); }
.cmdk-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  border-radius: 0;
  font-size: 0.925rem;
}
.cmdk-result.is-active {
  background: rgb(var(--brand-rgb) / 0.08);
  color: rgb(var(--brand-700));
}
.dark .cmdk-result.is-active {
  background: rgb(var(--brand-rgb) / 0.15);
  color: rgb(var(--brand-200));
}
.cmdk-group-title {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgb(148 163 184);
}
/* Highlight for matched substrings inside Ctrl+K results. */
.cmdk-mark {
  background: rgb(var(--brand-rgb) / 0.18);
  color: inherit;
  padding: 0 1px;
  border-radius: 3px;
  font-weight: 700;
}
.dark .cmdk-mark {
  background: rgb(var(--brand-rgb) / 0.28);
}

/* =========================================================
   Empty state
   ========================================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: rgb(100 116 139);
}
.empty-state-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  background: rgb(var(--brand-rgb) / 0.08);
  color: rgb(var(--brand-rgb));
  margin-bottom: 1rem;
}
.empty-state-title { font-weight: 700; color: rgb(15 23 42); font-size: 1rem; margin-bottom: 0.25rem; }
.dark .empty-state-title { color: rgb(241 245 249); }
.empty-state-desc { font-size: 0.875rem; max-width: 360px; line-height: 1.55; }

/* =========================================================
   Customizer panel (slide-out drawer)
   ========================================================= */
.customizer-fab {
  position: fixed;
  bottom: 1.25rem;
  z-index: 50;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: rgb(var(--brand-rgb));
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 25px -5px rgb(var(--brand-rgb) / 0.45);
  transition: transform .15s ease;
}
.customizer-fab:hover { transform: scale(1.07); }
[dir="rtl"] .customizer-fab { left: 1.25rem; }
[dir="ltr"] .customizer-fab { right: 1.25rem; }

.customizer-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 360px;
  max-width: 92vw;
  background: white;
  z-index: 60;
  box-shadow: -10px 0 30px -10px rgb(15 23 42 / 0.2);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
}
[dir="rtl"] .customizer-drawer { left: 0; transform: translateX(-100%); }
[dir="ltr"] .customizer-drawer { right: 0; transform: translateX(100%); }
[dir="rtl"] .customizer-drawer.is-open { transform: translateX(0); }
[dir="ltr"] .customizer-drawer.is-open { transform: translateX(0); }
.dark .customizer-drawer { background: rgb(15 23 42); }

.customizer-color-swatch {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .12s ease;
  position: relative;
}
.customizer-color-swatch:hover { transform: scale(1.06); }
.customizer-color-swatch.is-active {
  border-color: white;
  box-shadow: 0 0 0 2px currentColor;
}

.customizer-layout-option,
.customizer-radius-option {
  /* Reset native button look so these can be real <button> elements with
     proper keyboard activation & a11y semantics, while keeping the original
     "pill" visual. */
  appearance: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
  border: 1.5px solid rgb(226 232 240);
  border-radius: 0.625rem;
  padding: 0.625rem 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgb(71 85 105);
  transition: all .15s ease;
}
.dark .customizer-layout-option,
.dark .customizer-radius-option { border-color: rgb(51 65 85); color: rgb(148 163 184); }
.customizer-layout-option:hover,
.customizer-radius-option:hover {
  border-color: rgb(var(--brand-rgb) / 0.5);
  color: rgb(var(--brand-rgb));
}
.customizer-layout-option.is-active,
.customizer-radius-option.is-active {
  background: rgb(var(--brand-rgb) / 0.08);
  border-color: rgb(var(--brand-rgb));
  color: rgb(var(--brand-rgb));
}

/* =========================================================
   Onboarding tour
   ========================================================= */
.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.65);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.tour-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.tour-spot {
  position: fixed;
  border-radius: 12px;
  box-shadow:
    0 0 0 9999px rgb(15 23 42 / 0.7),
    0 0 0 4px rgb(var(--brand-rgb) / 0.55),
    0 0 32px rgb(var(--brand-rgb) / 0.65);
  transition: top .3s ease, left .3s ease, width .3s ease, height .3s ease;
  pointer-events: none;
  display: none;
}

.tour-tooltip {
  position: fixed;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: white;
  border-radius: 14px;
  padding: 18px 18px 14px;
  box-shadow: 0 20px 50px -10px rgb(15 23 42 / 0.4);
  transition: top .3s ease, left .3s ease;
}
.dark .tour-tooltip {
  background: rgb(15 23 42);
  color: rgb(241 245 249);
  box-shadow: 0 20px 50px -10px rgb(0 0 0 / 0.6);
}
.tour-tooltip.is-center {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
}

.tour-progress {
  font-size: 11px;
  font-weight: 700;
  color: rgb(var(--brand-rgb));
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: start;
}
.tour-title {
  font-size: 17px;
  font-weight: 800;
  color: rgb(15 23 42);
  margin: 0 0 6px;
}
.dark .tour-title { color: rgb(241 245 249); }
.tour-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgb(71 85 105);
  margin: 0 0 14px;
}
.dark .tour-desc { color: rgb(148 163 184); }

.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tour-nav { display: flex; gap: 8px; }

.tour-btn-skip,
.tour-btn-prev,
.tour-btn-next {
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s ease;
  font-family: inherit;
}
.tour-btn-skip {
  background: transparent;
  color: rgb(100 116 139);
}
.tour-btn-skip:hover { color: rgb(15 23 42); }
.dark .tour-btn-skip:hover { color: rgb(241 245 249); }

.tour-btn-prev {
  background: transparent;
  color: rgb(71 85 105);
  border-color: rgb(226 232 240);
}
.dark .tour-btn-prev { color: rgb(203 213 225); border-color: rgb(51 65 85); }
.tour-btn-prev:hover:not(:disabled) { background: rgb(241 245 249); }
.dark .tour-btn-prev:hover:not(:disabled) { background: rgb(30 41 59); }
.tour-btn-prev:disabled { opacity: 0.4; cursor: not-allowed; }

.tour-btn-next {
  background: rgb(var(--brand-rgb));
  color: white;
}
.tour-btn-next:hover { background: rgb(var(--brand-700)); }

@media (max-width: 640px) {
  .tour-tooltip {
    width: calc(100vw - 24px) !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 12px !important;
  }
  .tour-tooltip.is-center {
    transform: none;
    top: auto !important;
  }
}

/* =========================================================
   Theme Preset cards (customizer gallery)
   ========================================================= */
.preset-card {
  position: relative;
  border: 1.5px solid rgb(226 232 240);
  border-radius: 0.75rem;
  background: white;
  overflow: hidden;
  cursor: pointer;
  text-align: start;
  transition: all .18s ease;
  display: flex;
  flex-direction: column;
}
.dark .preset-card { border-color: rgb(51 65 85); background: rgb(15 23 42); }
.preset-card:hover {
  border-color: rgb(var(--brand-rgb) / 0.55);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -8px rgb(var(--brand-rgb) / 0.45);
}
.preset-card.is-active {
  border-color: rgb(var(--brand-rgb));
  box-shadow: 0 0 0 2px rgb(var(--brand-rgb) / 0.25);
}
.preset-mini {
  position: relative;
  height: 56px;
  background: linear-gradient(135deg, var(--p1), var(--p2));
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preset-mini-bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgb(255 255 255 / 0.85);
}
.preset-mini-row { flex: 1; display: flex; gap: 4px; min-height: 0; }
.preset-mini-side {
  width: 12px;
  border-radius: 3px;
  background: rgb(255 255 255 / 0.55);
}
.preset-mini-side.is-horizontal {
  width: 100%;
  height: 6px;
  align-self: flex-start;
}
.preset-mini-row:has(.is-horizontal) { flex-direction: column; }
.preset-mini-body {
  flex: 1;
  background: rgb(255 255 255 / 0.9);
  border-radius: 4px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.preset-mini-dot {
  width: 10px; height: 10px;
  border-radius: 999px;
  background: var(--p3);
}
.preset-mini-line {
  height: 3px;
  border-radius: 2px;
  background: rgb(15 23 42 / 0.18);
}
.preset-mini-line.short { width: 60%; }
.preset-mini-check {
  position: absolute;
  top: 4px; left: 4px;
  width: 20px; height: 20px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.95);
  color: rgb(var(--brand-rgb));
  display: grid;
  place-items: center;
  padding: 3px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.18);
}
[dir="rtl"] .preset-mini-check { left: auto; right: 4px; }

/* =========================================================
   Skeleton patterns (composable building blocks)
   ========================================================= */
.skeleton-table {
  border: 1px solid rgb(226 232 240);
  border-radius: 0.75rem;
  overflow: hidden;
}
.dark .skeleton-table { border-color: rgb(51 65 85); }
.skeleton-table-head {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 12px;
  padding: 14px 16px;
  background: rgb(248 250 252);
  border-bottom: 1px solid rgb(226 232 240);
}
.dark .skeleton-table-head { background: rgb(15 23 42 / 0.5); border-bottom-color: rgb(51 65 85); }
.skeleton-table-row {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgb(226 232 240);
}
.dark .skeleton-table-row { border-bottom-color: rgb(30 41 59); }
.skeleton-table-row:last-child { border-bottom: 0; }

.skeleton-stat {
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.75rem;
  padding: 1.25rem;
}
.dark .skeleton-stat { background: rgb(15 23 42); border-color: rgb(51 65 85); }

.skeleton-chart {
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.75rem;
  padding: 1.5rem;
  height: 280px;
  position: relative;
}
.dark .skeleton-chart { background: rgb(15 23 42); border-color: rgb(51 65 85); }
.skeleton-chart-bars {
  position: absolute;
  inset: 80px 20px 30px 20px;
  display: flex;
  align-items: flex-end;
  gap: 6%;
}
.skeleton-chart-bar {
  flex: 1;
  border-radius: 6px 6px 0 0;
}
.skeleton-chart-bar:nth-child(1) { height: 45%; }
.skeleton-chart-bar:nth-child(2) { height: 70%; }
.skeleton-chart-bar:nth-child(3) { height: 30%; }
.skeleton-chart-bar:nth-child(4) { height: 90%; }
.skeleton-chart-bar:nth-child(5) { height: 55%; }
.skeleton-chart-bar:nth-child(6) { height: 75%; }
.skeleton-chart-bar:nth-child(7) { height: 40%; }

.skeleton-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgb(226 232 240);
}
.dark .skeleton-list-item { border-bottom-color: rgb(30 41 59); }
.skeleton-list-item:last-child { border-bottom: 0; }

/* =========================================================
   Empty state with illustration
   ========================================================= */
.empty-state-illus {
  width: 200px;
  height: 160px;
  margin-bottom: 1.25rem;
  display: block;
}
.empty-state-illus .stroke { stroke: rgb(var(--brand-rgb)); }
.empty-state-illus .fill { fill: rgb(var(--brand-rgb)); }
.empty-state-illus .fill-soft { fill: rgb(var(--brand-rgb) / 0.12); }
.empty-state-illus .fill-ink { fill: rgb(241 245 249); }
.dark .empty-state-illus .fill-ink { fill: rgb(30 41 59); }
.empty-state-illus .stroke-ink { stroke: rgb(148 163 184); }
.dark .empty-state-illus .stroke-ink { stroke: rgb(71 85 105); }

.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
}

/* =========================================================
   Confetti
   ========================================================= */
.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* =========================================================
   Component Gallery — item wrappers + copy-code button
   ========================================================= */
.cmp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.cmp-grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.cmp-grid-1 { grid-template-columns: 1fr; }

.cmp-item {
  display: flex;
  flex-direction: column;
  border: 1px solid rgb(226 232 240);
  border-radius: 12px;
  background: rgb(248 250 252 / 0.6);
  overflow: hidden;
}
.dark .cmp-item {
  background: rgb(15 23 42 / 0.4);
  border-color: rgb(30 41 59);
}

.cmp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid rgb(226 232 240);
  background: rgb(255 255 255 / 0.6);
}
.dark .cmp-head {
  background: rgb(15 23 42 / 0.5);
  border-bottom-color: rgb(30 41 59);
}

.cmp-label {
  font-size: 11px;
  font-weight: 700;
  color: rgb(71 85 105);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.dark .cmp-label { color: rgb(148 163 184); }

.cmp-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgb(71 85 105);
  background: transparent;
  border-radius: 6px;
  transition: all 150ms ease;
  cursor: pointer;
}
.cmp-copy:hover {
  color: rgb(var(--brand-rgb));
  background: rgb(var(--brand-rgb) / 0.08);
}
.dark .cmp-copy { color: rgb(148 163 184); }
.dark .cmp-copy:hover {
  color: rgb(var(--brand-rgb));
  background: rgb(var(--brand-rgb) / 0.15);
}
.cmp-copy.copied,
.cmp-copy.copied:hover {
  color: rgb(16 185 129);
  background: rgb(16 185 129 / 0.12);
}
.cmp-copy svg { width: 13px; height: 13px; }

.cmp-preview {
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 96px;
  flex-wrap: wrap;
  gap: 8px;
  background:
    linear-gradient(45deg, rgb(241 245 249) 25%, transparent 25%) -8px 0,
    linear-gradient(-45deg, rgb(241 245 249) 25%, transparent 25%) -8px 0,
    linear-gradient(45deg, transparent 75%, rgb(241 245 249) 75%),
    linear-gradient(-45deg, transparent 75%, rgb(241 245 249) 75%);
  background-size: 16px 16px;
  background-color: rgb(255 255 255);
}
.dark .cmp-preview {
  background:
    linear-gradient(45deg, rgb(30 41 59 / 0.4) 25%, transparent 25%) -8px 0,
    linear-gradient(-45deg, rgb(30 41 59 / 0.4) 25%, transparent 25%) -8px 0,
    linear-gradient(45deg, transparent 75%, rgb(30 41 59 / 0.4) 75%),
    linear-gradient(-45deg, transparent 75%, rgb(30 41 59 / 0.4) 75%);
  background-size: 16px 16px;
  background-color: rgb(15 23 42);
}
.cmp-preview-stretch {
  align-items: stretch;
  padding: 16px;
}
.cmp-item.cmp-wide { grid-column: 1 / -1; }

.cmp-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cmp-toc a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: rgb(71 85 105);
  background: rgb(241 245 249);
  border-radius: 999px;
  transition: all 150ms;
}
.dark .cmp-toc a {
  color: rgb(203 213 225);
  background: rgb(30 41 59);
}
.cmp-toc a:hover {
  color: rgb(var(--brand-rgb));
  background: rgb(var(--brand-rgb) / 0.1);
}
.cmp-toc a .cmp-toc-count {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgb(255 255 255);
  color: rgb(71 85 105);
}
.dark .cmp-toc a .cmp-toc-count {
  background: rgb(15 23 42);
  color: rgb(148 163 184);
}
