/* AshLab Platform — Design System
   Dark enterprise theme. No external frameworks.
   All pages import this file. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Custom properties ─────────────────────────────────────────────────────── */
:root {
  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99,102,241,0.15);
  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --info:         #3b82f6;

  --bg:           #0f172a;
  --surface:      #1e293b;
  --surface-2:    #263548;
  --border:       #334155;
  --border-light: #475569;

  --text:         #e2e8f0;
  --text-muted:   #94a3b8;
  --text-dim:     #64748b;

  /* Module colours */
  --observe:    #3b82f6;
  --gateway:    #10b981;
  --security:   #ef4444;
  --governance: #a855f7;
  --builder:    #f59e0b;

  --sidebar-w: 240px;
  --topbar-h:  56px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 4px 6px -1px rgba(0,0,0,0.4);
  --transition: 150ms ease;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text);
       min-height: 100vh; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
code, pre { font-family: 'JetBrains Mono', monospace; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); height: 100vh; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; z-index: 100; transition: transform var(--transition);
  overflow: hidden;
}
.sidebar-logo {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; min-height: var(--topbar-h);
  flex-shrink: 0;
}
.sidebar-logo-icon { width: 28px; height: 28px; background: var(--primary);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white; flex-shrink: 0; }
.sidebar-logo-text { font-size: 15px; font-weight: 700; color: var(--text); }
.sidebar-logo-sub  { font-size: 10px; color: var(--text-muted); }

.sidebar-nav {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  min-height: 0; padding: 8px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1); border-radius: 3px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
.nav-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); padding: 12px 20px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 20px;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  transition: all var(--transition); position: relative; border: none;
  background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { color: var(--text); background: var(--primary-glow); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; border-radius: 0 2px 2px 0;
}
.nav-item[data-module="start"].active::before      { background: var(--primary); }
.nav-item[data-module="observe"].active::before    { background: var(--observe); }
.nav-item[data-module="gateway"].active::before    { background: var(--gateway); }
.nav-item[data-module="security"].active::before   { background: var(--security); }
.nav-item[data-module="governance"].active::before { background: var(--governance); }
.nav-item[data-module="admin"].active::before      { background: var(--text-muted); }
.nav-item.locked { opacity: 0.5; cursor: not-allowed; }

/* Sub-navigation items (shown when parent module is active) */
.nav-sub-item {
  display: flex; align-items: center;
  padding: 5px 16px 5px 44px;
  font-size: 12px; color: var(--text-dim);
  text-decoration: none;
  transition: all var(--transition);
  border-left: none;
  position: relative;
}
.nav-sub-item::before {
  content: ''; position: absolute;
  left: 29px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--border);
}
.nav-sub-item:hover { color: var(--text-muted); background: var(--surface-2); }
.nav-sub-item.active { color: var(--text); }
.nav-sub-item.active::before { background: var(--primary); }

/* Tab bar used by multi-tab pages */
.tab-bar {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane, .tab-panel { display: none; }
.tab-pane.active, .tab-panel.active { display: block; }
.nav-item-icon { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item-lock { margin-left: auto; font-size: 10px; opacity: 0.5; }
.nav-badge { margin-left: auto; background: var(--danger); color: white;
  font-size: 10px; padding: 1px 5px; border-radius: 10px; font-weight: 600; }

.sidebar-footer { padding: 12px 20px; border-top: 1px solid var(--border); flex-shrink: 0; }
.sidebar-user { display: flex; align-items: center; gap: 8px; }
.sidebar-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  font-weight: 600; color: white; flex-shrink: 0; }
.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name  { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text); flex: 1; }
.topbar-subtitle { font-size: 12px; color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.page-content { flex: 1; padding: 24px; max-width: 1400px; width: 100%; }

/* ── Module badge ──────────────────────────────────────────────────────────── */
.module-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 4px;
}
.module-badge.observe    { background: rgba(59,130,246,0.15);  color: var(--observe);    }
.module-badge.gateway    { background: rgba(16,185,129,0.15);  color: var(--gateway);    }
.module-badge.security   { background: rgba(239,68,68,0.15);   color: var(--security);   }
.module-badge.governance { background: rgba(168,85,247,0.15);  color: var(--governance); }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.card-header { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-light); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); margin: 4px 0; line-height: 1.1; }
.stat-delta { font-size: 12px; }
.stat-delta.up   { color: var(--success); }
.stat-delta.down { color: var(--danger); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: var(--radius); font-size: 13px; font-weight: 500;
  border: 1px solid transparent; transition: all var(--transition); white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-light); }
.btn-danger    { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,0.1); }
.btn-success   { background: transparent; color: var(--success); border-color: var(--success); }
.btn-success:hover { background: rgba(16,185,129,0.1); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px; }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
}
.badge::before { content:''; width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.badge-success  { background: rgba(16,185,129,0.12); color:var(--success); }
.badge-success::before  { background: var(--success); }
.badge-warning  { background: rgba(245,158,11,0.12); color:var(--warning); }
.badge-warning::before  { background: var(--warning); }
.badge-danger   { background: rgba(239,68,68,0.12);  color:var(--danger);  }
.badge-danger::before   { background: var(--danger); }
.badge-info     { background: rgba(59,130,246,0.12); color:var(--info);    }
.badge-info::before     { background: var(--info); }
.badge-muted    { background: var(--surface-2); color:var(--text-muted); }
.badge-muted::before    { background: var(--text-dim); }

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
.td-mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: 8px 12px; font-size: 13px; transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input::placeholder { color: var(--text-dim); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
/* .modal-backdrop: used by setup, mcp-hub, security modals (inline display toggle) */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal-header { padding: 20px 24px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-title  { font-size: 16px; font-weight: 600; }
.modal-body   { padding: 20px 24px; }
.modal-footer { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.modal-close {
  background: none; border: none; color: var(--text-muted); font-size: 22px;
  cursor: pointer; padding: 4px 8px; border-radius: var(--radius);
  line-height: 1; transition: color var(--transition), background var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }

/* ── Toasts ─────────────────────────────────────────────────────────────────── */
#toast-container, .toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; font-size: 13px; max-width: 360px; box-shadow: var(--shadow);
  display: flex; gap: 10px; align-items: flex-start; animation: slideIn 0.2s ease;
  transform: translateX(0); opacity: 1; transition: transform 0.3s ease, opacity 0.3s ease;
}
/* Hyphenated class names (CSS convention) */
.toast-info    { border-left: 3px solid var(--info);    }
.toast-success { border-left: 3px solid var(--success); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-error   { border-left: 3px solid var(--danger);  }
/* BEM class names (SDK convention: toast--type) */
.toast--info    { border-left: 3px solid var(--info);    }
.toast--success { border-left: 3px solid var(--success); }
.toast--warning { border-left: 3px solid var(--warning); }
.toast--error   { border-left: 3px solid var(--danger);  }
.toast--visible { transform: translateX(0); opacity: 1; }
.toast--hiding  { transform: translateX(100%); opacity: 0; }
.toast__icon    { flex-shrink: 0; font-size: 16px; line-height: 1; }
.toast__message { flex: 1; line-height: 1.4; }
.toast__close   { background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 16px; padding: 0 2px; line-height: 1; flex-shrink: 0; }
.toast__close:hover { color: var(--text); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; }
                     to   { transform: translateX(0);    opacity: 1; } }

/* ── Skeleton loader ────────────────────────────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-line  { height: 14px; margin-bottom: 8px; }
.sk-title { height: 20px; width: 60%; margin-bottom: 16px; }
.sk-stat  { height: 80px; border-radius: var(--radius-lg); }

/* ── Module locked overlay ──────────────────────────────────────────────────── */
.module-locked {
  position: absolute; inset: 0; background: rgba(15,23,42,0.85);
  border-radius: var(--radius-lg); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; z-index: 10;
  backdrop-filter: blur(4px);
}
.module-locked-icon { font-size: 36px; opacity: 0.5; }
.module-locked-title { font-size: 18px; font-weight: 700; }
.module-locked-text  { font-size: 13px; color: var(--text-muted); text-align: center; max-width: 300px; }
.module-locked-card  { position: relative; overflow: hidden; }
.module-locked-overlay {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 60px 20px; min-height: 400px;
}
.module-locked-card__icon  { font-size: 48px; opacity: 0.4; margin-bottom: 16px; }
.module-locked-card__title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.module-locked-card__body  { font-size: 13px; color: var(--text-muted); max-width: 360px; margin-bottom: 20px; }

/* ── Utility ────────────────────────────────────────────────────────────────── */
.flex      { display: flex; }
.flex-1    { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 12px; }
.font-mono   { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-warning{ color: var(--warning); }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

/* ── Divider ────────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Alert box ──────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; border-left: 3px solid; }
.alert-info    { background: rgba(59,130,246,0.08);  border-color: var(--info);    color: var(--text); }
.alert-warning { background: rgba(245,158,11,0.08);  border-color: var(--warning); color: var(--text); }
.alert-danger  { background: rgba(239,68,68,0.08);   border-color: var(--danger);  color: var(--text); }
.alert-success { background: rgba(16,185,129,0.08);  border-color: var(--success); color: var(--text); }

/* ── Login page ─────────────────────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--bg); padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 400px; }
.login-logo  { text-align: center; margin-bottom: 32px; }
.login-logo-icon { width: 52px; height: 52px; background: var(--primary); border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: white; margin-bottom: 12px; }
.login-logo-name { font-size: 22px; font-weight: 700; color: var(--text); }
.login-logo-sub  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.login-divider { text-align: center; color: var(--text-dim); font-size: 12px;
  margin: 20px 0; position: relative; }
.login-divider::before, .login-divider::after { content:''; position:absolute;
  top:50%; width:42%; height:1px; background:var(--border); }
.login-divider::before { left:0; } .login-divider::after { right:0; }
.sso-btn { width:100%; justify-content:center; margin-bottom:8px; }

/* ── Empty state ────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon  { font-size: 40px; margin-bottom: 16px; opacity: 0.4; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state-text  { font-size: 13px; max-width: 300px; margin: 0 auto 20px; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

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

/* ── Key reveal box ─────────────────────────────────────────────────────────── */
.key-reveal { background: var(--bg); border: 1px solid var(--warning);
  border-radius: var(--radius); padding: 12px 16px; }
.key-reveal-warning { font-size: 12px; color: var(--warning); font-weight: 600; margin-bottom: 8px; }
.key-value { font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--success); word-break: break-all; }

/* ── Button loading/spinner state ───────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.btn-loading {
  position: relative; pointer-events: none; opacity: 0.75;
}
.btn-loading::after {
  content: ''; position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}
.btn-loading > * { visibility: hidden; }

/* ── Mobile hamburger ────────────────────────────────────────────────────────── */
.hamburger-btn {
  display: none; background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--text); font-size: 20px; line-height: 1;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99;
}
@media (max-width: 768px) {
  .hamburger-btn { display: flex; align-items: center; justify-content: center; }
  .sidebar-overlay.open { display: block; }
}

/* ── Token expiry colour coding ─────────────────────────────────────────────── */
.expiry-ok     { color: var(--success); }
.expiry-warn   { color: var(--warning); }
.expiry-urgent { color: var(--danger);  font-weight: 600; }

/* ── Inline suggestion banner ───────────────────────────────────────────────── */
.inline-suggestion {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; margin-top: 12px;
  background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius); font-size: 13px;
}
.inline-suggestion .suggestion-icon { font-size: 18px; flex-shrink: 0; }
.inline-suggestion .suggestion-text { flex: 1; }
.inline-suggestion .suggestion-cta  { flex-shrink: 0; }

/* ── Scan progress bar ───────────────────────────────────────────────────────── */
.scan-progress {
  background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px;
}
.scan-progress-label { font-size: 13px; margin-bottom: 6px; }
.scan-progress-bar-bg { background: var(--surface-2); border-radius: 4px; height: 6px; overflow: hidden; }
.scan-progress-bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.3s ease; }

/* ── Registration completion card ───────────────────────────────────────────── */
.completion-card {
  background: rgba(16,185,129,0.06); border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 16px;
}
.completion-card-title { font-size: 15px; font-weight: 700; color: var(--success); margin-bottom: 8px; }
.completion-card-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.completion-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 14px; font-size: 13px; font-weight: 600;
}
.completion-stat.c-safe   { color: var(--success); }
.completion-stat.c-medium { color: var(--warning); }
.completion-stat.c-danger { color: var(--danger); }
.completion-card-rec { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

/* ── Mobile responsive table ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal { max-width: 100vw !important; width: 100% !important; max-height: 100vh !important;
    border-radius: 0 !important; margin: 0 !important; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .page-content { padding: 16px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
}

/* ── Focus / keyboard accessibility ──────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Icon-only button accessibility (should always have aria-label) ───────── */
.btn-icon-only { min-width: 32px; justify-content: center; }

/* ── Error state for form inputs ─────────────────────────────────────────── */
.form-input.error, .form-select.error { border-color: var(--danger); }
.form-error-msg {
  font-size: 11px; color: var(--danger); margin-top: 4px;
  display: flex; align-items: center; gap: 4px;
}
.form-error-msg::before { content: '❌'; font-size: 10px; }

/* ── Vendor sidebar status dots ──────────────────────────────────────────── */
.vendor-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.vendor-status-dot--active   { background: var(--success); }
.vendor-status-dot--syncing  { background: var(--warning); }
.vendor-status-dot--error    { background: var(--danger);  }
.vendor-status-dot--inactive { background: var(--text-dim); }

/* ── Vendor card grid (Vendor Activity dashboard) ────────────────────────── */
.vendor-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  padding: 16px;
}
.vendor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.vendor-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.vendor-card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
}
.vendor-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: grid;
  gap: 4px;
  margin-top: 8px;
}
