/* Nepal AI Gateway - Refined Minimal Dashboard */
/* Design: Trust Infrastructure with Nepali-inspired palette */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============ Design Tokens ============ */
:root {
  /* Clean Operations Console - Light Mode */
  --bg: #f5f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #edf2f8;
  --border: #d9e1ec;
  --border-strong: #b9c6d6;

  --text-primary: #111827;
  --text-secondary: #526174;
  --text-tertiary: #8793a4;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: #e8f0ff;

  --terracotta: #e85d04;
  --terracotta-hover: #c2410c;
  --terracotta-subtle: #fff4e8;

  --success: #0f9f6e;
  --success-subtle: #dcfce7;
  --danger: #e11d48;
  --danger-hover: #be123c;
  --danger-subtle: #ffe4e8;
  --warning: #b7791f;
  --warning-subtle: #fff4d6;

  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 18px 48px rgba(17, 24, 39, 0.12);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  /* Graphite Console - Dark Mode */
  --bg: #111722;
  --bg-elevated: #171f2c;
  --surface: #202a39;
  --surface-hover: #2a3648;
  --border: #374356;
  --border-strong: #526176;

  --text-primary: #f7fafc;
  --text-secondary: #c6d0dd;
  --text-tertiary: #8896aa;

  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-subtle: #17375e;

  --terracotta: #f59e0b;
  --terracotta-hover: #fbbf24;
  --terracotta-subtle: #443014;

  --success: #34d399;
  --success-subtle: #103d32;
  --danger: #f43f5e;
  --danger-hover: #fb7185;
  --danger-subtle: #471823;
  --warning: #fbbf24;
  --warning-subtle: #453514;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 22px 54px rgba(0, 0, 0, 0.32);
}

/* ============ Base ============ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, white) 0%, var(--bg) 280px),
    var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

/* ============ Typography ============ */
h1, h2 {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: 32px;
  line-height: 1.2;
  margin-bottom: 8px;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}

code, .mono {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 13px;
  letter-spacing: -0.01em;
}

/* ============ Header ============ */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

header > div:first-child {
  flex: 1;
  min-width: 280px;
}

h1 {
  display: flex;
  align-items: center;
  gap: 12px;
}

h1 .logo-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

header p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 4px;
  font-weight: 500;
}

/* ============ Toolbar ============ */
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ============ Buttons ============ */
button, input, select {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
}

button.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-md);
}

button.secondary {
  background: var(--surface);
  color: var(--text-primary);
}

button.danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

button.danger:hover:not(:disabled) {
  background: var(--danger-hover);
  box-shadow: var(--shadow-md);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  position: relative;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity var(--transition);
}

.sun-icon { opacity: 1; }
.moon-icon { opacity: 0; }

[data-theme="dark"] .sun-icon { opacity: 0; }
[data-theme="dark"] .moon-icon { opacity: 1; }

/* ============ Auto-Refresh Indicator ============ */
.refresh-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.refresh-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

.refresh-indicator.refreshing .dot {
  animation: spin 1s linear infinite;
  background: var(--accent);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============ Form Elements ============ */
input, select {
  min-height: 40px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

[data-theme="dark"] input,
[data-theme="dark"] select {
  background: #151d29;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

input::placeholder {
  color: var(--text-tertiary);
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.form-row input, .form-row select {
  flex: 1 1 180px;
  min-width: 160px;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.captcha-question {
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.captcha-row input[type="number"] {
  width: 70px;
  flex: 0 0 70px;
  min-width: 60px;
  text-align: center;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: border-color 0.15s, color 0.15s;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============ Cards ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  animation: fadeUp 400ms ease-out backwards;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger card animations */
section:nth-child(1) .card { animation-delay: 0ms; }
section:nth-child(2) .card { animation-delay: 50ms; }
section:nth-child(3) .card { animation-delay: 100ms; }
section:nth-child(4) .card { animation-delay: 150ms; }
section:nth-child(5) .card { animation-delay: 200ms; }

/* ============ Stats Grid ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition);
  overflow: hidden;
  animation: fadeUp 400ms ease-out backwards;
}

/* Asymmetric accent borders - differentiation anchor */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--border);
  transition: background var(--transition);
}

.stat-card:nth-child(1)::before { background: var(--accent); }
.stat-card:nth-child(2)::before { background: var(--success); }
.stat-card:nth-child(3)::before { background: var(--terracotta); }
.stat-card:nth-child(4)::before { background: var(--warning); }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.stat-card .label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-card .value {
  color: var(--text-primary);
  font-size: 32px;
  font-weight: 800;
  font-family: 'Inter Tight', sans-serif;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-card .value.positive { color: var(--success); }
.stat-card .value.negative { color: var(--danger); }

/* Stagger stat card animations */
.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 50ms; }
.stat-card:nth-child(3) { animation-delay: 100ms; }
.stat-card:nth-child(4) { animation-delay: 150ms; }

/* ============ Section Headers ============ */
section {
  margin-top: 32px;
}

.admin-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 6px;
  padding: 10px;
  margin: 0 0 20px;
  overflow-x: auto;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.admin-nav a {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

.section-panel {
  scroll-margin-top: 84px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.panel-head h2 {
  margin: 0;
}

.compact-input,
.compact-select {
  width: auto;
  min-width: 150px;
  max-width: 240px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.detail-panel {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.detail-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.detail-panel-head p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
}

.key-list {
  display: grid;
  gap: 8px;
}

.key-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) minmax(140px, 1fr) minmax(100px, 0.7fr) minmax(120px, 0.8fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.key-row span {
  color: var(--text-secondary);
}

.reveal-box {
  margin-top: 12px;
  padding: 12px;
  color: var(--success);
  background: var(--success-subtle);
  border: 1px solid color-mix(in srgb, var(--success) 32%, transparent);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
  font-weight: 700;
}

/* ============ Tables ============ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.analytics-tables {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) minmax(360px, 1.6fr);
  gap: 16px;
  margin-top: 16px;
}

.analytics-tables .wide {
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-secondary);
  font-weight: 600;
  background: var(--surface-hover);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background-color var(--transition);
}

tbody tr:hover {
  background: var(--surface-hover);
}

code {
  background: var(--surface-hover);
  padding: 3px 8px;
  border-radius: 4px;
  word-break: break-all;
  border: 1px solid var(--border);
}

/* ============ Status Indicators ============ */
.status {
  min-height: 24px;
  margin: 12px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.status.error {
  color: var(--danger);
  background: var(--danger-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--danger);
}

.status.success {
  color: var(--success);
  background: var(--success-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--success);
}

.status.warning {
  color: var(--warning);
  background: var(--warning-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
}

.ok { color: var(--success); font-weight: 600; }
.bad { color: var(--danger); font-weight: 600; }
.warn { color: var(--warning); font-weight: 600; }

/* Health badges */
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.health-badge.healthy {
  background: var(--success-subtle);
  color: var(--success);
}

.health-badge.degraded {
  background: var(--warning-subtle);
  color: var(--warning);
}

.health-badge.unhealthy {
  background: var(--danger-subtle);
  color: var(--danger);
}

/* ============ Actions ============ */
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.actions button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.inline-plan-select,
.inline-expiry-input {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.inline-plan-select {
  width: 132px;
}

.inline-expiry-input {
  width: 178px;
}

/* ============ Loading States ============ */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============ Toast Notifications ============ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1001;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 320px;
  max-width: 420px;
}

.toast.error { border-left: 4px solid var(--danger); }
.toast.success { border-left: 4px solid var(--success); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--accent); }

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition);
}

.toast-close:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.hiding {
  animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOut {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ============ Error States ============ */
.error-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--danger-subtle);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  color: var(--danger);
  margin: 16px 0;
}

.error-banner svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.error-banner strong {
  font-weight: 600;
}

.error-banner button {
  margin-left: auto;
  min-height: auto;
  padding: 6px 12px;
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
}

.empty-state svg {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  margin: 0;
  font-size: 15px;
}

/* ============ Utility Classes ============ */
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
  main {
    padding: 24px 16px 48px;
  }

  header {
    display: block;
  }

  .toolbar {
    justify-content: flex-start;
    margin-top: 16px;
  }

  .admin-nav {
    top: 0;
    margin-inline: -4px;
  }

  h1 {
    font-size: 26px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card .value {
    font-size: 28px;
  }

  th, td {
    white-space: nowrap;
    padding: 12px 14px;
  }

  .analytics-tables {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row input, .form-row select {
    width: 100%;
    flex: 0 0 auto;
    min-height: 44px;
  }

  .compact-input,
  .compact-select {
    width: 100%;
    max-width: none;
  }

  .pager {
    justify-content: space-between;
  }

  .key-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  main {
    padding: 20px 12px 40px;
  }

  h1 {
    font-size: 22px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .stat-card .value {
    font-size: 24px;
  }

  .toast {
    min-width: 280px;
  }
}

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: modalFadeIn 0.15s ease-out;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  width: 90%;
  max-width: 480px;
  animation: modalSlideUp 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============ Expiry & Plan Badges ============ */
.expiry-countdown {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  background: var(--accent-subtle);
  color: var(--accent);
}

.plan-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.plan-badge.free { background: var(--surface-hover); color: var(--text-secondary); }
.plan-badge.free_verified { background: var(--success-subtle); color: var(--success); }
.plan-badge.pro, .plan-badge.high { background: var(--accent-subtle); color: var(--accent); }
.plan-badge.max { background: var(--warning-subtle); color: var(--warning); }

/* ============ Skeleton Loading ============ */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--surface) 50%, var(--surface-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

.skeleton-text {
  height: 14px;
  width: 80%;
  margin: 4px 0;
}

.skeleton-value {
  height: 32px;
  width: 60%;
}

.skeleton-row td {
  position: relative;
  overflow: hidden;
}

.skeleton-row td::after {
  content: '';
  position: absolute;
  inset: 8px;
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--surface) 50%, var(--surface-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* ============ GPU-Accelerated Transitions ============ */
.stat-card,
.toast,
.modal-overlay,
.modal-content,
.admin-nav a,
.health-badge,
.plan-badge,
.expiry-countdown {
  will-change: transform, opacity;
}

.stat-card {
  transform: translateZ(0);
}

tbody tr {
  transition: background-color 120ms ease;
  transform: translateZ(0);
}

.section-panel {
  animation: fadeInSection 0.2s ease-out;
  transform: translateZ(0);
}

@keyframes fadeInSection {
  from { opacity: 0; transform: translateY(8px) translateZ(0); }
  to { opacity: 1; transform: translateY(0) translateZ(0); }
}
