/* ═══════════════════════════════════════════════
   KAIROS — Account Dashboard Styles
═══════════════════════════════════════════════ */

.account-page {
  display: flex;
  min-height: 100vh;
  background: var(--obsidian);
}

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--obsidian-2);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: var(--sp-6) 0;
  overflow-y: auto;
}

.sidebar__header {
  padding: 0 var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
}

.sidebar__nav {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  flex: 1;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--white-50);
  transition: all var(--t-base) var(--ease);
  cursor: pointer;
}

.sidebar__link:hover {
  background: var(--white-04);
  color: var(--white-90);
}

.sidebar__link--active {
  background: var(--amber-glow);
  color: var(--amber-bright);
  border: 1px solid var(--border-amber);
}

.sidebar__link--active svg { color: var(--amber); }

.sidebar__footer {
  padding: var(--sp-5);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  min-width: 0;
}

.sidebar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--amber-glow);
  border: 1px solid var(--border-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--amber-bright);
  flex-shrink: 0;
}

.sidebar__user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar__user-info span:first-child {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__email {
  font-size: var(--text-xs) !important;
  color: var(--white-40, rgba(255,255,255,0.4)) !important;
  font-weight: 400 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__signout {
  color: var(--white-30);
  cursor: pointer;
  transition: color var(--t-fast);
  padding: var(--sp-2);
  border-radius: var(--r-sm);
}

.sidebar__signout:hover { color: var(--error); }

/* ── MAIN CONTENT ────────────────────────────── */
.account-main {
  flex: 1;
  min-width: 0;
  padding: var(--sp-8) var(--sp-10);
  overflow-y: auto;
  max-height: 100vh;
}

.account-section {
  max-width: 1000px;
}

.account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
  gap: var(--sp-4);
}

.account-header h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-1);
}

.account-header p {
  font-size: var(--text-sm);
  color: var(--white-40, rgba(255,255,255,0.4));
  margin: 0;
}

/* ── STATS GRID ──────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.stat-card--primary {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(201,151,58,0.08) 0%, var(--surface) 100%);
  border-color: var(--border-amber);
}

.stat-card__icon {
  width: 40px;
  height: 40px;
  background: var(--obsidian-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber-bright);
  margin-bottom: var(--sp-2);
}

.stat-card__label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white-40, rgba(255,255,255,0.4));
  margin: 0;
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--white);
  margin: 0;
  line-height: 1.1;
}

.stat-card__sub {
  font-size: var(--text-xs);
  color: var(--white-30);
  margin: 0;
}

/* ── SECTION CARD ────────────────────────────── */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-card);
}

.section-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}

.section-card__header h2 {
  font-size: var(--text-lg);
  font-family: var(--font-body);
  font-weight: 600;
}

.section-card--danger {
  border-color: rgba(248,113,113,0.25);
  background: rgba(248,113,113,0.04);
}

/* ── GENRE BARS ──────────────────────────────── */
.genre-bars {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.genre-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.genre-bar__label {
  width: 80px;
  font-size: var(--text-sm);
  color: var(--white-70);
  flex-shrink: 0;
}

.genre-bar__track {
  flex: 1;
  height: 6px;
  background: var(--obsidian-5);
  border-radius: 3px;
  overflow: hidden;
}

.genre-bar__fill {
  height: 100%;
  background: linear-gradient(to right, var(--amber-dim), var(--amber));
  border-radius: 3px;
  transition: width 0.8s var(--ease-spring);
}

.genre-bar__count {
  width: 28px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--amber-bright);
  text-align: right;
  flex-shrink: 0;
}

/* ── ACTIVITY TABLE ──────────────────────────── */
.activity-table {
  width: 100%;
  border-collapse: collapse;
}

.activity-table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white-30);
  border-bottom: 1px solid var(--border-subtle);
}

.activity-table td {
  padding: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--white-70);
  border-bottom: 1px solid var(--border-subtle);
}

.activity-table tr:last-child td { border-bottom: none; }

.activity-table tr:hover td {
  background: var(--white-04);
}

.activity-table__loading td {
  text-align: center;
  color: var(--white-30);
  padding: var(--sp-10);
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.status-badge--success {
  background: rgba(74,222,128,0.1);
  color: var(--success);
  border: 1px solid rgba(74,222,128,0.25);
}

.status-badge--pending {
  background: rgba(251,191,36,0.1);
  color: var(--warning);
  border: 1px solid rgba(251,191,36,0.25);
}

.status-badge--failed {
  background: rgba(248,113,113,0.1);
  color: var(--error);
  border: 1px solid rgba(248,113,113,0.25);
}

/* ── RECHARGE ────────────────────────────────── */
.recharge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.recharge-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  cursor: pointer;
  position: relative;
  transition: all var(--t-base) var(--ease);
  box-shadow: var(--shadow-card);
}

.recharge-card:hover {
  border-color: var(--border-amber);
  transform: translateY(-2px);
}

.recharge-card--selected {
  border-color: var(--amber) !important;
  background: linear-gradient(135deg, rgba(201,151,58,0.1) 0%, var(--surface) 100%);
  box-shadow: 0 0 30px rgba(201,151,58,0.15);
}

.recharge-card--featured {
  border-color: rgba(201,151,58,0.4);
}

.recharge-card__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  background: var(--amber);
  color: var(--obsidian);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--r-full);
  white-space: nowrap;
}

.recharge-card h3 {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--sp-3);
}

.recharge-card__price {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: var(--sp-2);
}

.recharge-card__credits {
  font-size: var(--text-sm);
  color: var(--amber-bright);
  font-weight: 600;
}

.recharge-card__bonus {
  font-size: var(--text-xs);
  color: var(--success);
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

.recharge-card__corrections {
  font-size: var(--text-sm);
  color: var(--white-50);
  margin-bottom: var(--sp-2);
}

.recharge-card__per {
  font-size: var(--text-xs);
  color: var(--white-30);
}

/* Payment Summary */
.payment-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  max-width: 400px;
  box-shadow: var(--shadow-card);
}

.payment-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) 0;
  font-size: var(--text-sm);
  color: var(--white-60, rgba(255,255,255,0.6));
}

.payment-summary__row span:last-child {
  font-weight: 600;
  color: var(--white);
}

.payment-summary__row--total {
  font-size: var(--text-lg);
  color: var(--white);
  font-weight: 700;
}

.payment-summary__row--total span:last-child {
  color: var(--amber-bright);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
}

.payment-summary__divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-2) 0;
}

.payment-summary__note {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--white-30);
  margin: var(--sp-3) 0 0;
  text-align: center;
  justify-content: center;
}

/* Credit badge */
.credit-badge {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: var(--amber-glow);
  border: 1px solid var(--border-amber);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--amber-bright);
}

/* ── SETTINGS ────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  align-items: start;
}

.field-hint {
  font-size: var(--text-xs);
  color: var(--white-30);
  margin-top: var(--sp-1);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

/* ── DANGER BUTTON ───────────────────────────── */
.btn--danger {
  background: rgba(248,113,113,0.1);
  color: var(--error);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--r-full);
  padding: 0 var(--sp-5);
  height: 40px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-base);
  margin-top: var(--sp-4);
  font-family: var(--font-body);
}

.btn--danger:hover {
  background: rgba(248,113,113,0.2);
  border-color: rgba(248,113,113,0.6);
}

/* ── TOAST ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 1000;
  padding: var(--sp-4) var(--sp-6);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  font-size: var(--text-sm);
  color: var(--white);
  box-shadow: var(--shadow-lift);
  animation: fadeInUp 0.3s var(--ease-out);
  max-width: 300px;
}

/* ── HISTORY FILTERS ─────────────────────────── */
.history-filters {
  display: flex;
  gap: var(--sp-3);
}

.history-filters select {
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--white);
  cursor: pointer;
  font-family: var(--font-body);
}

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card--primary { grid-column: span 2; }
  .recharge-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .account-main { padding: var(--sp-5); }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card--primary { grid-column: span 1; }
  .recharge-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .recharge-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}
