/* Shared polished UI for customer and admin screens */
:root {
  --gx-bg: #070809;
  --gx-surface: #0d0f10;
  --gx-surface-2: #111315;
  --gx-surface-3: #171a1d;
  --gx-line: rgba(255,255,255,.08);
  --gx-line-strong: rgba(255,255,255,.14);
  --gx-text: #eef0f3;
  --gx-muted: #8b929c;
  --gx-muted-2: #555b64;
  --gx-brand: #e07c27;
  --gx-brand-2: #f59e52;
  --gx-ok: #22c55e;
  --gx-danger: #ef4444;
  --gx-radius: 12px;
  --gx-shadow: 0 18px 60px rgba(0,0,0,.34);
}

/* Premium interaction layer */
:root {
  --gx-focus: 0 0 0 3px rgba(224,124,39,.12);
  --gx-card-highlight: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  --gx-button-shadow: 0 10px 22px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.08);
  --gx-brand-shadow: 0 14px 30px rgba(224,124,39,.2), inset 0 1px 0 rgba(255,255,255,.18);
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

.btn-primary,
.btn-save,
.btn-subscribe,
a.btn-primary,
button[type="submit"]:not(.btn-ghost):not(.btn-danger) {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 42%),
    linear-gradient(135deg, #f08b34, #c7651c);
  border: 1px solid rgba(245,158,82,.45);
  color: #fff !important;
  box-shadow: var(--gx-brand-shadow);
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(0,0,0,.22);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, filter .16s ease;
}

.btn-primary::after,
.btn-save::after,
.btn-subscribe::after,
a.btn-primary::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(255,255,255,.14), transparent 34%, rgba(255,255,255,.08));
  opacity: .75;
  pointer-events: none;
}

.btn-primary:hover,
.btn-save:hover,
.btn-subscribe:hover,
a.btn-primary:hover,
button[type="submit"]:not(.btn-ghost):not(.btn-danger):hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(224,124,39,.22), inset 0 1px 0 rgba(255,255,255,.2);
}

.btn-primary:active,
.btn-save:active,
.btn-subscribe:active,
a.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost,
.btn-copy,
a.btn-ghost,
.new-chat-btn,
.clear-btn,
.sidebar-collapse-btn,
.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  border: 1px solid rgba(255,255,255,.1);
  color: #dce1e8;
  box-shadow: var(--gx-button-shadow);
  text-decoration: none;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.btn-ghost:hover,
.btn-copy:hover,
a.btn-ghost:hover,
.new-chat-btn:hover,
.clear-btn:hover,
.sidebar-collapse-btn:hover,
.hamburger:hover {
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, rgba(224,124,39,.14), rgba(224,124,39,.045));
  border-color: rgba(224,124,39,.28);
  color: #fff;
  box-shadow: 0 14px 28px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.1);
}

.btn-danger,
.btn-danger-ghost,
button.btn-danger {
  background: linear-gradient(180deg, rgba(239,68,68,.14), rgba(239,68,68,.055));
  border-color: rgba(239,68,68,.24);
  color: #fecaca !important;
}

.btn-danger:hover,
.btn-danger-ghost:hover,
button.btn-danger:hover {
  background: linear-gradient(180deg, rgba(239,68,68,.22), rgba(239,68,68,.08)) !important;
  border-color: rgba(239,68,68,.4) !important;
  color: #fff !important;
}

.btn-sm {
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 9px;
}

.stat-card,
.usage-stat,
.api-key-section,
.api-section,
.plan-card,
.form-card,
.table-card,
.content-card,
.chart-card,
.dashboard-card,
.usage-card,
.customer-card,
.settings-card,
.section-block,
.detail-card,
.preview-card {
  background:
    var(--gx-card-highlight),
    rgba(17,19,21,.86);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow:
    0 18px 42px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.035);
}

.stat-card:hover,
.usage-stat:hover,
.api-section:hover,
.plan-card:hover,
.table-card:hover,
.content-card:hover,
.chart-card:hover,
.section-block:hover {
  border-color: rgba(224,124,39,.24);
}

.stat-card::before,
.usage-stat::before,
.chart-card::before,
.section-block::before,
.table-card::before,
.plan-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.055), transparent 38%);
  opacity: .7;
}

.section-block,
.table-card,
.chart-card,
.plan-card,
.stat-card,
.usage-stat {
  position: relative;
}

.section-block > *,
.table-card > *,
.chart-card > *,
.plan-card > *,
.stat-card > *,
.usage-stat > * {
  position: relative;
}

.stat-icon,
.preview-logo,
.favicon-box {
  background:
    linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0) 45%),
    linear-gradient(135deg, rgba(224,124,39,.28), rgba(224,124,39,.09));
  border: 1px solid rgba(224,124,39,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 12px 24px rgba(224,124,39,.12);
}

.badge,
.status-badge,
.model-badge,
.plan-badge,
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
  color: #d8dde5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  font-weight: 700;
}

.badge-active {
  background: linear-gradient(180deg, rgba(34,197,94,.16), rgba(34,197,94,.055)) !important;
  border-color: rgba(34,197,94,.28) !important;
  color: #86efac !important;
}

.badge-inactive {
  color: #9aa1ab !important;
}

.badge-free {
  background: linear-gradient(180deg, rgba(59,130,246,.16), rgba(59,130,246,.055)) !important;
  border-color: rgba(59,130,246,.28) !important;
  color: #93c5fd !important;
}

input,
select,
textarea,
.form-input,
.form-select,
.form-control,
.profile-field input,
.profile-field textarea,
.metadata-row input {
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
    #090b0c;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: var(--gx-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:hover,
select:hover,
textarea:hover,
.form-input:hover,
.form-select:hover,
.form-control:hover {
  border-color: rgba(255,255,255,.16);
}

input:focus,
select:focus,
textarea:focus,
.form-input:focus,
.form-select:focus,
.form-control:focus,
.profile-field input:focus,
.profile-field textarea:focus,
.metadata-row input:focus {
  border-color: rgba(224,124,39,.5);
  box-shadow: var(--gx-focus), inset 0 1px 0 rgba(255,255,255,.05);
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  background: rgba(255,255,255,.03);
  color: #7e8793;
  font-weight: 750;
}

.data-table tbody tr {
  transition: background .14s ease;
}

.data-table tbody tr:hover td {
  background: rgba(224,124,39,.026);
}

.data-table code,
code {
  border-radius: 7px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.07);
  color: #e7ebf0;
}

.hero-kicker,
.preview-label,
.plan-models-label,
.usage-stat-label,
.stat-label {
  color: #a0a7b1;
}

.cell-link {
  color: #f4a15d;
  text-decoration: none;
}

.cell-link:hover {
  color: #ffc18d;
}

.alert-success,
.flash-success {
  background: linear-gradient(180deg, rgba(34,197,94,.13), rgba(34,197,94,.05)) !important;
  border: 1px solid rgba(34,197,94,.24) !important;
  color: #86efac !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.alert-error {
  background: linear-gradient(180deg, rgba(239,68,68,.13), rgba(239,68,68,.05)) !important;
  border: 1px solid rgba(239,68,68,.24) !important;
  color: #fca5a5 !important;
}

.toolbar,
.filter-bar,
.search-bar {
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.014)),
    rgba(17,19,21,.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 12px 28px rgba(0,0,0,.12);
}

html, body { background: var(--gx-bg); }
body {
  color: var(--gx-text);
  overflow-x: hidden;
}

.app-layout {
  background:
    radial-gradient(circle at 64% -14%, rgba(224,124,39,.09), transparent 34%),
    linear-gradient(180deg, #090a0b 0%, #070809 100%);
}

.sidebar {
  width: 240px;
  min-width: 240px;
  background: linear-gradient(180deg, #101214 0%, #0b0d0f 100%);
  border-right: 1px solid var(--gx-line);
  box-shadow: 10px 0 32px rgba(0,0,0,.16);
  transition: width .2s ease, min-width .2s ease, transform .25s ease;
}

.sidebar-logo,
.sidebar-brand {
  min-height: 68px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--gx-line);
  background: rgba(255,255,255,.015);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo svg,
.sidebar-brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(224,124,39,.2);
  flex-shrink: 0;
}

.sidebar-logo span,
.sidebar-brand > div:not(.logo) {
  color: var(--gx-text);
  font-size: 14px;
  font-weight: 650;
}

.sidebar-logo small,
.sidebar-brand small {
  color: var(--gx-muted-2);
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 9px;
}

.sidebar-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,.05);
  border-color: var(--gx-line);
}

.sidebar.collapsed {
  width: 56px;
  min-width: 56px;
}

.sidebar.collapsed .sidebar-logo > div,
.sidebar.collapsed .sidebar-brand > div:not(.logo),
.sidebar.collapsed .sidebar-nav a,
.sidebar.collapsed .sidebar-footer a {
  font-size: 0;
}

.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  gap: 0;
  padding: 12px 0;
  position: relative;
}

.sidebar.collapsed .sidebar-logo > svg,
.sidebar.collapsed .sidebar-brand .logo {
  display: none;
}

.sidebar.collapsed .sidebar-collapse-btn {
  width: 36px;
  height: 36px;
  margin-left: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.07);
  color: #fff;
}

.sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-nav a,
.sidebar.collapsed .sidebar-footer a {
  justify-content: center;
  gap: 0;
  padding: 9px;
}

.sidebar.collapsed .sidebar-nav a svg,
.sidebar.collapsed .sidebar-footer a svg {
  margin: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 8px;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-nav a,
.sidebar-footer a {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid transparent;
  color: var(--gx-muted);
  font-size: 13px;
  letter-spacing: .01em;
}

.sidebar-nav a:hover,
.sidebar-footer a:hover {
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.05);
  color: var(--gx-text);
}

.sidebar-nav a.active {
  background: linear-gradient(135deg, rgba(224,124,39,.16), rgba(224,124,39,.06));
  border-color: rgba(224,124,39,.18);
  color: var(--gx-brand-2);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--gx-line);
}

.main-area {
  min-width: 0;
  background: rgba(7,8,9,.55);
}

.top-header {
  min-height: 64px;
  padding: 12px 24px;
  background: rgba(9,10,11,.86);
  border-bottom: 1px solid var(--gx-line);
  backdrop-filter: blur(16px);
}

.top-header h1 {
  font-size: 16px;
  letter-spacing: -.02em;
}

.top-header h1 small,
.top-header-right {
  color: var(--gx-muted-2);
}

.hamburger {
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--gx-line);
  background: rgba(255,255,255,.03);
}

.content-wrapper {
  padding: 26px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-header-left {
  min-width: 0;
}

.page-header-left h2,
.page-header h2,
.content-wrapper > h2 {
  color: var(--gx-text);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.03em;
}

.page-header-left p,
.page-header p,
.content-wrapper > p {
  color: var(--gx-muted);
  margin-top: 5px;
}

.page-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.stats-grid,
.usage-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card,
.usage-stat,
.api-key-section,
.api-section,
.plan-card,
.form-card,
.table-card,
.content-card,
.chart-card,
.dashboard-card,
.usage-card,
.customer-card,
.settings-card {
  background: rgba(17,19,21,.84);
  border: 1px solid var(--gx-line);
  border-radius: var(--gx-radius);
  box-shadow: 0 12px 34px rgba(0,0,0,.14);
}

.stat-card,
.usage-stat,
.api-key-section,
.api-section,
.form-card,
.table-card,
.content-card,
.chart-card,
.dashboard-card,
.usage-card,
.customer-card,
.settings-card {
  padding: 22px;
}

.stat-card:hover,
.usage-stat:hover,
.api-section:hover,
.plan-card:hover,
.table-card:hover,
.content-card:hover {
  border-color: rgba(224,124,39,.22);
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card-accent,
.plan-card-accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gx-brand), rgba(224,124,39,.18));
}

.stat-card-body,
.plan-card-body {
  position: relative;
  display: flex;
  gap: 14px;
}

.stat-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(224,124,39,.12);
  color: var(--gx-brand-2);
  flex: 0 0 auto;
}

.stat-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-card .stat-label,
.usage-stat-label,
.section-desc,
.form-hint,
.help-text,
.muted,
.text-muted,
td small {
  color: var(--gx-muted);
}

.stat-card .stat-value,
.usage-stat-value,
.api-section h2,
.api-key-section h2,
.plan-card h2,
.page-title,
.section-title,
th {
  color: var(--gx-text);
}

.stat-card .stat-value,
.usage-stat-value {
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -.035em;
}

.stat-sublabel {
  color: var(--gx-muted-2);
  font-size: 12px;
}

.stat-card .stat-value span,
.cell-link,
a {
  color: var(--gx-brand-2);
}

.chart-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.chart-card {
  min-height: 280px;
}

.section-block,
.table-card {
  overflow: hidden;
}

.section-block {
  background: rgba(17,19,21,.84);
  border: 1px solid var(--gx-line);
  border-radius: var(--gx-radius);
  box-shadow: 0 12px 34px rgba(0,0,0,.14);
}

.section-block-header,
.table-header,
.api-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--gx-line);
}

.section-block-header h3,
.table-header h3,
.api-section-header h3 {
  color: var(--gx-text);
  font-size: 15px;
  letter-spacing: -.02em;
}

.section-block-body {
  color: var(--gx-muted);
}

.table-responsive,
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  min-width: 720px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.cell-primary,
.cell-cost,
.cell-total-tokens,
.cell-endpoint {
  color: var(--gx-text);
  font-weight: 600;
}

.cell-url {
  color: var(--gx-muted);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-bar,
.search-bar,
.toolbar {
  background: rgba(17,19,21,.72);
  border: 1px solid var(--gx-line);
  border-radius: var(--gx-radius);
  padding: 14px;
  margin-bottom: 16px;
}

.filter-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select,
.filter-input,
.search-input {
  min-height: 38px;
  padding: 0 12px;
}

.search-input {
  width: min(320px, 100%);
}

.api-key-box,
.code-block,
pre,
code,
.mono-textarea,
.profile-textarea {
  background: #0a0c0d;
  border: 1px solid var(--gx-line);
  border-radius: 10px;
}

.api-key-box {
  color: #d7dbe2;
}

.btn-primary,
button[type="submit"],
.btn-save,
.btn-subscribe,
.btn-copy,
.btn-ghost,
.btn-danger,
.btn-sm,
a.btn-primary,
a.btn-ghost {
  border-radius: 9px;
  min-height: 34px;
  font-weight: 650;
}

.btn-primary,
.btn-save,
.btn-subscribe,
button[type="submit"]:not(.btn-ghost):not(.btn-danger) {
  background: linear-gradient(135deg, var(--gx-brand), #c7651c);
  border: 1px solid rgba(224,124,39,.34);
  color: #fff;
  box-shadow: 0 10px 24px rgba(224,124,39,.16);
}

.btn-primary:hover,
.btn-save:hover,
.btn-subscribe:hover,
button[type="submit"]:not(.btn-ghost):not(.btn-danger):hover {
  filter: brightness(1.06);
}

.btn-copy,
.btn-ghost {
  background: rgba(255,255,255,.035);
  border: 1px solid var(--gx-line);
  color: #d8dde5;
}

.btn-copy:hover,
.btn-ghost:hover {
  background: rgba(224,124,39,.08);
  border-color: rgba(224,124,39,.26);
  color: #fff;
}

.btn-danger,
.btn-danger-ghost {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  color: #fca5a5;
}

.btn-sm {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

input,
select,
textarea,
.form-input,
.form-select,
.form-control {
  background: #0a0c0d;
  border: 1px solid var(--gx-line);
  border-radius: 10px;
  color: var(--gx-text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus,
.form-input:focus,
.form-select:focus,
.form-control:focus {
  border-color: rgba(224,124,39,.45);
  box-shadow: 0 0 0 3px rgba(224,124,39,.08);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background: rgba(255,255,255,.025);
  color: var(--gx-muted);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

td,
th {
  border-bottom: 1px solid rgba(255,255,255,.055);
}

td {
  color: #d9dde3;
}

tr:hover td {
  background: rgba(255,255,255,.018);
}

.badge,
.status-badge,
.model-badge,
.plan-badge {
  border-radius: 999px;
  border: 1px solid var(--gx-line);
  background: rgba(255,255,255,.04);
}

.plan-card {
  background: rgba(17,19,21,.88);
  position: relative;
  overflow: hidden;
}

.plan-card.featured {
  border-color: rgba(224,124,39,.36);
  box-shadow: 0 16px 42px rgba(224,124,39,.08);
}

.plan-card.featured::before {
  background: linear-gradient(135deg, var(--gx-brand), #c7651c);
}

.sidebar-overlay {
  backdrop-filter: blur(3px);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 16px 0 0;
}

.pagination-wrap,
nav[role="navigation"] {
  width: 100%;
}

.pagination-wrap nav[role="navigation"],
.content-wrapper > nav[role="navigation"] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0 4px;
}

nav[role="navigation"] > div:first-child {
  display: none;
}

nav[role="navigation"] > div:last-child {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

nav[role="navigation"] p {
  display: none;
}

nav[role="navigation"] span,
nav[role="navigation"] a {
  text-decoration: none;
}

nav[role="navigation"] a,
nav[role="navigation"] span[aria-current="page"] > span,
nav[role="navigation"] span[aria-disabled="true"] > span {
  display: inline-flex !important;
  min-width: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 7px 10px !important;
  border: 1px solid var(--gx-line) !important;
  border-radius: 9px !important;
  background: rgba(17,19,21,.84) !important;
  color: var(--gx-muted) !important;
  font-size: 12px !important;
  font-weight: 650;
  line-height: 1 !important;
}

nav[role="navigation"] a:hover {
  border-color: rgba(224,124,39,.32) !important;
  background: rgba(224,124,39,.08) !important;
  color: var(--gx-brand-2) !important;
}

nav[role="navigation"] span[aria-current="page"] > span {
  border-color: rgba(224,124,39,.42) !important;
  background: rgba(224,124,39,.14) !important;
  color: var(--gx-brand-2) !important;
}

nav[role="navigation"] span[aria-disabled="true"] > span {
  opacity: .38;
}

nav[role="navigation"] svg {
  width: 16px !important;
  height: 16px !important;
  display: block;
}

.plans-grid,
.stats-grid,
.chart-row,
.usage-stats-bar {
  min-width: 0;
}

.plan-card,
.stat-card,
.chart-card,
.usage-stat {
  min-width: 0;
}

.plan-card *,
.stat-card *,
.chart-card *,
.usage-stat * {
  min-width: 0;
}

.model-badge,
.plan-badge,
.badge {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.empty-state,
.empty-state-full {
  color: var(--gx-muted);
  text-align: center;
  padding: 34px 18px;
}

.modal-content,
.dropdown-menu {
  background: #101214;
  border: 1px solid var(--gx-line);
  border-radius: var(--gx-radius);
  box-shadow: var(--gx-shadow);
}

body:has(.sidebar-logo) .sidebar {
  width: 240px;
  min-width: 240px;
}

body:has(.sidebar-logo) .sidebar.collapsed {
  width: 56px;
  min-width: 56px;
}

body:has(.sidebar-logo) .sidebar-logo {
  min-height: 68px;
  padding: 16px 18px;
  gap: 10px;
}

body:has(.sidebar-logo) .sidebar-logo > svg {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

body:has(.sidebar-logo) .sidebar-collapse-btn {
  color: #fff;
}

body:has(.sidebar-logo) .sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 12px 0;
  gap: 0;
}

body:has(.sidebar-logo) .sidebar.collapsed .sidebar-logo > svg,
body:has(.sidebar-logo) .sidebar.collapsed .sidebar-logo > div {
  display: none;
}

body:has(.sidebar-logo) .sidebar.collapsed .sidebar-collapse-btn {
  display: inline-flex;
  margin: 0;
}

body:has(.sidebar-logo) .sidebar.collapsed .sidebar-nav a,
body:has(.sidebar-logo) .sidebar.collapsed .sidebar-footer a {
  justify-content: center;
  gap: 0;
  padding: 9px;
  font-size: 0;
}

@media (max-width: 768px) {
  .sidebar {
    width: 266px;
    min-width: 266px;
    box-shadow: 30px 0 80px rgba(0,0,0,.45);
  }

  .sidebar.collapsed {
    width: 266px;
    min-width: 266px;
  }

  body:has(.sidebar-logo) .sidebar.collapsed {
    width: 266px;
    min-width: 266px;
  }

  .sidebar.collapsed .sidebar-logo > div,
  .sidebar.collapsed .sidebar-brand > div:not(.logo),
  .sidebar.collapsed .sidebar-nav a,
  .sidebar.collapsed .sidebar-footer a {
    font-size: 13px;
  }

  body:has(.sidebar-logo) .sidebar.collapsed .sidebar-logo > svg,
  body:has(.sidebar-logo) .sidebar.collapsed .sidebar-logo > div {
    display: block;
  }

  body:has(.sidebar-logo) .sidebar.collapsed .sidebar-logo > svg {
    display: inline;
  }

  body:has(.sidebar-logo) .sidebar.collapsed .sidebar-nav a,
  body:has(.sidebar-logo) .sidebar.collapsed .sidebar-footer a {
    justify-content: flex-start;
    gap: 10px;
    padding: 9px 12px;
    font-size: 13px;
  }

  .sidebar.collapsed .sidebar-logo,
  .sidebar.collapsed .sidebar-brand {
    justify-content: flex-start;
    padding: 14px 16px;
  }

  .sidebar.collapsed .sidebar-logo > svg,
  .sidebar.collapsed .sidebar-brand .logo {
    display: flex;
  }

  .sidebar-collapse-btn {
    display: none;
  }

  .top-header {
    padding: 10px 12px;
  }

  .top-header h1 {
    font-size: 14px;
  }

  .top-header-right {
    display: none;
  }

  .content-wrapper {
    padding: 14px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .page-header-right,
  .filter-form {
    justify-content: stretch;
  }

  .page-header-right > *,
  .filter-form > * {
    flex: 1 1 150px;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .plans-grid,
  .usage-stats-bar {
    grid-template-columns: 1fr;
  }

  .section-block-header,
  .table-header,
  .api-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .cell-actions {
    justify-content: flex-start;
  }

  .api-key-box {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Final priority polish */
.btn-primary,
.btn-save,
.btn-subscribe,
a.btn-primary,
button[type="submit"]:not(.btn-ghost):not(.btn-danger) {
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 42%),
    linear-gradient(135deg, #f08b34, #c7651c) !important;
  border: 1px solid rgba(245,158,82,.45) !important;
  border-radius: 10px !important;
  color: #fff !important;
  box-shadow: 0 14px 30px rgba(224,124,39,.2), inset 0 1px 0 rgba(255,255,255,.18) !important;
}

.btn-ghost,
.btn-copy,
a.btn-ghost,
.hamburger,
.sidebar-collapse-btn {
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018)) !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  border-radius: 10px !important;
  color: #dce1e8 !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.08) !important;
}

.btn-primary:hover,
.btn-save:hover,
.btn-subscribe:hover,
a.btn-primary:hover,
.btn-ghost:hover,
.btn-copy:hover,
a.btn-ghost:hover,
.hamburger:hover,
.sidebar-collapse-btn:hover {
  transform: translateY(-1px);
}

.stat-card,
.usage-stat,
.plan-card,
.table-card,
.chart-card,
.section-block,
.api-section,
.api-key-section,
.form-card,
.content-card,
.detail-card,
.preview-card {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012)), rgba(17,19,21,.86) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.035) !important;
}

input,
select,
textarea,
.form-input,
.form-select,
.form-control {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)), #090b0c !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  border-radius: 10px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035) !important;
}

input:focus,
select:focus,
textarea:focus,
.form-input:focus,
.form-select:focus,
.form-control:focus {
  border-color: rgba(224,124,39,.5) !important;
  box-shadow: 0 0 0 3px rgba(224,124,39,.12), inset 0 1px 0 rgba(255,255,255,.05) !important;
}

.badge,
.status-badge,
.model-badge,
.plan-badge,
.source-badge {
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.025)) !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  border-radius: 999px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06) !important;
}

/* Admin pro refinement layer */
body:has(.app-layout) {
  --admin-topbar: 64px;
  background:
    radial-gradient(circle at 18% -10%, rgba(224,124,39,.11), transparent 30%),
    radial-gradient(circle at 86% 12%, rgba(59,130,246,.055), transparent 28%),
    #070809;
}

body:has(.app-layout) .app-layout {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 180px),
    #070809;
}

body:has(.app-layout) .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), transparent 90px),
    #0b0d0f;
  border-right: 1px solid rgba(255,255,255,.085);
}

body:has(.app-layout) .sidebar-logo {
  min-height: var(--admin-topbar);
  background:
    linear-gradient(180deg, rgba(224,124,39,.075), rgba(255,255,255,.012));
}

body:has(.app-layout) .sidebar-logo span {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:has(.app-layout) .sidebar-nav a,
body:has(.app-layout) .sidebar-footer a {
  position: relative;
  min-height: 40px;
  border-radius: 10px;
  letter-spacing: 0;
}

body:has(.app-layout) .sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: -8px;
  width: 3px;
  height: 22px;
  border-radius: 999px;
  background: #f59e52;
  box-shadow: 0 0 18px rgba(224,124,39,.55);
}

body:has(.app-layout) .sidebar-nav a svg,
body:has(.app-layout) .sidebar-footer a svg {
  width: 18px;
  height: 18px;
}

body:has(.app-layout) .main-area {
  min-height: 100vh;
}

body:has(.app-layout) .top-header {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: var(--admin-topbar);
  background: rgba(8,9,10,.82);
  border-bottom: 1px solid rgba(255,255,255,.075);
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
}

body:has(.app-layout) .top-header h1 {
  display: flex;
  align-items: baseline;
  gap: 9px;
  color: #f4f6f8;
  font-size: 16px;
  line-height: 1.2;
}

body:has(.app-layout) .top-header h1 small {
  max-width: 44vw;
  overflow: hidden;
  color: #737b86;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:has(.app-layout) .content-wrapper {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 28px;
}

.dashboard-hero,
.usage-hero,
.plans-hero,
.admin-hero {
  position: relative;
  overflow: hidden;
  border-radius: 14px !important;
  box-shadow: 0 20px 48px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.055);
}

.dashboard-hero::after,
.usage-hero::after,
.plans-hero::after,
.admin-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.06), transparent 28%),
    radial-gradient(circle at 100% 0, rgba(224,124,39,.14), transparent 36%);
}

.dashboard-hero > *,
.usage-hero > *,
.plans-hero > *,
.admin-hero > * {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  color: #ffb06d !important;
}

.page-header {
  padding: 4px 0 2px;
}

.search-input,
.filter-input,
.filter-select,
.form-group input,
.form-group select,
.form-group textarea {
  min-height: 40px;
}

.search-input {
  width: min(380px, 100%) !important;
  padding-left: 38px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23777f8b' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 13px center / 15px,
    #090b0c !important;
}

.filter-bar {
  padding: 12px !important;
}

.filter-form > select,
.filter-form > input {
  flex: 1 1 180px;
}

.btn-primary,
.btn-save,
.btn-subscribe,
.btn-ghost,
.btn-copy,
a.btn-primary,
a.btn-ghost,
button[type="submit"] {
  white-space: nowrap;
}

.btn-primary svg,
.btn-ghost svg,
.btn-save svg,
.btn-copy svg {
  flex: 0 0 auto;
}

.table-card {
  padding: 0 !important;
  overflow: hidden;
}

.table-card > .section-block-header:first-child,
.table-card > .table-header:first-child {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
}

.data-table {
  min-width: 760px;
  font-size: 13px !important;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px !important;
  background: #101214 !important;
  color: #818a96 !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  letter-spacing: .075em !important;
  text-transform: uppercase;
}

.data-table td {
  padding: 13px 14px !important;
  color: #d7dce3 !important;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table code,
code.truncated-key,
.cell-endpoint {
  display: inline-flex;
  max-width: 280px;
  overflow: hidden;
  align-items: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-actions {
  min-width: 150px;
}

.cell-actions form {
  margin: 0;
}

.stat-card,
.usage-stat,
.chart-card,
.plan-card,
.section-block,
.form-card,
.content-card,
.customer-card,
.settings-card,
.api-section,
.api-key-section,
.detail-card {
  border-radius: 14px !important;
}

.stat-card,
.usage-stat {
  min-height: 112px;
  overflow: hidden;
}

.stat-card::after,
.usage-stat::after,
.chart-card::after,
.plan-card::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 14px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(224,124,39,.12), transparent);
  opacity: .45;
  pointer-events: none;
}

.usage-stat-value,
.stat-value {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.plan-card {
  padding: 0 !important;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.plan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 54px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.045) !important;
}

.plan-card-body {
  padding: 18px;
}

.plan-token-pill,
.source-badge,
.badge {
  line-height: 1.15;
}

.form-page {
  max-width: 920px;
  margin: 0 auto;
}

.form-card {
  padding: 24px !important;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: inline-flex;
  margin-bottom: 7px;
  color: #a5acb6;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .02em;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.075);
}

.readonly-field,
.api-key-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}

.readonly-field code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-card canvas {
  max-width: 100%;
}

.pagination-wrap {
  display: flex;
  justify-content: center;
}

nav[role="navigation"] {
  max-width: 100%;
}

nav[role="navigation"] a,
nav[role="navigation"] span[aria-current="page"] > span,
nav[role="navigation"] span[aria-disabled="true"] > span {
  min-width: 36px !important;
  min-height: 36px !important;
}

.empty-state,
.empty-state-full,
.empty-inline {
  border-radius: 12px;
  color: #7b8490 !important;
}

@media (max-width: 1100px) {
  body:has(.app-layout) .content-wrapper {
    padding: 22px;
  }

  .data-table {
    min-width: 900px;
  }
}

@media (max-width: 768px) {
  body:has(.app-layout) .sidebar {
    position: fixed;
    height: 100dvh;
  }

  body:has(.app-layout) .content-wrapper {
    padding: 16px;
  }

  body:has(.app-layout) .top-header h1 {
    display: block;
    min-width: 0;
  }

  body:has(.app-layout) .top-header h1 small {
    display: block;
    max-width: 72vw;
    margin-top: 2px;
  }

  .dashboard-hero,
  .usage-hero,
  .plans-hero,
  .admin-hero {
    padding: 18px !important;
  }

  .page-header-left,
  .page-header-right,
  .search-input {
    width: 100% !important;
  }

  .page-header-right > .btn-primary,
  .page-header-right > .btn-ghost {
    width: 100%;
  }

  .filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .filter-form > select,
  .filter-form > input,
  .filter-form > button,
  .filter-form > a {
    width: 100%;
    min-width: 0;
  }

  .form-card {
    padding: 18px !important;
  }

  .form-actions,
  .readonly-field,
  .api-key-display {
    align-items: stretch;
    flex-direction: column;
  }

  .cell-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .filter-form {
    grid-template-columns: 1fr;
  }

  .btn-sm {
    min-height: 34px;
  }
}
