/* ===== iProSathi Admin · Minimal theme ===== */
:root {
  --sb-w: 248px;
  --accent: #3E63DD;
  --ink: #18181B;
  --muted: #71717A;
  --line: #E8E8E5;
  --card: #FFFFFF;
  --canvas: #F7F7F5;
  --elev: #FFFFFF;
  --hover: #F4F4F5;
}
.dark {
  --accent: #6F8BF0;
  --ink: #FAFAFA;
  --muted: #A1A1AA;
  --line: rgba(255, 255, 255, 0.07);
  --card: #111113;
  --canvas: #09090B;
  --elev: #18181B;
  --hover: rgba(255, 255, 255, 0.05);
  color-scheme: dark;
}
html.sb-collapsed { --sb-w: 72px; }

body {
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.005em;
}
.tabular-nums, .font-mono { font-variant-numeric: tabular-nums; }
h1, h2, h3 { letter-spacing: -0.02em; }

/* Theme switch smoothing */
.theme-switching *, .theme-switching *::before, .theme-switching *::after {
  transition: background-color .3s ease, border-color .3s ease, color .2s ease, fill .3s ease !important;
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D4D4D8; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #A1A1AA; background-clip: padding-box; border: 2px solid transparent; }
.dark ::-webkit-scrollbar-thumb { background: #27272A; background-clip: padding-box; border: 2px solid transparent; }
.dark ::-webkit-scrollbar-thumb:hover { background: #3F3F46; background-clip: padding-box; border: 2px solid transparent; }
.sb-scroll::-webkit-scrollbar { width: 4px; }

::selection { background: rgba(62, 99, 221, 0.18); color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

.data-row { transition: background-color .15s ease; }

/* ===== Shell ===== */
.sb { width: var(--sb-w); transition: width .22s cubic-bezier(.4, 0, .2, 1), transform .22s cubic-bezier(.4, 0, .2, 1); }
@media (min-width: 1024px) {
  .main-col { padding-left: var(--sb-w); transition: padding-left .22s cubic-bezier(.4, 0, .2, 1); }
}
@media (max-width: 1023px) {
  .sb { width: 268px; box-shadow: 0 20px 60px -10px rgba(0, 0, 0, .25); }
}

.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--canvas);
  font-weight: 700; font-size: 12px; letter-spacing: -0.02em;
  position: relative; overflow: hidden;
}
.brand-mark::after {
  content: ''; position: absolute; right: 5px; top: 5px; width: 5px; height: 5px; border-radius: 99px; background: var(--accent);
}

.nav-link {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px; border-radius: 8px;
  font-size: 13px; font-weight: 450; color: var(--muted);
  transition: background-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.nav-link i { font-size: 17px; flex-shrink: 0; width: 18px; text-align: center; transition: transform .2s ease; }
.nav-link:hover { background: var(--hover); color: var(--ink); }
.nav-link:hover i { transform: translateX(1px); }
.nav-link.is-active { background: var(--hover); color: var(--ink); font-weight: 550; }
.nav-link.is-active i { color: var(--accent); }
.nav-link.is-active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}

html.sb-collapsed .sb .sb-label { display: none; }
html.sb-collapsed .sb .sb-group { visibility: hidden; height: 6px; margin: 0; overflow: hidden; }
html.sb-collapsed .sb .nav-link { justify-content: center; padding: 0; }
html.sb-collapsed .sb .sb-collapse-icon { transform: rotate(180deg); }
@media (max-width: 1023px) {
  html.sb-collapsed .sb .sb-label { display: flex; }
  html.sb-collapsed .sb .sb-group { visibility: visible; height: auto; margin-bottom: 6px; }
  html.sb-collapsed .sb .nav-link { justify-content: flex-start; padding: 0 10px; }
}

.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 18px;
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }

.theme-btn { position: relative; overflow: hidden; }
.theme-btn i { position: absolute; transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), opacity .25s ease; }
.theme-btn .theme-sun { transform: translateY(26px) rotate(-90deg); opacity: 0; }
.theme-btn .theme-moon { transform: translateY(0) rotate(0); opacity: 1; }
.dark .theme-btn .theme-sun { transform: translateY(0) rotate(0); opacity: 1; color: #FBBF24; }
.dark .theme-btn .theme-moon { transform: translateY(-26px) rotate(90deg); opacity: 0; }

.kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 10.5px; font-weight: 500;
  color: var(--muted); background: var(--card); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
}

.avatar {
  width: 28px; height: 28px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #3E63DD, #18181B);
}

.live-dot { width: 6px; height: 6px; border-radius: 99px; background: #12915F; box-shadow: 0 0 0 0 rgba(18, 145, 95, .5); animation: livePulse 2.4s infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(18, 145, 95, .45); } 70% { box-shadow: 0 0 0 6px rgba(18, 145, 95, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 145, 95, 0); } }

.menu-pop { box-shadow: 0 16px 40px -12px rgba(9, 9, 11, .18), 0 2px 6px rgba(9, 9, 11, .04); animation: popIn .16s ease-out; transform-origin: top right; }
.dark .menu-pop { box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7); }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; font-size: 13px; transition: background-color .12s ease; }
.menu-item i { font-size: 16px; opacity: .8; }
.menu-item:hover { background: var(--hover); }
@keyframes popIn { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }

/* Palette */
.palette-card { box-shadow: 0 30px 80px -20px rgba(9, 9, 11, .35); animation: popIn .18s ease-out; transform-origin: top center; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; color: var(--ink); }
.palette-item.is-active { background: var(--hover); }
.palette-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); color: var(--muted); font-size: 16px; background: var(--card); }
.palette-item.is-active .palette-icon { color: var(--accent); border-color: rgba(62, 99, 221, .35); }

/* Page entrance: stagger direct children */
.page-enter > * > * { animation: riseIn .45s cubic-bezier(.22, 1, .36, 1) both; }
.page-enter > * > *:nth-child(1) { animation-delay: 0s; }
.page-enter > * > *:nth-child(2) { animation-delay: .05s; }
.page-enter > * > *:nth-child(3) { animation-delay: .1s; }
.page-enter > * > *:nth-child(4) { animation-delay: .15s; }
.page-enter > * > *:nth-child(5) { animation-delay: .2s; }
.page-enter > * > *:nth-child(n+6) { animation-delay: .24s; }
.page-enter > * > .fixed, .page-enter > * > [id$="Modal"], .page-enter > * > [id$="modal"], .page-enter > * > [role="dialog"] { animation: none; }
@keyframes riseIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== Global component polish ===== */
main table thead th { font-weight: 500; letter-spacing: 0.02em; }
main input[type="text"], main input[type="email"], main input[type="number"], main input[type="search"], main input[type="date"],
main input[type="password"], main input[type="url"], main input[type="tel"], main select, main textarea {
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* SweetAlert2 */
.swal2-popup { font-family: Geist, system-ui, sans-serif !important; border-radius: 16px !important; padding: 1.5rem 1.25rem !important; border: 1px solid var(--line) !important; background: var(--elev) !important; color: var(--ink) !important; box-shadow: 0 30px 70px -20px rgba(9, 9, 11, .35) !important; }
.swal2-toast.swal2-popup { padding: .75rem 1rem !important; border-radius: 12px !important; }
.swal2-title { font-size: 1.0625rem !important; font-weight: 600 !important; color: var(--ink) !important; letter-spacing: -0.015em !important; }
.swal2-html-container { font-size: .8125rem !important; color: var(--muted) !important; line-height: 1.55 !important; }
.swal2-actions { gap: .5rem !important; }
.swal2-confirm, .swal2-cancel, .swal2-deny { border-radius: 9px !important; font-size: .8125rem !important; font-weight: 500 !important; padding: .55rem 1.1rem !important; box-shadow: none !important; transition: opacity .15s ease, background-color .15s ease !important; }
.swal2-confirm:hover { opacity: .9; }
.swal-confirm-light { color: #18181B !important; }
.swal2-cancel { background: transparent !important; color: var(--ink) !important; border: 1px solid var(--line) !important; }
.swal2-cancel:hover { background: var(--hover) !important; }
.swal2-icon { transform: scale(.75) !important; margin: .25rem auto .5rem !important; }
.swal2-timer-progress-bar { background: var(--accent) !important; opacity: .5; }

/* Tom Select */
.ts-wrapper { width: 100% !important; font-size: .75rem !important; font-family: inherit !important; }
.ts-control { background-color: var(--card) !important; border: 1px solid var(--line) !important; border-radius: 9px !important; padding: .45rem .75rem !important; min-height: 38px !important; color: var(--ink) !important; box-shadow: none !important; display: flex !important; align-items: center !important; transition: border-color .15s ease, box-shadow .15s ease !important; }
.ts-wrapper.focus .ts-control { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(62, 99, 221, .14) !important; }
.ts-control input { color: inherit !important; font-size: .75rem !important; }
.ts-dropdown { background-color: var(--elev) !important; border: 1px solid var(--line) !important; border-radius: 10px !important; box-shadow: 0 16px 40px -12px rgba(9, 9, 11, .2) !important; padding: .3rem !important; margin-top: 4px !important; z-index: 1000 !important; color: var(--ink) !important; }
.ts-dropdown .option { padding: .5rem .65rem !important; border-radius: 7px !important; color: var(--ink) !important; font-size: .75rem !important; cursor: pointer !important; }
.ts-dropdown .active { background-color: var(--hover) !important; color: var(--ink) !important; }
.ts-dropdown .selected { background-color: rgba(62, 99, 221, .1) !important; color: var(--accent) !important; }
.ts-control .item { color: inherit !important; }
.ts-wrapper.multi .ts-control > div { background: var(--hover) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; border-radius: 6px !important; padding: .1rem .45rem !important; font-weight: 500 !important; font-size: .7rem !important; }

/* ApexCharts */
.apexcharts-tooltip { border-radius: 10px !important; border: 1px solid var(--line) !important; box-shadow: 0 12px 30px -10px rgba(9, 9, 11, .2) !important; font-family: Geist, sans-serif !important; }
.dark .apexcharts-tooltip { background: #18181B !important; color: #FAFAFA !important; }
.dark .apexcharts-tooltip-title { background: #111113 !important; border-color: rgba(255, 255, 255, .07) !important; }
.apexcharts-text, .apexcharts-legend-text { font-family: Geist, sans-serif !important; }
