/* ============================================================
   Goaltage CMS — application shell design system
   Brand blue: #192CB2 · Inter (EN) / Vazirmatn (FA) · light+dark
   ============================================================ */

:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

:root {
  --color-primary: #192cb2;
  --color-primary-hover: #142391;
  --color-primary-light: rgba(25, 44, 178, 0.1);
  --color-primary-glow: rgba(25, 44, 178, 0.28);
  --color-primary-grad: linear-gradient(135deg, #192cb2, #2b3fd6);

  --color-success: #16a34a;
  --color-success-bg: rgba(22, 163, 74, 0.12);
  --color-warning: #d97706;
  --color-warning-bg: rgba(217, 119, 6, 0.12);
  --color-danger: #dc2626;
  --color-danger-bg: rgba(220, 38, 38, 0.12);
  --color-info: #0284c7;
  --color-info-bg: rgba(2, 132, 199, 0.12);

  --bg-base: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-active: #e7ebf5;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;

  --border-light: #e6eaf2;
  --border-medium: #d6dced;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 32px rgba(15, 23, 42, 0.08);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

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

  --font-sans: 'Inter', 'Vazirmatn', system-ui, -apple-system, sans-serif;
}

html[dir="rtl"], html[lang="fa"] {
  --font-sans: 'Vazirmatn', 'Inter', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg-base: #0b1020;
  --bg-surface: #131b34;
  --bg-elevated: #17203e;
  --bg-hover: #1b2545;
  --bg-active: #212c52;
  --text-primary: #f1f5f9;
  --text-secondary: #b6c0d9;
  --text-tertiary: #7a86a8;
  --border-light: #263256;
  --border-medium: #303f6e;
  --color-primary: #6f82ea;
  --color-primary-hover: #8b9bf0;
  --color-primary-light: rgba(111, 130, 234, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.4);
}

/* ---------------- Flatpickr (vendor) dark theme override ---------------- */
[data-theme="dark"] .flatpickr-calendar {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}
[data-theme="dark"] .flatpickr-calendar.arrowTop::before,
[data-theme="dark"] .flatpickr-calendar.arrowTop::after { border-bottom-color: var(--bg-elevated); }
[data-theme="dark"] .flatpickr-calendar.arrowBottom::before,
[data-theme="dark"] .flatpickr-calendar.arrowBottom::after { border-top-color: var(--bg-elevated); }
[data-theme="dark"] .flatpickr-months .flatpickr-month,
[data-theme="dark"] .flatpickr-current-month,
[data-theme="dark"] .flatpickr-current-month input.cur-year,
[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months { color: var(--text-primary); fill: var(--text-primary); }
[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months { background: transparent; }
[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { background: var(--bg-elevated); color: var(--text-primary); }
[data-theme="dark"] .flatpickr-prev-month svg,
[data-theme="dark"] .flatpickr-next-month svg { fill: var(--text-secondary); }
[data-theme="dark"] .flatpickr-prev-month:hover svg,
[data-theme="dark"] .flatpickr-next-month:hover svg { fill: var(--color-primary); }
[data-theme="dark"] .flatpickr-weekdays { background: transparent; }
[data-theme="dark"] span.flatpickr-weekday { background: transparent; color: var(--text-tertiary); }
[data-theme="dark"] .flatpickr-day { color: var(--text-primary); }
[data-theme="dark"] .flatpickr-day.flatpickr-disabled,
[data-theme="dark"] .flatpickr-day.flatpickr-disabled:hover,
[data-theme="dark"] .flatpickr-day.prevMonthDay,
[data-theme="dark"] .flatpickr-day.nextMonthDay,
[data-theme="dark"] .flatpickr-day.notAllowed,
[data-theme="dark"] .flatpickr-day.notAllowed.prevMonthDay,
[data-theme="dark"] .flatpickr-day.notAllowed.nextMonthDay { color: var(--text-tertiary); opacity: 0.5; }
[data-theme="dark"] .flatpickr-day.today { border-color: var(--color-primary); }
[data-theme="dark"] .flatpickr-day:hover,
[data-theme="dark"] .flatpickr-day:focus { background: var(--bg-hover); border-color: var(--bg-hover); }
[data-theme="dark"] .flatpickr-day.selected,
[data-theme="dark"] .flatpickr-day.selected:hover,
[data-theme="dark"] .flatpickr-day.startRange,
[data-theme="dark"] .flatpickr-day.endRange {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
[data-theme="dark"] .numInputWrapper span.arrowUp:after { border-bottom-color: var(--text-secondary); }
[data-theme="dark"] .numInputWrapper span.arrowDown:after { border-top-color: var(--text-secondary); }
[data-theme="dark"] .numInputWrapper:hover { background: var(--bg-hover); }
[data-theme="dark"] .flatpickr-time { border-top-color: var(--border-light); }
[data-theme="dark"] .flatpickr-time input,
[data-theme="dark"] .flatpickr-time .flatpickr-time-separator,
[data-theme="dark"] .flatpickr-time .flatpickr-am-pm { color: var(--text-primary); background: transparent; }
[data-theme="dark"] .flatpickr-time input:hover,
[data-theme="dark"] .flatpickr-time .flatpickr-am-pm:hover { background: var(--bg-hover); }

/* ---------------- Reset ---------------- */
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
img { max-width: 100%; }

.mobile-only { display: none !important; }
.desktop-only { display: inline-flex !important; }
@media (max-width: 960px) {
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }
}

/* ---------------- Header ---------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 300;
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
}
.header-inner {
  height: 100%;
  width: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-logo {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo img { width: 20px; height: 20px; }
.brand-logo-dark { display: none; }
[data-theme="dark"] .brand-logo-light { display: none; }
[data-theme="dark"] .brand-logo-dark { display: block; }
.brand-text {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 640px) {
  .brand-text { max-width: 42vw; }
}

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.icon-btn svg, .icon-btn i { width: 18px; height: 18px; }

.theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: flex; }

.lang-dropdown { position: relative; }
.lang-dropdown-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.lang-dropdown-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.lang-dropdown-btn svg, .lang-dropdown-btn i { width: 18px; height: 18px; }
.lang-dropdown-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  min-width: 140px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
  z-index: 310;
}
.lang-dropdown.open .lang-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-option {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-secondary);
}
.lang-option:hover { background: var(--bg-hover); color: var(--text-primary); }
.lang-option.active { background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; }

/* ---------------- App shell / layout ---------------- */
.app-shell { position: relative; min-height: 100vh; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 24, 0.5);
  z-index: 250;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms;
}
.overlay.open { opacity: 1; visibility: visible; }
@media (min-width: 961px) {
  .overlay { display: none; }
}

.sidebar {
  position: fixed;
  inset-inline-start: 0;
  top: var(--header-h);
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-inline-end: 1px solid var(--border-light);
  overflow: visible;
  z-index: 260;
}
.sidebar-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 14px 100px;
}

.sidebar-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 16px 10px 20px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary-grad);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-profile-name { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.sidebar-profile-role { font-size: 12px; color: var(--text-tertiary); }

.sidebar-menu { display: flex; flex-direction: column; gap: 18px; }
.menu-section { display: flex; flex-direction: column; gap: 3px; }
.menu-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 6px;
}
.menu-section-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0 10px;
  text-decoration: none;
  transition: color 150ms ease;
  flex: 1;
  min-width: 0;
}
a.menu-section-title:hover,
a.menu-section-title:focus-visible { color: var(--color-primary); }
.menu-section-toggle {
  flex: none;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-light);
  background: var(--bg-hover);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: transform 180ms ease, color 150ms ease, background 150ms ease, border-color 150ms ease;
}
.menu-section-toggle:hover { color: var(--color-primary); background: var(--color-primary-light); border-color: var(--color-primary); }
.menu-section-toggle svg, .menu-section-toggle i { width: 18px; height: 18px; stroke-width: 2.5; }
.menu-section-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
.menu-section.collapsed .menu-section-items { display: none; }
.menu-section.collapsed .menu-section-toggle { transform: rotate(-90deg); }
html[dir="rtl"] .menu-section.collapsed .menu-section-toggle { transform: rotate(90deg); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text-secondary);
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  text-align: start;
  transition: background 150ms ease, color 150ms ease;
}
.menu-item svg, .menu-item i { width: 17px; height: 17px; flex: none; }
.menu-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.menu-item.active { background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; }

/* ---------------- Sidebar collapse (desktop) ---------------- */
:root { --sidebar-w-collapsed: 76px; }
.sidebar-collapse-btn {
  position: absolute;
  top: 18px;
  inset-inline-end: -13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  z-index: 261;
  padding: 0;
}
.sidebar-collapse-btn:hover { color: var(--color-primary); }
.sidebar-collapse-btn svg, .sidebar-collapse-btn i { width: 14px; height: 14px; }
.sidebar-collapse-btn .collapse-icon-expand { display: none; }
html[dir="rtl"] .sidebar-collapse-btn i { transform: scaleX(-1); }

html.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
html.sidebar-collapsed .sidebar-collapse-btn .collapse-icon-collapse { display: none; }
html.sidebar-collapsed .sidebar-collapse-btn .collapse-icon-expand { display: flex; }
html.sidebar-collapsed .sidebar-profile-name,
html.sidebar-collapsed .sidebar-profile-role,
html.sidebar-collapsed .menu-section-title,
html.sidebar-collapsed .menu-section-toggle,
html.sidebar-collapsed .menu-item span {
  display: none;
}
html.sidebar-collapsed .sidebar-profile { padding-inline: 4px; }
html.sidebar-collapsed .sidebar-profile-avatar { width: 40px; height: 40px; font-size: 14px; }
html.sidebar-collapsed .menu-item { justify-content: center; padding-inline: 8px; }
html.sidebar-collapsed .menu-item svg,
html.sidebar-collapsed .menu-item i { flex: none; }
html.sidebar-collapsed .menu-section.collapsed .menu-section-items { display: flex; }
@media (min-width: 961px) {
  html.sidebar-collapsed .main-content.has-sidebar { margin-inline-start: var(--sidebar-w-collapsed); }
}
.sidebar { transition: width 200ms ease; }
.main-content.has-sidebar { transition: margin-inline-start 200ms ease; }

@media (max-width: 960px) {
  .sidebar-collapse-btn { display: none; }
}

@media (max-width: 960px) {
  .sidebar {
    top: 0;
    inset-inline-start: 0;
    transform: translateX(-100%);
    transition: transform 220ms ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar-scroll { padding-top: calc(var(--header-h) + 16px); }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open,
  html[dir="rtl"] .sidebar.open { transform: translateX(0); }
}

.main-content {
  padding: 24px 20px 60px;
  max-width: 1600px;
  margin: 0 auto;
}
@media (min-width: 961px) {
  .main-content.has-sidebar {
    margin-inline-start: var(--sidebar-w);
    max-width: calc(1600px);
  }
}
@media (max-width: 640px) {
  .main-content { padding: 16px 14px 48px; }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 120ms ease, background 120ms ease, transform 120ms ease;
}
.btn svg, .btn i { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-primary-grad); color: #fff; box-shadow: 0 6px 16px var(--color-primary-glow); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--bg-base); color: var(--text-primary); border-color: var(--border-light); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-lg { padding: 13px 20px; font-size: 15px; }
.btn-full { width: 100%; }
.btn-pill { border-radius: var(--radius-full); }

/* ---------------- Alerts (inline fallback) ---------------- */
.messages-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  font-size: 13.5px;
}
.alert-icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-content { flex: 1; min-width: 0; }
.alert-title { font-weight: 700; margin-bottom: 2px; }
.alert-text { font-size: 13px; line-height: 1.5; }
.alert-success { background: var(--color-success-bg); border-color: rgba(22,163,74,0.25); color: var(--color-success); }
.alert-error { background: var(--color-danger-bg); border-color: rgba(220,38,38,0.25); color: var(--color-danger); }
.alert-warning { background: var(--color-warning-bg); border-color: rgba(217,119,6,0.25); color: var(--color-warning); }
.flash-source-hidden { display: none !important; }

/* ---------------- Flash modal (toast) system ---------------- */
.flash-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 11, 24, 0.35);
}
.flash-modal-layer.is-visible { display: flex; }
.flash-modal-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12vh;
  width: 100%;
  max-width: 420px;
}
.flash-modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  animation: gt-toast-in 220ms ease;
}
@keyframes gt-toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.flash-modal-inner { padding: 16px; }
.flash-modal-head { display: flex; align-items: flex-start; gap: 12px; }
.flash-modal-badge {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.flash-modal-badge svg, .flash-modal-badge i { width: 18px; height: 18px; }
.flash-modal.is-success .flash-modal-badge { background: var(--color-success-bg); color: var(--color-success); }
.flash-modal.is-error .flash-modal-badge { background: var(--color-danger-bg); color: var(--color-danger); }
.flash-modal.is-warning .flash-modal-badge { background: var(--color-warning-bg); color: var(--color-warning); }
.flash-modal.is-info .flash-modal-badge { background: var(--color-info-bg); color: var(--color-info); }
.flash-modal-copy { flex: 1; min-width: 0; }
.flash-modal-title { font-weight: 700; font-size: 14px; color: var(--text-primary); margin-bottom: 3px; }
.flash-modal-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.flash-modal-dismiss {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flash-modal-dismiss:hover { background: var(--bg-hover); color: var(--text-primary); }
.flash-modal-dismiss svg, .flash-modal-dismiss i { width: 15px; height: 15px; }
.flash-modal-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.flash-modal.is-error .flash-modal-actions .btn-primary { background: var(--color-danger); box-shadow: none; }

/* ============================================================
   Dashboard
   ============================================================ */

.dashboard-page { display: flex; flex-direction: column; gap: 24px; }

/* ---- Motion ---- */
@keyframes gt-rise-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes gt-pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
}
@keyframes gt-orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes gt-count-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .dashboard-hero,
  .dashboard-charts-grid > *,
  .dashboard-grid > *,
  .customer-dashboard-grid > * {
    animation: gt-rise-in 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .dashboard-charts-grid > *:nth-child(1) { animation-delay: 0ms; }
  .dashboard-charts-grid > *:nth-child(2) { animation-delay: 40ms; }
  .dashboard-charts-grid > *:nth-child(3) { animation-delay: 80ms; }
  .dashboard-charts-grid > *:nth-child(4) { animation-delay: 120ms; }
  .dashboard-charts-grid > *:nth-child(5) { animation-delay: 160ms; }
  .dashboard-charts-grid > *:nth-child(6) { animation-delay: 200ms; }
  .dashboard-charts-grid > *:nth-child(n+7) { animation-delay: 240ms; }
  .dashboard-grid > *:nth-child(1) { animation-delay: 0ms; }
  .dashboard-grid > *:nth-child(2) { animation-delay: 40ms; }
  .dashboard-grid > *:nth-child(3) { animation-delay: 80ms; }
  .dashboard-grid > *:nth-child(4) { animation-delay: 120ms; }
  .dashboard-grid > *:nth-child(n+5) { animation-delay: 160ms; }
  .customer-dashboard-grid > *:nth-child(2) { animation-delay: 80ms; }
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 40px);
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.14), transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(255,255,255,0.10), transparent 50%),
    linear-gradient(155deg, #0c1550 0%, #16209c 45%, #192cb2 75%, #2b3fd6 100%);
  color: #fff;
}
.dashboard-hero-orbit { position: absolute; inset: 0; pointer-events: none; opacity: 0.5; }
.dashboard-hero-orbit span {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}
.dashboard-hero-orbit span:nth-child(1) { width: 460px; height: 460px; inset-inline-end: -140px; top: -180px; }
.dashboard-hero-orbit span:nth-child(2) { width: 320px; height: 320px; inset-inline-start: 55%; bottom: -180px; }
@media (prefers-reduced-motion: no-preference) {
  .dashboard-hero-orbit span { animation: gt-orbit-spin 50s linear infinite; }
  .dashboard-hero-orbit span:nth-child(2) { animation-duration: 38s; animation-direction: reverse; }
}

.dashboard-live {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 12px;
}
.dashboard-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
}
@media (prefers-reduced-motion: no-preference) {
  .dashboard-live-dot { animation: gt-pulse-dot 2.2s ease-out infinite; }
}

.dashboard-hero-content { position: relative; z-index: 1; }
.dashboard-hero-content h1 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; margin: 0 0 6px; }
.dashboard-hero-content p { font-size: 14px; color: rgba(255,255,255,0.78); margin: 0 0 22px; }

.dashboard-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.dashboard-overview-card {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: background 200ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1), border-color 200ms ease;
}
.dashboard-overview-card:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.32);
  transform: translateY(-3px);
}
.dashboard-overview-value {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 2px;
  background: linear-gradient(135deg, #ffffff, #cfd6ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dashboard-overview-label { font-size: 12.5px; color: rgba(255,255,255,0.7); }

.dashboard-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.dashboard-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  transition: background 150ms ease, transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
}
a.dashboard-badge:hover { background: rgba(255,255,255,0.22); transform: translateY(-2px); }
.dashboard-badge svg, .dashboard-badge i { width: 14px; height: 14px; }

/* ---- Cards shared by charts grid + section grid ---- */
.dashboard-charts-grid, .dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.dashboard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease, border-color 220ms ease;
}
.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-medium);
}
.dashboard-card:hover .dashboard-card-icon { transform: scale(1.08) rotate(-4deg); }

.dashboard-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.dashboard-card-title-wrap h2 { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 0 0 3px; }
.dashboard-card-title-wrap p { font-size: 12.5px; color: var(--text-tertiary); margin: 0; }
.dashboard-card-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dashboard-card-icon svg, .dashboard-card-icon i { width: 18px; height: 18px; }

/* Colorful icon-chip variants for visual variety across cards */
.c-violet { background: rgba(139, 92, 246, 0.14); color: #8b5cf6; }
.c-teal { background: rgba(13, 148, 136, 0.14); color: #0d9488; }
.c-amber { background: rgba(217, 119, 6, 0.14); color: #d97706; }
.c-rose { background: rgba(225, 29, 72, 0.14); color: #e11d48; }
.c-green { background: rgba(22, 163, 74, 0.14); color: #16a34a; }
.c-cyan { background: rgba(8, 145, 178, 0.14); color: #0891b2; }
.c-pink { background: rgba(219, 39, 119, 0.14); color: #db2777; }
.c-slate { background: rgba(71, 85, 105, 0.14); color: #475569; }
[data-theme="dark"] .c-violet { background: rgba(167, 139, 250, 0.18); color: #a78bfa; }
[data-theme="dark"] .c-teal { background: rgba(45, 212, 191, 0.18); color: #2dd4bf; }
[data-theme="dark"] .c-amber { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
[data-theme="dark"] .c-rose { background: rgba(251, 113, 133, 0.18); color: #fb7185; }
[data-theme="dark"] .c-green { background: rgba(74, 222, 128, 0.18); color: #4ade80; }
[data-theme="dark"] .c-cyan { background: rgba(34, 211, 238, 0.18); color: #22d3ee; }
[data-theme="dark"] .c-pink { background: rgba(244, 114, 182, 0.18); color: #f472b6; }
[data-theme="dark"] .c-slate { background: rgba(148, 163, 184, 0.18); color: #94a3b8; }

.dashboard-card-empty {
  text-align: center;
  padding: 28px 12px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ---- Charts ---- */
.dchart-canvas { width: 100%; }
.dchart-svg { display: block; width: 100%; height: auto; }
.dchart-svg.dchart-donut, .dchart-svg.dchart-gauge {
  max-width: 200px;
  margin: 0 auto;
}
.dchart-dual { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dchart-dual-title { display: block; font-size: 12px; font-weight: 600; color: var(--text-tertiary); margin-bottom: 8px; }
@media (max-width: 520px) {
  .dchart-dual { grid-template-columns: 1fr; }
}

/* ---- Lists ---- */
.dashboard-list { display: flex; flex-direction: column; }
.dashboard-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.dashboard-list-item:last-child { border-bottom: none; }
.dashboard-list-item { transition: background 150ms ease; border-radius: var(--radius-sm); padding-inline: 6px; margin-inline: -6px; }
.dashboard-list-item:hover { background: var(--bg-hover); }
.dashboard-list-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dashboard-list-item-title { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-list-item-sub { font-size: 12px; color: var(--text-tertiary); }

.dashboard-severity {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
}
.dashboard-severity svg, .dashboard-severity i { width: 12px; height: 12px; }
.dashboard-severity.warning { background: var(--color-warning-bg); color: var(--color-warning); }
.dashboard-severity.critical { background: var(--color-danger-bg); color: var(--color-danger); }

/* ---- Section cards (bottom grid): stats + actions ---- */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px; margin-bottom: 16px; }
.dashboard-stat { text-align: center; padding: 10px 6px; border-radius: var(--radius-md); background: var(--bg-base); transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), background 180ms ease; }
.dashboard-stat:hover { background: var(--color-primary-light); transform: translateY(-2px); }
.dashboard-stat-value {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), #6b7ef2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dashboard-stat-label { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.dashboard-actions { display: flex; flex-direction: column; gap: 4px; }
.dashboard-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  transition: background 150ms ease, padding-inline-start 150ms ease;
}
.dashboard-action:hover { background: var(--bg-hover); padding-inline-start: 14px; }
.dashboard-action svg, .dashboard-action i { width: 15px; height: 15px; transition: transform 150ms ease; }
.dashboard-action:hover svg, .dashboard-action:hover i { transform: translate(2px, -2px); }

/* ============================================================
   Customer (external) dashboard
   ============================================================ */
.customer-dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 18px; }

.customer-insight-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
}
.customer-insight-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.customer-insight-header { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.customer-insight-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.customer-insight-copy { font-size: 12.5px; color: var(--text-tertiary); margin: 0; line-height: 1.6; }
.customer-insight-icon {
  flex: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
}
.customer-insight-icon svg, .customer-insight-icon i { width: 18px; height: 18px; }

.customer-finance-banner { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.customer-finance-pill { border-radius: var(--radius-md); padding: 12px 14px; background: var(--bg-base); border: 1px solid var(--border-light); }
.customer-finance-label { font-size: 11.5px; color: var(--text-tertiary); margin-bottom: 4px; }
.customer-finance-value { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.customer-finance-sub { font-size: 11.5px; color: var(--text-tertiary); margin-top: 3px; }
.customer-finance-pill.success { background: var(--color-success-bg); border-color: rgba(22,163,74,0.25); }
.customer-finance-pill.warning { background: var(--color-warning-bg); border-color: rgba(217,119,6,0.25); }
.customer-finance-pill.danger { background: var(--color-danger-bg); border-color: rgba(220,38,38,0.25); }

.customer-tag {
  flex: none;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.customer-tag.success { background: var(--color-success-bg); color: var(--color-success); }
.customer-tag.warning { background: var(--color-warning-bg); color: var(--color-warning); }
.customer-tag.danger { background: var(--color-danger-bg); color: var(--color-danger); }

.customer-cheque-list, .customer-order-list { display: flex; flex-direction: column; gap: 10px; }
.customer-cheque-item, .customer-order-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color 150ms ease, background 150ms ease;
}
.customer-cheque-item:hover, .customer-order-item:hover { border-color: var(--border-medium); background: var(--bg-hover); }
.customer-cheque-head, .customer-order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.customer-cheque-title, .customer-order-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.customer-cheque-sub, .customer-order-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.customer-cheque-meta, .customer-order-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-secondary); }

.customer-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin-bottom: 16px; }
.customer-status-card { text-align: center; padding: 12px 6px; border-radius: var(--radius-md); background: var(--bg-base); transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1); }
.customer-status-card:hover { transform: translateY(-2px); }
.customer-status-count {
  font-size: 19px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), #6b7ef2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.customer-status-label { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.customer-progress { height: 6px; border-radius: var(--radius-full); background: var(--bg-hover); overflow: hidden; margin-bottom: 8px; }
.customer-progress span { display: block; height: 100%; width: 60%; background: var(--color-primary-grad); border-radius: var(--radius-full); }

@media (max-width: 640px) {
  .customer-insight-card, .dashboard-card { padding: 16px; }
}
