/*
 * CCVIP visual theme.
 * Front-end-only overrides inspired by the supplied sub2api visual reference.
 * Routes, requests, permissions and application behavior are unchanged.
 */

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-elev: #f1f5f9;
  --bg-card: rgba(255, 255, 255, .88);
  --border: #e2e8f0;
  --border-hi: #cbd5e1;
  --text: #0f172a;
  --text-dim: #64748b;
  --text-faint: #94a3b8;
  --accent: #14b8a6;
  --accent-hi: #0d9488;
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --blue: #06b6d4;
  --purple: #8b5cf6;
  --gray: #94a3b8;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .04), 0 10px 30px rgba(15, 23, 42, .045);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, .14);
  --glow-accent: rgba(20, 184, 166, .18);
  --ease: cubic-bezier(.2, .72, .25, 1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html {
  background: var(--bg);
}

body {
  background:
    radial-gradient(at 36% 8%, rgba(20, 184, 166, .08), transparent 36%),
    radial-gradient(at 88% 2%, rgba(6, 182, 212, .07), transparent 32%),
    radial-gradient(at 0 55%, rgba(20, 184, 166, .05), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

::selection {
  background: rgba(20, 184, 166, .2);
  color: #134e4a;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, .48);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
  background-clip: content-box;
}

/* Login */
.login-wrap {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(rgba(20, 184, 166, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 184, 166, .035) 1px, transparent 1px),
    linear-gradient(135deg, #f8fafc 0%, #f0fdfa 48%, #f1f5f9 100%);
  background-size: 64px 64px, 64px 64px, auto;
}

.login-wrap::before,
.login-wrap::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 420px;
  height: 420px;
  border: 0;
  border-radius: 50%;
  filter: blur(64px);
  transform: none;
  opacity: .72;
  pointer-events: none;
}

.login-wrap::before {
  top: -210px;
  right: -150px;
  left: auto;
  background: rgba(45, 212, 191, .26);
}

.login-wrap::after {
  right: auto;
  bottom: -220px;
  left: -150px;
  background: rgba(6, 182, 212, .16);
}

.login-card {
  position: relative;
  width: 420px;
  padding: 38px 38px 36px;
  background: rgba(255, 255, 255, .75);
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 24px;
  box-shadow: 0 24px 72px rgba(15, 118, 110, .12), 0 2px 8px rgba(15, 23, 42, .05);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.login-card::before,
.login-card::after {
  content: none;
  display: none;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #2dd4bf, #0d9488);
  color: #fff;
  font-family: inherit;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 14px 32px rgba(20, 184, 166, .3);
}

.login-card h1 {
  margin-bottom: 7px;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.5px;
  text-align: center;
}

.login-card .sub {
  margin-bottom: 28px;
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
}

/* Controls */
.field label,
.advanced-filters label {
  color: #475569;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.field input,
.field textarea,
.field select,
.search input,
.log-search,
.advanced-filters input,
.advanced-filters select {
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}

.field input:hover,
.field textarea:hover,
.field select:hover,
.search input:hover,
.log-search:hover,
.advanced-filters input:hover,
.advanced-filters select:hover {
  border-color: #99f6e4;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search input:focus,
.log-search:focus,
.advanced-filters input:focus,
.advanced-filters select:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, .15);
}

.field input::placeholder,
.field textarea::placeholder,
.search input::placeholder,
.log-search::placeholder {
  color: var(--text-faint);
}

.btn {
  min-height: 38px;
  padding: 9px 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  border: 1px solid #14b8a6;
  border-radius: 12px;
  color: #fff;
  font-weight: 650;
  letter-spacing: 0;
  box-shadow: 0 7px 18px rgba(20, 184, 166, .2);
}

.btn:hover {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  border-color: #0d9488;
  box-shadow: 0 10px 24px rgba(20, 184, 166, .28);
  transform: translateY(-1px);
}

.btn.ghost {
  background: rgba(255, 255, 255, .84);
  border-color: var(--border);
  color: #475569;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.btn.ghost:hover {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #0f766e;
}

.btn.danger {
  background: #fff;
  border-color: #fecaca;
  color: #dc2626;
  box-shadow: none;
}

.btn.danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* Shell and navigation */
.layout {
  background: transparent;
}

.sidebar {
  width: 248px;
  padding: 22px 14px 16px;
  background: rgba(255, 255, 255, .9);
  border-right: 1px solid rgba(226, 232, 240, .9);
  box-shadow: 8px 0 30px rgba(15, 23, 42, .025);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  gap: 11px;
  padding: 2px 9px 27px;
}

.brand::after {
  content: none;
  display: none;
}

.brand .logo {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #2dd4bf, #0d9488);
  box-shadow: 0 8px 20px rgba(20, 184, 166, .24);
}

.brand .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand .name small {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
}

.nav {
  gap: 5px;
}

.nav a {
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #64748b;
  font-size: 13.5px;
  font-weight: 550;
}

.nav a:hover {
  background: #f0fdfa;
  color: #0f766e;
}

.nav a.active {
  background: linear-gradient(90deg, #ccfbf1, #f0fdfa);
  border-color: rgba(153, 246, 228, .62);
  color: #0f766e;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #14b8a6;
}

.nav a.active::before {
  content: none;
  display: none;
}

.nav-ico {
  color: currentColor;
}

.sidebar-foot {
  border-top-color: var(--border);
}

.sidebar-foot .user,
.sidebar-foot .user b {
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
}

.sidebar-foot .user b {
  color: var(--text);
}

.main {
  max-width: 1600px;
  padding: 34px 42px 56px;
}

.page-head h2 {
  color: var(--text);
  font-weight: 750;
}

.page-head {
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: 0;
}

.page-head::after {
  content: none;
  display: none;
}

.page-head .sub {
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
}

/* Cards and data surfaces */
.card,
.table-wrap,
.strip-stats,
.next-box,
.log-filters,
.pool-usage,
.cost-top-row {
  background: rgba(255, 255, 255, .84);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.card {
  padding: 21px;
}

.card::before {
  content: none;
  display: none;
}

.card:hover {
  border-color: #ccfbf1;
  box-shadow: 0 14px 38px rgba(15, 118, 110, .08);
}

.card h3 {
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.stat .label,
.mini-l,
.strip-l,
.hero-stat-l,
.chart-title,
.token-strip span {
  color: var(--text-dim);
  font-family: inherit;
  letter-spacing: 0;
}

.stat .value,
.mini-v,
.strip-v,
.hero-stat-v,
.token-strip strong {
  color: var(--text);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

.section-title:after {
  background: var(--border);
}

.section-title {
  color: var(--text);
  font-family: inherit;
  font-size: 18px;
  letter-spacing: -.3px;
}

.section-title::before {
  content: none;
  display: none;
}

.section-title .note {
  color: var(--text-dim);
}

.hero {
  gap: 30px;
  padding: 31px 32px;
  background:
    radial-gradient(circle at 90% 5%, rgba(94, 234, 212, .28), transparent 35%),
    linear-gradient(135deg, #0f766e 0%, #0d9488 52%, #14b8a6 100%);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 22px;
  box-shadow: 0 20px 46px rgba(13, 148, 136, .18);
}

.hero::before {
  border-color: rgba(255, 255, 255, .16);
}

.hero-kicker,
.hero-stat-l,
.hero-title-sub {
  color: rgba(255, 255, 255, .74);
}

.hero-kicker,
.hero-title,
.hero-stat-v {
  font-family: inherit;
}

.hero-title,
.hero-stat-v {
  color: #fff;
}

.hero-right {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15, 118, 110, .14);
}

.table-wrap {
  overflow: hidden auto;
}

th {
  background: rgba(248, 250, 252, .94);
  color: #64748b;
  border-bottom-color: var(--border);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .15px;
  text-transform: none;
}

td {
  color: #334155;
  border-bottom-color: #f1f5f9;
}

.mono {
  color: var(--text-dim);
}

.legend,
.donut-legend .item,
.model-row-top,
.pool-usage-meta {
  color: var(--text-dim);
  font-family: inherit;
}

tbody tr:hover td,
.log-row:hover td {
  background: #f0fdfa;
}

.bar,
.model-bar-bg {
  background: #e2e8f0;
}

.badge,
.pool-tag {
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0;
}

.badge.active {
  background: #ecfdf5;
  color: #047857;
}

.badge.limited {
  background: #fffbeb;
  color: #b45309;
}

.badge.banned {
  background: #fef2f2;
  color: #dc2626;
}

.badge.expired,
.pool-tag[class~="5x"] {
  background: #ecfeff;
  color: #0e7490;
}

.pool-tag[class~="20x"] {
  background: #f0fdfa;
  color: #0f766e;
}

.tabs {
  gap: 6px;
}

.tab {
  border-radius: 10px;
  font-family: inherit;
}

.tab:hover {
  background: #f0fdfa;
  color: #0f766e;
}

.tab.active {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  box-shadow: 0 6px 14px rgba(20, 184, 166, .18);
}

.tabs-label {
  color: var(--text-dim);
  font-family: inherit;
}

.pointer-item {
  background: #f8fafc;
  border-radius: 11px;
}

.pointer-item.cur {
  background: #f0fdfa;
  border-color: #5eead4;
}

.nb-ico,
.cost-rank {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  border: 0;
  border-radius: 10px;
  color: #fff;
}

.strip-stats {
  border-left: 1px solid rgba(226, 232, 240, .9);
}

.modal-mask {
  background: rgba(15, 23, 42, .5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal {
  background: #fff;
  border-color: rgba(255, 255, 255, .8);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.modal h3 {
  color: var(--text);
}

.modal-close {
  background: #f1f5f9;
  border-radius: 9px;
}

.modal-close:hover {
  background: #ccfbf1;
  color: #0f766e;
}

.detail-grid section {
  border-color: var(--border);
  border-radius: 12px;
}

.detail-grid h4 {
  background: #f8fafc;
  border-color: var(--border);
  color: var(--text);
  font-family: inherit;
}

.detail-row,
.advanced-filters {
  border-color: var(--border);
}

.toast {
  background: #0f172a;
  border-radius: 12px;
}

.tool-lock-card {
  background: rgba(255, 255, 255, .9);
}

.tool-lock-ico {
  background: #f0fdfa;
  border-color: #ccfbf1;
  color: #0f766e;
}

.empty {
  color: var(--text-dim);
  font-family: inherit;
}

.load-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 130px;
  text-align: center;
  color: var(--text-dim);
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff, #fffafa);
}

.load-error strong {
  color: #b91c1c;
  font-size: 14px;
}

.load-error span {
  max-width: 680px;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: normal;
}

.load-error .btn {
  margin-top: 4px;
}

input[type="range"] {
  background: #e2e8f0;
}

input[type="range"]::-webkit-slider-thumb,
input[type="range"]::-moz-range-thumb {
  background: var(--accent);
}

.switch input:checked + .slider {
  background: var(--accent);
}

@keyframes ccvipRise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

.main > * {
  animation: ccvipRise .3s var(--ease) both;
}

@media (max-width: 820px) {
  .sidebar {
    width: 206px;
  }

  .main {
    padding: 26px 22px 42px;
  }
}

@media (max-width: 620px) {
  .sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav a.active {
    box-shadow: inset 0 -3px 0 #14b8a6;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
  }

  .nav a {
    min-width: 0;
    justify-content: flex-start;
    padding: 9px 11px;
    white-space: normal;
  }

  .table-wrap td.empty {
    padding: 28px 16px;
    text-align: left;
  }

  .table-wrap td.empty .load-error {
    width: calc(100vw - 78px);
    min-height: 110px;
    margin: 0;
    text-align: center;
  }

  .table-wrap td.empty .load-error span {
    width: 100%;
    max-width: 100%;
  }

  .login-card {
    padding: 32px 24px 30px;
    border-radius: 20px;
  }

  .hero {
    padding: 25px 22px;
    border-radius: 18px;
  }
}
