/* ═══════════════════════════════════════════════════════════════
   SiamLMS-AI — Premium SaaS Redesign
   ───────────────────────────────────────────────────────────────
   Accent:  #2bbaa0  Teal
   Accent2: #0d9b7a  Deep Teal
   Success: #2dd4a8  Mint Green
   
   Design System: 8px spacing grid
   Typography:    Inter 400/500/600/700
   Border Radius: 12-20px (premium rounded)
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & Variables ── */
*{margin:0;padding:0;box-sizing:border-box}

:root {
  /* ─ Color Palette ─ */
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-hover: #fafcfc;
  --surface-raised: #ffffff;
  --text: #111827;
  --text2: #64748b;
  --text3: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #2bbaa0;

  /* ─ Brand ─ */
  --accent: #2bbaa0;
  --accent-hover: #25a890;
  --accent2: #0d9b7a;
  --accent-light: rgba(43,186,160,0.08);
  --accent-lighter: rgba(43,186,160,0.04);
  --mint: #2dd4a8;
  --blue: #2bbaa0;
  --blue-bg: rgba(43,186,160,0.08);

  /* ─ Semantic ─ */
  --green: #2dd4a8;
  --green-bg: rgba(45,212,168,0.08);
  --purple: #8b5cf6;
  --purple-bg: rgba(139,92,246,0.08);
  --amber: #f59e0b;
  --amber-bg: rgba(245,158,11,0.08);
  --red: #ef4444;
  --red-bg: rgba(239,68,68,0.08);

  /* ─ Sidebar — Light Theme (QPent Style) ─ */
  --side-bg: #ffffff;
  --side-bg2: #fafbfc;
  --side-text: #64748b;
  --side-text-hover: #1e293b;
  --side-active-bg: rgba(43,186,160,0.08);
  --side-active-text: #0d9b7a;
  --side-border: #e8ecf1;

  /* ─ Design Tokens ─ */
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
  --shadow-accent: 0 4px 16px rgba(43,186,160,0.20);
  --tr: .2s cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --ease-out: cubic-bezier(0,0,.2,1);
}


/* ── Typography ── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  letter-spacing: -0.01em
}


/* ── Animations ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px) }
  to   { opacity: 1; transform: translateY(0) }
}
@keyframes fadeIn {
  from { opacity: 0 }
  to   { opacity: 1 }
}
@keyframes shimmer {
  0%   { background-position: -200% 0 }
  100% { background-position: 200% 0 }
}
@keyframes pulseOnline {
  0%,100% { box-shadow: 0 0 0 0 rgba(43,186,160,.35) }
  50%     { box-shadow: 0 0 0 8px rgba(43,186,160,0) }
}
@keyframes spin {
  from { transform: rotate(0deg) }
  to   { transform: rotate(360deg) }
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0 }
  to   { transform: translateX(0); opacity: 1 }
}


/* ══════════════════════════════════════
   SIDEBAR — Light Theme (QPent Style)
   ══════════════════════════════════════ */

.side {
  width: 260px;
  background: var(--side-bg);
  border-right: 1px solid var(--side-border);
  position: fixed;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 14px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.08) transparent;
}
.side::-webkit-scrollbar { width: 4px }
.side::-webkit-scrollbar-track { background: transparent }
.side::-webkit-scrollbar-thumb { background: rgba(0,0,0,.10); border-radius: 2px }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px;
  margin-bottom: 36px;
  animation: fadeSlideUp .5s ease both;
}
.logo svg {
  flex-shrink: 0;
  transition: transform .3s var(--ease-spring);
  filter: drop-shadow(0 2px 8px rgba(43,186,160,0.2));
}
.logo:hover svg { transform: rotate(-4deg) scale(1.08) }
.logo span {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #111827;
}

.nav-group { margin-bottom: 28px }
.nav-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  width: 100%;
  border: none;
  background: none;
  border-radius: 10px;
  color: var(--side-text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all .18s var(--ease-out);
  text-align: left;
  position: relative;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: #f1f5f9;
  color: var(--side-text-hover);
  transform: translateX(2px);
}
.nav-item.on {
  background: var(--side-active-bg);
  color: var(--side-active-text);
  font-weight: 600;
}
.nav-item.on::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 6px rgba(43,186,160,0.25);
}
.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .5;
  transition: all .18s;
}
.nav-item.on svg { opacity: 1; color: var(--side-active-text) }
.nav-item .cnt {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
  transition: all .18s;
  min-width: 24px;
  text-align: center;
}
.nav-item.on .cnt {
  background: rgba(43,186,160,.12);
  color: var(--side-active-text);
}

.side-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--side-border);
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .18s;
}
.user:hover { background: #f1f5f9 }
.user-av {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(43,186,160,0.2);
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: #1e293b;
}
.user-role {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
}


/* ══════════════════════════════════════
   MAIN LAYOUT
   ══════════════════════════════════════ */

.main {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  height: 60px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.top h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.top-r { display: flex; align-items: center; gap: 4px }

.ib {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s var(--ease-out);
}
.ib:hover {
  background: var(--accent-light);
  color: var(--accent);
  transform: translateY(-1px);
}
.ib:active { transform: translateY(0) }
.ib svg { width: 18px; height: 18px }

.wrap {
  padding: 32px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}


/* ══════════════════════════════════════
   BUTTONS — Premium
   ══════════════════════════════════════ */

.btn {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  transition: all .18s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}
.btn:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  background: var(--surface-hover);
}
.btn:active { transform: translateY(0); box-shadow: var(--shadow-xs) }
.btn svg { width: 15px; height: 15px }

.btn-b {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: var(--shadow-accent);
  font-weight: 600;
}
.btn-b:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #0a8a68 100%);
  box-shadow: 0 6px 24px rgba(43,186,160,0.32);
  transform: translateY(-2px);
  border-color: transparent;
}
.btn-b:active { transform: translateY(0) }
.btn-b svg { color: #fff }


/* ══════════════════════════════════════
   STAT CARDS — Premium Cards
   ══════════════════════════════════════ */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 36px;
  animation: fadeSlideUp .5s ease both;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-xs);
  transition: all .25s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  opacity: 1;
  transition: opacity .25s;
}
.stat:nth-child(1)::before { background: linear-gradient(90deg, var(--accent), var(--mint)) }
.stat:nth-child(2)::before { background: linear-gradient(90deg, var(--mint), #34d399) }
.stat:nth-child(3)::before { background: linear-gradient(90deg, var(--amber), #fbbf24) }
.stat:nth-child(4)::before { background: linear-gradient(90deg, var(--purple), #a78bfa) }

.stat:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: rgba(43,186,160,0.15);
}

.stat-n {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}
.stat:nth-child(1) .stat-n { color: var(--accent2) }
.stat:nth-child(2) .stat-n { color: #059669 }
.stat:nth-child(3) .stat-n { color: #b45309 }
.stat:nth-child(4) .stat-n { color: #7c3aed }

.stat-l {
  font-size: 12px;
  color: var(--text2);
  margin-top: 8px;
  font-weight: 500;
  letter-spacing: 0.01em;
}


/* ══════════════════════════════════════
   TABLE / LIST ROWS — Clean Lines
   ══════════════════════════════════════ */

.trow {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: all .15s var(--ease-out);
  cursor: pointer;
  border-radius: 10px;
  margin: 0 -8px;
}
.trow:hover {
  background: var(--accent-lighter);
  box-shadow: var(--shadow-xs);
  transform: translateX(2px);
}
.trow-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.trow-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .18s;
}
.trow:hover .trow-icon { transform: scale(1.06) }
.trow-icon svg { width: 16px; height: 16px }
.trow-title {
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.trow-type {
  width: 100px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  padding: 3px 8px;
  background: var(--border-light);
  border-radius: 6px;
}
.trow-time {
  width: 140px;
  font-size: 12px;
  color: var(--text3);
  font-weight: 400;
}
.trow-menu {
  width: 40px;
  display: flex;
  justify-content: center;
  position: relative;
}


/* ── Context Menu ── */
.ctx-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-xl);
  z-index: 100;
  min-width: 190px;
  padding: 6px;
  display: none;
  animation: fadeSlideUp .12s var(--ease-out);
}
.ctx-menu.show { display: block }
.ctx-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
  border: none;
  background: none;
  width: 100%;
  font: inherit;
  color: var(--text);
  text-align: left;
  font-weight: 450;
}
.ctx-item:hover { background: var(--accent-light); color: var(--accent2) }
.ctx-item.danger { color: var(--red) }
.ctx-item.danger:hover { background: var(--red-bg) }
.ctx-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .6 }


/* ══════════════════════════════════════
   BADGES
   ══════════════════════════════════════ */

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.01em;
}
.bg-g { background: var(--green-bg); color: var(--accent2) }
.bg-p { background: var(--purple-bg); color: var(--purple) }


/* ══════════════════════════════════════
   DASHBOARD ROWS
   ══════════════════════════════════════ */

.rows { display: flex; flex-direction: column }
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  transition: all .18s var(--ease-out);
  cursor: pointer;
}
.row:last-child { border-bottom: none }
.row:hover {
  background: var(--accent-lighter);
  margin: 0 -14px;
  padding: 14px;
  border-radius: var(--r);
  border-color: transparent;
  box-shadow: var(--shadow-xs);
  transform: translateX(2px);
}
.row-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
.row:hover .row-icon { transform: scale(1.06) }
.row-icon svg { width: 18px; height: 18px }
.row-info { flex: 1; min-width: 0 }
.row-name { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.1px }
.row-sub { font-size: 12px; color: var(--text2); margin-top: 2px; font-weight: 400 }
.pbar { width: 100px; height: 4px; background: var(--border-light); border-radius: 3px; overflow: hidden }
.pbar i { display: block; height: 100%; border-radius: 3px }


/* ══════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════ */

.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text2);
  animation: fadeSlideUp .5s ease both;
}
.empty-ic {
  width: 76px;
  height: 76px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--accent-light), rgba(45,212,168,.06));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(43,186,160,.10);
}
.empty-ic svg { width: 32px; height: 32px; color: var(--accent) }
.empty h3 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; letter-spacing: -0.2px }
.empty p { font-size: 13px; margin-bottom: 28px; max-width: 320px; margin-left: auto; margin-right: auto; line-height: 1.6 }


/* ══════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════ */

.ph {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  animation: fadeSlideUp .4s ease both;
}
.ph h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}


/* ══════════════════════════════════════
   SETTINGS
   ══════════════════════════════════════ */

.s-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: all .15s var(--ease-out);
}
.s-row:last-child { border-bottom: none }
.s-row:hover {
  transform: translateX(3px);
  background: var(--accent-lighter);
  margin: 0 -10px;
  padding: 16px 10px;
  border-radius: 10px;
}
.s-ic {
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
.s-row:hover .s-ic { transform: scale(1.06) }
.s-ic svg { width: 18px; height: 18px }
.s-info { flex: 1 }
.s-info h3 { font-size: 14px; font-weight: 600; margin-bottom: 2px; color: var(--text) }
.s-info p { font-size: 12px; color: var(--text2); line-height: 1.4 }
.s-arr { color: var(--text3) }
.s-arr svg { width: 16px; height: 16px }

.sett-panel {
  margin: 0 0 10px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all .18s;
  box-shadow: var(--shadow-xs);
}
.sett-panel:hover { box-shadow: var(--shadow-sm) }

.sett-save-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--shadow-accent);
}
.sett-save-btn:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #0a8a68 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(43,186,160,0.28);
}

.sett-msg {
  display: none;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}

.theme-card.on {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(43,186,160,.12) !important;
}


/* ══════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════ */

.pg-btn {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  color: var(--text2);
  transition: all .12s;
  font-weight: 500;
}
.pg-btn:hover {
  background: var(--accent-lighter);
  border-color: rgba(43,186,160,.2);
  color: var(--accent2);
}
.pg-btn.pg-on {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(43,186,160,.22);
}
.pg-btn:disabled { opacity: .35; cursor: not-allowed }

.page { display: none }
.page.on { display: block }


/* ══════════════════════════════════════
   AI PANEL — Slide-in Chat
   ══════════════════════════════════════ */

.aip {
  position: fixed;
  right: -400px;
  top: 0;
  width: 380px;
  height: 100vh;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-left: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: right .28s var(--ease-out);
  box-shadow: -12px 0 48px rgba(0,0,0,.10);
}
.aip.open { right: 0 }
.aip-h {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.aip-h h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.2px }
.aip-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-m {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 400;
}
.ai-m.bot {
  background: var(--border-light);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.ai-m.usr {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 3px 12px rgba(43,186,160,.22);
}

.aip-in {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}
.aip-inp {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  outline: none;
  background: var(--bg);
  transition: all .18s;
  color: var(--text);
}
.aip-inp:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43,186,160,.08);
  background: #fff;
}
.aip-send {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
  box-shadow: 0 2px 10px rgba(43,186,160,.22);
}
.aip-send:hover {
  background: linear-gradient(135deg, var(--accent-hover), #0a8a68);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(43,186,160,.30);
}
.aip-send svg { width: 16px; height: 16px }


/* ══════════════════════════════════════
   COMMAND PALETTE
   ══════════════════════════════════════ */

.cp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
}
.cp-overlay.show { display: flex }
.cp-box {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: 540px;
  max-height: 420px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeSlideUp .18s var(--ease-out);
  border: 1px solid var(--border);
}
.cp-input {
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid var(--border);
  font: inherit;
  font-size: 15px;
  font-weight: 450;
  outline: none;
  background: none;
  width: 100%;
  color: var(--text);
}
.cp-input::placeholder { color: var(--text3) }
.cp-list { overflow-y: auto; padding: 8px }
.cp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .1s;
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
}
.cp-item:hover,
.cp-item.sel {
  background: var(--accent-light);
  color: var(--accent2);
}
.cp-item svg { width: 16px; height: 16px; opacity: .45; flex-shrink: 0 }
.cp-item span { flex: 1 }


/* ══════════════════════════════════════
   MODALS — Premium
   ══════════════════════════════════════ */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.40);
  backdrop-filter: blur(6px);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.modal.show { display: flex }
.modal-box {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 28px;
  width: 480px;
  box-shadow: var(--shadow-xl);
  animation: fadeSlideUp .22s var(--ease-out);
  border: 1px solid var(--border);
}


/* ══════════════════════════════════════
   UPLOAD OVERLAY
   ══════════════════════════════════════ */

.upload-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.upload-overlay.show { display: flex }
.upload-box {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 28px;
  width: 380px;
  box-shadow: var(--shadow-xl);
  text-align: center;
  animation: fadeSlideUp .18s var(--ease-out);
  border: 1px solid var(--border);
}
.upload-box .uname { font-size: 13px; font-weight: 600; margin-bottom: 14px; word-break: break-all; color: var(--text) }
.upload-box .ubar { width: 100%; height: 6px; background: var(--border-light); border-radius: 4px; overflow: hidden; margin-bottom: 10px }
.upload-box .ubar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--mint)); border-radius: 4px; transition: width .15s ease; width: 0% }
.upload-box .upct { font-size: 12px; color: var(--text2); font-weight: 500 }


/* ══════════════════════════════════════
   AI MODAL / GENERATOR
   ══════════════════════════════════════ */

.ai-tab.on { border-color: var(--accent) !important; background: var(--accent-light) !important }
.ai-tab.on svg { stroke: var(--accent) !important }
.ai-tab.on span { color: var(--accent2) !important }
.ai-spinner { width: 18px; height: 18px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite }


/* ══════════════════════════════════════
   GAME TABS
   ══════════════════════════════════════ */

.game-tab {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  color: var(--text2);
  transition: all .18s var(--ease-spring);
}
.game-tab:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px) }
.game-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 10px rgba(43,186,160,.25) }


/* ══════════════════════════════════════
   FORMS — Premium Inputs
   ══════════════════════════════════════ */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="search"],
textarea,
select {
  font-family: inherit;
  font-size: 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  background: var(--surface);
  color: var(--text);
  transition: all .18s;
  outline: none;
  width: 100%;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(43,186,160,0.08) !important;
  background: #fff;
}
input::placeholder,
textarea::placeholder {
  color: var(--text3);
}

input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}


/* ══════════════════════════════════════
   SCROLLBAR — Minimal
   ══════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; height: 6px }
::-webkit-scrollbar-track { background: transparent }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.08); border-radius: 3px }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.14) }

/* Selection */
::selection { background: rgba(43,186,160,.18); color: var(--text) }


/* ══════════════════════════════════════
   ACCESSIBILITY — Focus Visible
   ══════════════════════════════════════ */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible,
.btn:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ══════════════════════════════════════
   RESPONSIVE — Mobile First
   ══════════════════════════════════════ */

@media (max-width: 1024px) {
  .wrap { padding: 24px }
  .stats { gap: 14px }
}

@media (max-width: 768px) {
  .side { 
    display: none;
    position: fixed;
    z-index: 200;
    width: 280px;
    box-shadow: 8px 0 40px rgba(0,0,0,.08);
  }
  .side.mobile-open { display: flex }
  .main { margin-left: 0 }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 12px }
  .wrap { padding: 20px 16px }
  .top { padding: 0 16px }
  .top h2 { font-size: 14px }
  .ph { flex-direction: column; align-items: flex-start; gap: 12px }
  .ph h1 { font-size: 20px }
  .trow { padding: 12px 8px }
  .trow-time { display: none }
  .trow-type { width: auto; min-width: 60px }
  .modal-box { width: calc(100vw - 32px); padding: 20px; border-radius: var(--r-lg) }
  .cp-box { width: calc(100vw - 32px) }
  .aip { width: 100vw; right: -100vw }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px }
  .stat { padding: 18px }
  .stat-n { font-size: 28px }
}
