/* ==========================================================
 * NEXUS ADMIN — UI COMPONENTS
 * ========================================================== */

/* ══════════════════════════════════
   PAGE LAYOUT HELPERS
   ══════════════════════════════════ */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 1rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.grid-2-1 { display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem; }
.grid-3   { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.25rem; }

/* ══════════════════════════════════
   CARDS
   ══════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base), transform var(--t-base);
  position: relative; overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.card-title    { font-size: .9375rem; font-weight: 700; color: var(--text); margin: 0; }
.card-subtitle { font-size: .8rem; color: var(--text-3); margin-top: 3px; }

/* Stat cards */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  transition: box-shadow .2s, transform .2s cubic-bezier(.22,1,.36,1);
  animation: fadeUp .4s cubic-bezier(.22,1,.36,1) both;
}
.stats-grid .stat-card:nth-child(1) { animation-delay: .04s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: .09s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: .14s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: .19s; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Accent bottom line on hover */
.stat-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), #8B7CF6, var(--teal));
  opacity: 0; transition: opacity .25s;
}
.stat-card:hover::after { opacity: 1; }

.stat-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.stat-label { font-size: .8rem; font-weight: 500; color: var(--text-3); }
.stat-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.accent { background: var(--accent-light); color: var(--accent); }
.stat-icon.teal   { background: var(--teal-light);   color: var(--teal); }
.stat-icon.rose   { background: var(--rose-light);   color: var(--rose); }
.stat-icon.amber  { background: var(--amber-light);  color: var(--amber); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }

.stat-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; color: var(--text); line-height: 1.1; margin-bottom: 6px; }
.stat-value span { font-size: 1rem; font-weight: 600; color: var(--text-3); letter-spacing: 0; }

.stat-change {
  display: flex; align-items: center; gap: 5px;
  font-size: .8rem; font-weight: 600;
}
.stat-change svg { width: 13px; height: 13px; }
.stat-change.positive, .stat-change.up { color: var(--teal); }
.stat-change.negative, .stat-change.down { color: var(--rose); }
.stat-change .period { font-weight: 400; color: var(--text-4); margin-left: 2px; }

/* Sparkline inside stat card */
.sparkline-canvas { display: block; width: 100% !important; height: 48px !important; margin-top: 10px; }
.sparkline-wrap   { height: 48px; margin-top: 10px; }
.sparkline-wrap canvas { width: 100% !important; height: 48px !important; }

/* ══════════════════════════════════
   BUTTONS
   ══════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: var(--r-md);
  font-size: .875rem; font-weight: 600; cursor: pointer;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  border: 1.5px solid transparent; position: relative; overflow: hidden;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn .icon  { width: 15px; height: 15px; }

.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(91,110,245,.25);
}
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 4px 14px rgba(91,110,245,.38); }

.btn-outline {
  background: transparent; color: var(--text-2); border-color: var(--border-2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.btn-ghost {
  background: transparent; color: var(--text-2); border-color: transparent;
}
.btn-ghost:hover { background: var(--hover); color: var(--text); }

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

.btn-sm  { height: 32px; padding: 0 12px; font-size: .8125rem; }
.btn-lg  { height: 44px; padding: 0 22px; font-size: .9375rem; }

/* Icon-only button */
.btn-icon {
  width: 34px; height: 34px; padding: 0; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); border: none; background: transparent;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-base);
  cursor: pointer;
}
.btn-icon:hover { background: var(--hover); color: var(--text); transform: scale(1.08); }
.btn-icon svg { width: 15px; height: 15px; }
.btn-icon.btn-sm { width: 28px; height: 28px; }

/* Ripple */
.btn-ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.22);
  transform: scale(0);
  animation: rippleAnim .5s linear;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

/* ══════════════════════════════════
   BADGES
   ══════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: .72rem; font-weight: 700; white-space: nowrap;
  letter-spacing: .02em;
}
.badge-success  { background: var(--teal-light);   color: var(--teal); }
.badge-danger   { background: var(--rose-light);   color: var(--rose); }
.badge-warning  { background: var(--amber-light);  color: var(--amber); }
.badge-accent   { background: var(--accent-light); color: var(--accent); }
.badge-info     { background: rgba(59,130,246,.10); color: #3B82F6; }
.badge-neutral  { background: var(--surface-3); color: var(--text-3); border: 1px solid var(--border); }
.badge-secondary{ background: var(--surface-3); color: var(--text-2); }

/* ══════════════════════════════════
   FORMS
   ══════════════════════════════════ */
.form-group  { margin-bottom: 18px; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-label  { display: block; font-size: .8125rem; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.form-actions{ display: flex; gap: 10px; margin-top: 20px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: inherit; font-size: .875rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  appearance: none; -webkit-appearance: none;
}
.form-input, .form-select { height: 40px; padding: 0 12px; }
.form-textarea { padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.5; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-4); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--surface);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px; cursor: pointer;
}

/* ══════════════════════════════════
   TABLES
   ══════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table thead th {
  padding: 10px 14px;
  font-size: .72rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface-2); text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table thead th:first-child { border-radius: var(--r-sm) 0 0 0; }
.table thead th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover {
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--accent);
}
.table tbody td {
  padding: 13px 14px;
  font-size: .875rem; color: var(--text-2);
  vertical-align: middle;
}

/* ── SEARCH + TOOLBAR ── */
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box    { position: relative; display: flex; align-items: center; }
.search-icon   { position: absolute; left: 10px; width: 14px; height: 14px; color: var(--text-4); pointer-events: none; flex-shrink: 0; }
.search-input  {
  width: 220px; height: 36px;
  padding: 0 10px 0 32px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: .84rem; color: var(--text);
  font-family: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-input::placeholder { color: var(--text-4); }
.search-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--surface);
}

/* ── ACTION GROUP ── */
.action-group { display: flex; align-items: center; gap: 4px; }

/* ── AVATAR ── */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  font-size: .7rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: .02em;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.avatar:hover { transform: scale(1.08); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ── CUSTOMER / PRODUCT INFO ── */
.customer-info, .product-info { display: flex; align-items: center; gap: 10px; }
.product-icon {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.product-icon svg { width: 16px; height: 16px; }

/* ══════════════════════════════════
   MODALS
   ══════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex; align-items: flex-start; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base) var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-xl);
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  transform: scale(.94) translateY(16px);
  transition: transform var(--t-slow) var(--ease-spring);
}
.modal-overlay.open .modal { transform: none; }
.modal-title  { font-size: 1.0625rem; font-weight: 700; color: var(--text); margin: 0; letter-spacing: -.01em; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0; gap: 12px;
}
.modal-close {
  width: 30px; height: 30px; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.modal-close:hover { background: var(--hover); color: var(--text); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body   { padding: 20px 24px; }
.modal-footer { padding: 0 24px 20px; display: flex; gap: 8px; justify-content: flex-end; }

/* ══════════════════════════════════
   TABS
   ══════════════════════════════════ */
.tabs {
  display: flex; gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 4px;
  width: fit-content; max-width: 100%; flex-wrap: wrap;
}
.tab-btn {
  padding: 6px 14px; border-radius: var(--r-sm);
  font-size: .8125rem; font-weight: 500; color: var(--text-3);
  cursor: pointer; transition: all var(--t-fast); white-space: nowrap;
}
.tab-btn:hover  { color: var(--text); background: var(--hover); }
.tab-btn.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-xs); }

.tab-group { display: flex; gap: 3px; background: var(--surface-2); border-radius: var(--r-md); padding: 4px; }
.tab-group .tab-btn { padding: 5px 12px; }

/* ══════════════════════════════════
   PROGRESS BARS
   ══════════════════════════════════ */
.progress-bar-wrap {
  height: 6px; background: var(--surface-3);
  border-radius: var(--r-full); overflow: hidden; flex: 1;
}
.progress-fill {
  height: 100%; width: 0%; border-radius: var(--r-full);
  background: var(--accent);
  transition: width 1s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.progress-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  animation: shimmerProgress 2.2s ease-in-out infinite;
}
@keyframes shimmerProgress { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }
.progress-fill.teal   { background: var(--teal); }
.progress-fill.rose   { background: var(--rose); }
.progress-fill.amber  { background: var(--amber); }
.progress-fill.purple { background: var(--purple); }

/* ══════════════════════════════════
   PAGINATION
   ══════════════════════════════════ */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 16px; flex-wrap: wrap; }
.page-btn {
  min-width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); font-size: .8125rem; font-weight: 500;
  color: var(--text-3); cursor: pointer; border: 1px solid transparent;
  transition: all var(--t-fast); padding: 0 6px;
}
.page-btn:hover  { background: var(--hover); color: var(--text); border-color: var(--border); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: var(--shadow-accent); }
.page-btn:disabled { opacity: .4; cursor: default; pointer-events: none; }

/* ══════════════════════════════════
   TOAST
   ══════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: var(--z-toast); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 380px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: .875rem; color: var(--text-2);
  pointer-events: all; cursor: pointer;
  opacity: 0; transform: translateX(32px);
  transition: opacity .3s var(--ease), transform .3s cubic-bezier(.22,1,.36,1);
}
.toast.visible { opacity: 1; transform: none; }
.toast-close { margin-left: auto; color: var(--text-4); flex-shrink: 0; }
.toast svg:first-child { flex-shrink: 0; width: 16px; height: 16px; }
.toast-success svg:first-child { color: var(--teal); }
.toast-error   svg:first-child { color: var(--rose); }
.toast-info    svg:first-child { color: var(--accent); }
.toast-warning svg:first-child { color: var(--amber); }
.toast-success { border-left: 3px solid var(--teal); }
.toast-error   { border-left: 3px solid var(--rose); }
.toast-info    { border-left: 3px solid var(--accent); }
.toast-warning { border-left: 3px solid var(--amber); }

/* ══════════════════════════════════
   CHART WRAPPER
   ══════════════════════════════════ */
.chart-wrap { position: relative; min-width: 0; }

/* ══════════════════════════════════
   KPI MINI (small stat bar)
   ══════════════════════════════════ */
.kpi-row  { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 12px; margin-bottom: 20px; }
.kpi-mini { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; }
.kpi-mini .label  { font-size: .75rem; color: var(--text-3); font-weight: 500; margin-bottom: 5px; }
.kpi-mini .value  { font-size: 1.35rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.kpi-mini .change { font-size: .75rem; font-weight: 600; margin-top: 3px; color: var(--text-3); }
.kpi-mini .change.up   { color: var(--teal); }
.kpi-mini .change.down { color: var(--rose); }

/* ══════════════════════════════════
   ACTIVITY FEED
   ══════════════════════════════════ */
.activity-item {
  display: flex; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.activity-icon svg { width: 15px; height: 15px; }
.activity-content { flex: 1; min-width: 0; }
.activity-content p { font-size: .84rem; color: var(--text-2); line-height: 1.4; }
.activity-content p strong { color: var(--text); font-weight: 600; }
.activity-content time { font-size: .75rem; color: var(--text-4); margin-top: 2px; display: block; }

/* ══════════════════════════════════
   SETTINGS LAYOUT
   ══════════════════════════════════ */
.settings-layout { display: grid; grid-template-columns: 210px 1fr; gap: 1.5rem; align-items: start; }
.settings-tabs {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 8px; position: sticky; top: 76px;
  display: flex; flex-direction: column; gap: 2px;
}
.settings-tab {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: .84rem; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all var(--t-fast); text-align: left;
  background: none; border: none; width: 100%;
}
.settings-tab .icon { width: 16px; height: 16px; flex-shrink: 0; }
.settings-tab:hover { background: var(--hover); color: var(--text); }
.settings-tab.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.settings-panel  { display: none; }
.settings-panel.active { display: block; }

/* Profile avatar */
.profile-avatar-row { display: flex; align-items: center; gap: 1.25rem; padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.profile-avatar-large {
  width: 68px; height: 68px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #8B7CF6);
  color: #fff; font-size: 1.4rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Toggle switch */
.toggle-switch { position: relative; display: inline-flex; width: 42px; height: 24px; cursor: pointer; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-thumb {
  position: absolute; inset: 0;
  background: var(--border-2); border-radius: var(--r-full);
  transition: background .2s;
}
.toggle-thumb::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.toggle-switch input:checked + .toggle-thumb { background: var(--accent); }
.toggle-switch input:checked + .toggle-thumb::after { transform: translateX(18px); }

/* Toggle list */
.toggle-list { display: flex; flex-direction: column; }
.toggle-row  { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 15px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row p { margin: 0; font-size: .875rem; font-weight: 600; color: var(--text); }
.toggle-row small { font-size: .8rem; color: var(--text-3); }

/* Session list */
.session-list { display: flex; flex-direction: column; }
.session-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.session-item:last-child { border-bottom: none; }
.session-icon { width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-2); }
.session-icon svg { width: 17px; height: 17px; }
.session-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.session-info p     { font-size: .875rem; font-weight: 600; color: var(--text); margin: 0; }
.session-info small { font-size: .78rem; color: var(--text-3); }

/* Plan card */
.plan-card {
  background: linear-gradient(135deg, var(--accent) 0%, #8B7CF6 100%);
  border-radius: var(--r-lg); padding: 24px; color: #fff;
  position: relative; overflow: hidden;
}
.plan-card::before {
  content: ''; position: absolute; top: -50px; right: -50px;
  width: 160px; height: 160px; background: rgba(255,255,255,.08); border-radius: 50%;
}
.plan-badge   { display: inline-block; padding: 3px 10px; background: rgba(255,255,255,.18); border-radius: var(--r-full); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.plan-header  { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.plan-name    { font-size: 1.25rem; font-weight: 800; margin: 0 0 4px; }
.plan-price   { font-size: 2.25rem; font-weight: 800; letter-spacing: -.03em; margin: 10px 0 4px; }
.plan-price span { font-size: .9rem; font-weight: 400; opacity: .7; }
.plan-features{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.plan-feature { display: flex; align-items: center; gap: 8px; font-size: .84rem; opacity: .9; }
.plan-feature svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Payment method */
.payment-method { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.card-icon { width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-icon svg { width: 19px; height: 19px; color: var(--text-2); }

/* ══════════════════════════════════
   LEGEND & DONUT HELPERS
   ══════════════════════════════════ */
.donut-legend    { display: flex; flex-direction: column; gap: 8px; }
.legend-item     { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--text-2); }
.legend-dot      { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.legend-inline   { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-3); }

/* ══════════════════════════════════
   BREAKDOWN ROW
   ══════════════════════════════════ */
.breakdown-row   { display: flex; align-items: center; gap: 10px; }
.breakdown-label { display: flex; align-items: center; gap: 8px; min-width: 110px; font-size: .84rem; color: var(--text-2); }
.breakdown-val   { font-size: .84rem; font-weight: 600; color: var(--text); min-width: 44px; text-align: right; }

/* ══════════════════════════════════
   TABLE EXTRAS
   ══════════════════════════════════ */
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: .78rem; font-weight: 700; color: var(--text-3); }
.page-path  { font-family: 'DM Mono', monospace; font-size: .82rem; color: var(--accent); }

/* ══════════════════════════════════
   CARD ENTRANCE ANIMATIONS
   ══════════════════════════════════ */
[data-aos] {
  animation: fadeUp .45s cubic-bezier(.22,1,.36,1) both;
}
[data-aos]:nth-child(1) { animation-delay: .05s; }
[data-aos]:nth-child(2) { animation-delay: .10s; }
[data-aos]:nth-child(3) { animation-delay: .15s; }
[data-aos]:nth-child(4) { animation-delay: .20s; }
[data-aos]:nth-child(5) { animation-delay: .25s; }
[data-aos]:nth-child(6) { animation-delay: .30s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════
   BADGE ALIASES & MISSING CLASSES
   ══════════════════════════════════ */

/* Colour aliases — old names still used in page HTML */
.badge-teal  { background: var(--teal-light);  color: var(--teal); }
.badge-rose  { background: var(--rose-light);  color: var(--rose); }
.badge-amber { background: var(--amber-light); color: var(--amber); }

/* Status dot inside badge */
.badge-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 5px;
  flex-shrink: 0;
  vertical-align: middle;
  opacity: .85;
}

/* ══════════════════════════════════
   TOOLBAR (search + filter bar)
   ══════════════════════════════════ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-search {
  position: relative;
  display: flex;
  align-items: center;
}

.toolbar-search-icon {
  position: absolute;
  left: 10px;
  display: flex;
  align-items: center;
  color: var(--text-4);
  pointer-events: none;
}

.toolbar-search input,
.toolbar-search input[type="search"] {
  height: 36px;
  padding: 0 12px 0 32px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: .84rem;
  color: var(--text);
  font-family: inherit;
  width: 220px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.toolbar-search input::placeholder {
  color: var(--text-4);
}

.toolbar-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--surface);
}

/* Alias: form-control = form-select style */
.form-control {
  height: 36px;
  padding: 0 32px 0 12px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--r-md);
  font-size: .84rem;
  color: var(--text);
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}