
/* ══════════════════════════════════════════════════════════════
   Admin panel — Mission Control aesthetic
   ══════════════════════════════════════════════════════════════ */

/* Sidebar override: active items use warning accent in admin */
.admin-shell .nav-item.active {
  background: var(--warning-15);
  color: var(--warning);
}
.admin-shell .nav-item.active::before { background: var(--warning); }
.admin-shell .nav-item.active svg     { color: var(--warning); }

/* Admin badge */
.admin-pill {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--warning-15);
  color: var(--warning) !important;   /* override .sidebar-logo span */
  border: 1px solid rgba(242,176,70,0.32);
  padding: 0.1rem 0.42rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.3rem;
  line-height: 1.5;
}

/* ── Admin hero metric ───────────────────────────────────────── */

.admin-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}
.admin-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 90% at 100% 50%, var(--success-15) 0%, transparent 65%);
  pointer-events: none;
}
.admin-hero-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
  z-index: 1;
}
.admin-hero-main {
  flex: 1;
  min-width: 0;
}
.admin-hero-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  opacity: 0.7;
}
.admin-hero-value {
  font-size: 2.6rem;
  font-weight: 800;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}
.admin-hero-value.positive { color: var(--success); }
.admin-hero-value.negative { color: var(--danger); }
.admin-hero-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}
.admin-hero-divider {
  width: 1px;
  height: 60px;
  background: var(--border);
  flex-shrink: 0;
}
.admin-hero-side {
  flex-shrink: 0;
  text-align: right;
}

/* ── Margin bar ──────────────────────────────────────────────── */

.margin-track {
  height: 5px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.75rem;
  max-width: 280px;
}
.margin-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16,1,0.3,1);
}
.margin-fill.green  { background: linear-gradient(90deg, var(--success) 0%, #48D8A0 100%); }
.margin-fill.red    { background: linear-gradient(90deg, var(--danger) 0%, #F07070 100%); }
.margin-fill.yellow { background: linear-gradient(90deg, var(--warning) 0%, #F5C862 100%); }

/* ── Admin quick nav ─────────────────────────────────────────── */

.admin-quick-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}
.admin-qnav-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.85rem 1.1rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
}
.admin-qnav-item:hover {
  color: var(--text);
  border-color: var(--warning);
  background: var(--warning-15);
  text-decoration: none;
  transform: translateY(-1px);
}
.admin-qnav-item svg { flex-shrink: 0; }
.admin-qnav-count {
  margin-left: auto;
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-muted);
}

/* ── Audit log action color coding ───────────────────────────── */

.audit-chip {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.audit-create  { background: var(--success-15); color: var(--success); }
.audit-delete  { background: var(--danger-15);  color: var(--danger); }
.audit-update  { background: var(--brand-10);   color: var(--brand); }
.audit-auth    { background: var(--warning-15); color: var(--warning); }
.audit-system  { background: var(--surface-2);  color: var(--text-muted); }

/* ── News cards ──────────────────────────────────────────────── */

.news-card-list { display: flex; flex-direction: column; gap: 0.55rem; }
.news-item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.news-item-card:hover { border-color: rgba(94,106,210,0.35); box-shadow: var(--shadow-xs); }
.news-item-body { flex: 1; min-width: 0; }
.news-item-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.news-item-summary {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.news-item-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.3rem;
}
.news-item-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* ── User mini avatar ────────────────────────────────────────── */

.user-mini-av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand-15);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-weight: 800;
  flex-shrink: 0;
  border: 1px solid var(--brand-25);
}
.user-mini-av.admin-av {
  background: var(--warning-15);
  color: var(--warning);
  border-color: rgba(242,176,70,0.3);
}

/* ── Admin filter bar ────────────────────────────────────────── */

.admin-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
}
.admin-filter-bar .form-input,
.admin-filter-bar .form-select {
  background: var(--surface-2);
}

/* ── Model price display ─────────────────────────────────────── */

.price-pair {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}
.price-in  { color: var(--brand); }
.price-sep { color: var(--border); }
.price-out { color: var(--success); }
.price-label { font-size: 0.70rem; color: var(--text-muted); display: block; margin-top: 0.1rem; }

/* ── Account page ────────────────────────────────────────────── */

.acct-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.acct-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 100% at -5% 50%, var(--brand-10) 0%, transparent 65%);
  pointer-events: none;
}
.acct-avatar-lg {
  width: 70px; height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, #8B7EF0 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 4px 22px rgba(94,106,210,0.38), 0 0 0 3px var(--brand-15);
  position: relative;
  z-index: 1;
  user-select: none;
}
.acct-hero-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.acct-hero-name {
  font-size: 1.2rem;
  font-weight: 800;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.18rem;
}
.acct-hero-email {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}
.acct-hero-meta { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; }
.acct-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
}
.acct-meta-pill.neutral { background: var(--surface-2); color: var(--text-muted); }
.acct-meta-pill.admin   { background: var(--brand-10);  color: var(--brand);       border-color: var(--brand-25); }
.acct-meta-pill.member  { background: var(--success-15); color: var(--success);    border-color: rgba(38,194,129,0.25); }
.acct-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* ── Theme segmented picker ──────────────────────────────────── */

.theme-picker {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.theme-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: "IBM Plex Sans", sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.theme-opt:hover { background: var(--border); color: var(--text); }
.theme-opt.is-active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.theme-swatch {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.theme-swatch-dark   { background: #18181f; border: 1.5px solid #3a3a50; }
.theme-swatch-light  { background: #f0f4f8; border: 1.5px solid #c8d0da; }
.theme-swatch-system {
  background: linear-gradient(135deg, #18181f 50%, #f0f4f8 50%);
  border: 1.5px solid #888;
}

/* ── Account section divider ────────────────────────────────── */

.acct-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  opacity: 0.65;
  margin: 0 0 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.acct-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Account stat strip ──────────────────────────────────────── */

.acct-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.acct-stat {
  padding: 1rem 1.25rem;
  border-right: 1px solid var(--border);
  position: relative;
}
.acct-stat::before {
  content: ''; position: absolute; top: 0; left: 0; width: 2px; height: 100%;
  background: var(--brand); opacity: 0; transition: opacity .2s;
}
.acct-stat:hover::before { opacity: .6; }
.acct-stat:last-child { border-right: none; }
.acct-stat-k {
  font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); opacity: 0.65; margin-bottom: 0.4rem;
}
.acct-stat-v {
  font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text);
}
.acct-stat-sub {
  font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem;
}
@media (max-width: 680px) {
  .acct-stat-strip { grid-template-columns: 1fr 1fr; }
  .acct-stat:nth-child(2) { border-right: none; }
  .acct-stat:nth-child(1), .acct-stat:nth-child(2) { border-bottom: 1px solid var(--border); }
}

/* ── Account layout: nav rail + sectioned content ────────────── */

.acct-layout {
  display: grid;
  grid-template-columns: 172px 1fr;
  gap: 2rem;
  align-items: start;
}
.acct-nav {
  position: sticky;
  top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.acct-nav a {
  position: relative;
  padding: 0.5rem 0 0.5rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid var(--border);
  transition: color .15s, border-color .15s;
}
.acct-nav a:hover { color: var(--text); }
.acct-nav a.is-active { color: var(--brand); border-left-color: var(--brand); }
.acct-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-width: 0;
}
.acct-content section { scroll-margin-top: 1.25rem; }

@media (max-width: 900px) {
  .acct-layout { grid-template-columns: 1fr; gap: 0; }
  .acct-nav {
    position: sticky; top: 0; z-index: 5;
    flex-direction: row; overflow-x: auto; gap: 1.1rem;
    background: var(--bg); padding: 0.6rem 0 0.85rem;
    border-bottom: 1px solid var(--border); margin-bottom: 1.25rem;
  }
  .acct-nav a {
    border-left: none; border-bottom: 2px solid transparent;
    padding: 0.2rem 0.05rem 0.5rem; white-space: nowrap; flex-shrink: 0;
  }
  .acct-nav a.is-active { border-left-color: transparent; border-bottom-color: var(--brand); }
}

/* ── Responsive additions ────────────────────────────────────── */

@media (max-width: 768px) {
  .amount-selector { grid-template-columns: repeat(2, 1fr); }
  .qs-track { flex-wrap: wrap; gap: 1rem; }
  .qs-track::before { display: none; }
  .qs-step { flex-direction: row; align-items: center; gap: 0.75rem; text-align: left; }
  .qs-body { text-align: left; }
  .key-card { flex-wrap: wrap; }
  .model-row-name { width: 120px; }
  .model-row-cost { width: 55px; }
  .balance-widget-amount { font-size: 1.9rem; }
}
