/* Lucian UX/UI Prompt #039 · MIT License (c) 2026 Seokwoooo · https://lucianlabs.dev/uxui-prompt/#039 */
/* Lucian UX/UI Prompt #098 · MIT License (c) 2026 Seokwoooo · https://lucianlabs.dev/uxui-prompt/#098 */
/* Lucian UX/UI Prompt #417 · MIT License (c) 2026 Seokwoooo · https://lucianlabs.dev/uxui-prompt/#417 */

:root {
  color-scheme: light;
  --ux-page: #f8fafc;
  --ux-surface: #ffffff;
  --ux-surface-2: #f1f5f9;
  --ux-surface-3: #e2e8f0;
  --ux-ink: #0f172a;
  --ux-ink-2: #475569;
  --ux-ink-3: #64748b;
  --ux-line: rgba(15, 23, 42, 0.10);
  --ux-line-2: rgba(15, 23, 42, 0.18);
  --ux-accent: #0284c7;
  --ux-accent-2: #0b84f3;
  --ux-accent-soft: rgba(2, 132, 199, 0.12);
  --ux-accent-ink: #ffffff;
  --ux-mint: #059669;
  --ux-warn: #d97706;
  --ux-danger: #dc2626;
  --ux-shadow: rgba(15, 23, 42, 0.10);
  --ux-shadow-strong: rgba(15, 23, 42, 0.18);
  --ux-ease: cubic-bezier(.2, .8, .2, 1);
  --ux-spring: cubic-bezier(.34, 1.45, .64, 1);
}

body.dark,
:root[data-theme="dark"] {
  color-scheme: dark;
  --ux-page: #0b0f17;
  --ux-surface: #111827;
  --ux-surface-2: #1a2234;
  --ux-surface-3: #243047;
  --ux-ink: #f8fafc;
  --ux-ink-2: #cbd5e1;
  --ux-ink-3: #94a3b8;
  --ux-line: rgba(148, 163, 184, 0.14);
  --ux-line-2: rgba(148, 163, 184, 0.24);
  --ux-accent: #38bdf8;
  --ux-accent-2: #0ea5e9;
  --ux-accent-soft: rgba(56, 189, 248, 0.14);
  --ux-accent-ink: #082f49;
  --ux-mint: #10b981;
  --ux-warn: #f59e0b;
  --ux-danger: #ef4444;
  --ux-shadow: rgba(0, 0, 0, 0.35);
  --ux-shadow-strong: rgba(0, 0, 0, 0.55);
}

.ux, .ux *, .ux *::before, .ux *::after { box-sizing: border-box; }
.ux { font-family: inherit; color: var(--ux-ink); -webkit-tap-highlight-color: transparent; }
.ux :focus-visible { outline: 2px solid var(--ux-accent); outline-offset: 2px; }

/* ── #417 Sidebar đồng bộ toàn hệ thống Admin + Thanh trượt lò xo ── */
.drawer-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 10px 24px;
}
.drawer-group-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ux-ink-3);
  padding: 12px 12px 4px;
  margin-top: 2px;
  user-select: none;
}
.drawer-group-label:first-of-type { margin-top: 0; padding-top: 4px; }

.drawer-nav .drawer-item,
.drawer-nav .drawer-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ux-ink-2);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color .2s var(--ux-ease), background-color .18s var(--ux-ease), transform .25s var(--ux-spring);
}
.drawer-nav .drawer-item:hover,
.drawer-nav .drawer-link:hover {
  background: var(--ux-surface-2);
  color: var(--ux-ink);
}
.drawer-nav .drawer-item.active,
.drawer-nav .drawer-link.active,
.drawer-nav .drawer-item[aria-current="page"],
.drawer-nav .drawer-link[aria-current="page"] {
  color: var(--ux-accent);
  font-weight: 700;
  background: var(--ux-accent-soft);
  border-color: var(--ux-line-2);
}
.drawer-nav.has-u417 .drawer-item.active,
.drawer-nav.has-u417 .drawer-link.active {
  background: transparent;
  border-color: transparent;
}
.u417-pl {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: var(--ph, 38px);
  border-radius: 9px;
  background: var(--ux-accent-soft);
  border: 1px solid var(--ux-line-2);
  transform: translateY(var(--py, 0px));
  transition: transform .48s var(--ux-spring), height .3s var(--ux-ease);
  pointer-events: none;
  z-index: 0;
}

/* ── #039 Sliding Pill Tabs (Lọc thời gian & Bộ lọc Feed) ── */
.u039-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: 11px;
  background: var(--ux-surface-2);
  border: 1px solid var(--ux-line);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.u039-tabs::-webkit-scrollbar { display: none; }
.u039-pill {
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: var(--w, 80px);
  border-radius: 8px;
  background: var(--ux-accent);
  transform: translateX(var(--x, 4px));
  box-shadow: 0 2px 6px var(--ux-shadow);
  transition: transform .46s var(--ux-spring), width .46s var(--ux-spring);
  pointer-events: none;
}
.u039-tab {
  position: relative;
  z-index: 1;
  height: 32px;
  border: 0;
  padding: 0 12px;
  border-radius: 8px;
  background: none;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ux-ink-2);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: color .28s var(--ux-ease);
}
.u039-tab[aria-selected="true"],
.u039-tab.active {
  color: var(--ux-accent-ink);
}

/* ── #098 Live Metric Rolling Odometer Digits ── */
.u098-num {
  display: inline-flex;
  align-items: baseline;
  height: 36px;
  overflow: hidden;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 36px;
  font-variant-numeric: tabular-nums;
  color: var(--ux-ink);
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}
.u098-col {
  display: inline-flex;
  flex-direction: column;
  transform: translateY(calc(var(--d, 0) * -36px));
  transition: transform .85s cubic-bezier(.3, 1.25, .5, 1);
  transition-delay: calc(var(--i, 0) * 40ms);
}
.u098-col span { height: 36px; line-height: 36px; display: block; text-align: center; }
.u098-sym { display: inline-block; padding: 0 1px; }

/* ── Compact Dashboard Feed & Cards ── */
.u039-row-enter {
  animation: u039RowIn .32s var(--ux-spring) both;
  animation-delay: calc(var(--ri, 0) * 30ms);
}
@keyframes u039RowIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ux, .ux *, .u417-pl, .u039-pill, .u098-col, .u039-row-enter,
  .drawer-nav .drawer-item, .drawer-nav .drawer-link {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
