/* ============================================================
   IPTV Platform — Admin Panel Styles
   Warm light theme with amber/gold accents
   ============================================================ */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #E8951C;
  --primary-light: #F5A623;
  --primary-dark: #C97B14;
  --accent: #7B61FF;
  --accent-light: #9B87FF;
  --bg: #FDF6EE;
  --bg-card: #FFFFFF;
  --bg-inner: #FFF5EB;
  --bg-hover: #FFF0E0;
  --border: #F0E6D6;
  --border-light: #E8DFD0;
  --text: #1A1A2E;
  --text-muted: #6B7280;
  --text-dim: #9CA3AF;
  --success: #10B981;
  --success-bg: rgba(16,185,129,0.10);
  --danger: #EF4444;
  --danger-bg: rgba(239,68,68,0.08);
  --warning: #F59E0B;
  --warning-bg: rgba(245,158,11,0.10);
  --info: #3B82F6;
  --info-bg: rgba(59,130,246,0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --sidebar-width: 260px;
  --header-height: 62px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Login Page ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(232,149,28,0.10) 0%, transparent 60%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

.login-logo h1 span { color: var(--primary); }

.login-logo p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,149,28,0.12);
}

.form-control::placeholder { color: var(--text-dim); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(232,149,28,0.25);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(232,149,28,0.35); color: #fff; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-dark); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #DC2626; color: #fff; }

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Admin Layout ──────────────────────────────────────────── */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-logo {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

.sidebar-logo h1 span { color: var(--primary); }

.sidebar-logo .sidebar-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 12px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--bg-inner);
  color: var(--text);
}

.sidebar-link.active {
  background: rgba(232,149,28,0.10);
  color: var(--primary-dark);
  font-weight: 600;
}

.sidebar-link .icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-link .icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.sidebar-link .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.main-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 0;
  z-index: 50;
}

.main-header-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.main-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-body {
  padding: 28px;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 90;
  }
  .sidebar-overlay.show { display: block; }
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-inner);
}

.card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.card-body { padding: 20px; }
.card-body-flush { padding: 0; }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-inner);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ── Badges / Status ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-muted   { background: rgba(107,96,128,0.10); color: var(--text-dim); }
.badge-primary { background: rgba(232,149,28,0.12); color: var(--primary-dark); }

/* ── Alerts / Flash ────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success { background: var(--success-bg); color: #047857; border: 1px solid rgba(16,185,129,0.2); }
.alert-danger  { background: var(--danger-bg);  color: #B91C1C; border: 1px solid rgba(239,68,68,0.2); }
.alert-warning { background: var(--warning-bg); color: #92400E; border: 1px solid rgba(245,158,11,0.2); }
.alert-info    { background: var(--info-bg);    color: #1D4ED8; border: 1px solid rgba(59,130,246,0.2); }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); }

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 22px; }

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Toast ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
  max-width: 380px;
}

.toast.show { transform: translateX(0); }
.toast-success { background: var(--success); color: #fff; }
.toast-error   { background: var(--danger);  color: #fff; }

/* ── Utilities ─────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-sm    { font-size: 0.82rem; }
.text-xs    { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-1 { flex: 1; }

.w-full { width: 100%; }

.hidden { display: none !important; }

/* Two-column grid for form fields */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
}

.pagination a, .pagination span {
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.pagination .active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-dim);
}

.empty-state .icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state h3 { color: var(--text-muted); margin-bottom: 6px; }
.empty-state p { font-size: 0.88rem; margin-bottom: 20px; }

/* ── Stat Cards ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card .stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-card .stat-info { flex: 1; min-width: 0; }

.stat-card .label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card .value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 4px;
}

.stat-card .sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Stat card color variants */
.stat-icon--amber   { background: rgba(232,149,28,0.12); color: var(--primary); }
.stat-icon--green   { background: var(--success-bg); color: var(--success); }
.stat-icon--blue    { background: var(--info-bg); color: var(--info); }
.stat-icon--red     { background: var(--danger-bg); color: var(--danger); }
.stat-icon--purple  { background: rgba(123,97,255,0.10); color: var(--accent); }
.stat-icon--warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon--danger  { background: var(--danger-bg); color: var(--danger); }

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font);
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

/* ── Detail Grid ──────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-table {
  display: flex;
  flex-direction: column;
}

.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  width: 160px;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.detail-value {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text);
}

/* ── Search Bar ────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.search-bar .form-control { max-width: 320px; }

/* ── Action Row ────────────────────────────────────────────── */
.actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

/* ── Chart Layout ─────────────────────────────────────────── */
.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 0;
}

@media (max-width: 1024px) {
  .chart-row { grid-template-columns: 1fr; }
}

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

/* Highlighted stat card */
.stat-card-highlight {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(232,149,28,0.06) 0%, var(--bg-card) 100%);
}

.stat-card-highlight .value { color: var(--primary-dark); }

.stat-card-alert { border-color: var(--danger); background: linear-gradient(135deg, rgba(239,68,68,0.04) 0%, var(--bg-card) 100%); }
.card-alert-border { border-color: var(--danger); }

.kpi-change { font-size: 0.78rem; font-weight: 700; }
.kpi-up   { color: var(--success); }
.kpi-down { color: var(--danger); }

.dash-alert-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

@media (max-width: 1280px) {
  .stats-grid[style*="repeat(5"] { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 768px) {
  .stats-grid[style*="repeat(5"] { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── Focus Visible ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Loading Spinner (for AJAX) ───────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(232,149,28,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}
.btn.loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* ── Order Timeline ───────────────────────────────────────── */
.timeline {
  position: relative;
  padding: 0;
  list-style: none;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding: 0 0 24px 48px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: 8px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 2px solid var(--border);
  z-index: 1;
}
.timeline-dot svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.5;
}
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: box-shadow 0.2s;
}
.timeline-card:hover {
  box-shadow: var(--shadow-sm);
}
.timeline-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.timeline-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.timeline-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.timeline-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}
.timeline-meta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: monospace;
  word-break: break-all;
}
.timeline-meta-row {
  display: flex;
  gap: 6px;
  margin-bottom: 2px;
}
.timeline-meta-label {
  color: var(--text-muted);
  font-weight: 600;
  min-width: 70px;
  font-family: var(--font);
}
.timeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  background: var(--bg-inner);
  color: var(--text-muted);
}
.timeline-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ── Analytics Dashboard ──────────────────────────────────── */
.analytics-section {
  margin-top: 28px;
}
.analytics-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.analytics-section-title svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* Date range bar */
.analytics-range-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.range-presets {
  display: flex;
  gap: 6px;
}
.range-btn {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-inner);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.15s;
}
.range-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}
.range-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: var(--primary);
}
.range-custom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.range-custom .form-control-sm {
  padding: 6px 10px;
  font-size: 0.84rem;
  width: 140px;
}
.range-sep {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Metric row for refunds/disputes */
.analytics-metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: center;
}
.analytics-metric-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.analytics-metric-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.analytics-metric-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

.text-danger { color: var(--danger); }

@media (max-width: 600px) {
  .analytics-range-bar { flex-direction: column; align-items: stretch; }
  .range-custom { flex-wrap: wrap; }
  .range-custom .form-control-sm { width: 100%; }
  .analytics-metric-row { grid-template-columns: 1fr; }
}

/* ── Skip Navigation (Accessibility) ─────────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

