/* ============================================================
   Graphoid Control Plane — Main Stylesheet
   Dark sidebar, light content, indigo accent (#6366f1)
   ============================================================ */

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

:root {
  --indigo:        #6366f1;
  --indigo-dark:   #4f46e5;
  --indigo-light:  #e0e7ff;
  --sidebar-bg:    #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-text:  #94a3b8;
  --sidebar-active:#ffffff;
  --content-bg:    #f8fafc;
  --card-bg:       #ffffff;
  --border:        #e2e8f0;
  --text-primary:  #0f172a;
  --text-muted:    #64748b;
  --green:         #22c55e;
  --red:           #ef4444;
  --orange:        #f97316;
  --blue:          #3b82f6;
  --yellow:        #eab308;
  --gray:          #9ca3af;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 3px 0 rgb(0 0 0 / .08), 0 1px 2px -1px rgb(0 0 0 / .08);
  --shadow-md:     0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --sidebar-w:     240px;
  --topbar-h:      64px;
  --transition:    .18s ease;
}

html { font-size: 15px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--content-bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }

/* ── App shell ────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--transition);
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid #1e293b;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo-img { width: 32px; height: 32px; }
.logo-text {
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  opacity: .7;
}
.sidebar-close {
  display: none;
  background: none; border: none;
  color: var(--sidebar-text);
  font-size: 1.1rem;
  padding: 4px;
}

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar-nav ul { list-style: none; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 500;
  border-radius: 8px;
  margin: 2px 8px;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--indigo); color: #fff; }
.nav-item--danger:hover { background: #450a0a; color: #fca5a5; }
.nav-icon { width: 18px; text-align: center; flex-shrink: 0; }
.nav-icon-sm { width: 14px; text-align: center; flex-shrink: 0; font-size: .75rem; }

/* Sidebar sub-menu (shown when parent is active) */
.nav-sub {
  list-style: none;
  padding: 2px 0 6px 0;
  margin: 0;
  background: rgba(0,0,0,.15);
  border-left: 2px solid var(--indigo);
  margin-left: 18px;
  border-radius: 0 0 4px 4px;
}
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  color: #94a3b8;
  font-size: .8rem;
  text-decoration: none;
  transition: color .15s, background .15s;
  border-radius: 4px;
}
.nav-sub-item:hover,
.nav-sub-item.active { color: #e2e8f0; background: rgba(99,102,241,.2); }

.sidebar-footer { padding: 12px 0; border-top: 1px solid #1e293b; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgb(0 0 0 / .4);
  z-index: 199;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.hamburger {
  display: none;
  background: none; border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  padding: 6px;
}
.page-title { font-size: 1.05rem; font-weight: 600; }

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
}
.topbar-search > .fa-magnifying-glass {
  position: absolute; left: 10px; color: var(--text-muted); font-size: .85rem;
}
.topbar-search input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px 7px 32px;
  font-size: .85rem;
  font-family: inherit;
  width: 220px;
  background: var(--content-bg);
  outline: none;
  transition: border-color var(--transition);
}
.topbar-search input:focus { border-color: var(--indigo); }
.search-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 300;
  display: none;
  max-height: 280px;
  overflow-y: auto;
}
.search-results.open { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  font-size: .85rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
}
.search-result-item:hover { background: var(--content-bg); }

.topbar-btn {
  position: relative;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--text-muted);
  font-size: .9rem;
  transition: border-color var(--transition);
}
.topbar-btn:hover { border-color: var(--indigo); color: var(--indigo); }
.topbar-btn .badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--red); color: #fff;
  font-size: .65rem; font-weight: 700;
  border-radius: 999px; padding: 1px 5px;
  min-width: 18px; text-align: center;
}

.admin-menu { position: relative; }
.admin-avatar {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: .85rem; font-weight: 500;
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.admin-avatar:hover { border-color: var(--indigo); }
.avatar-initials {
  width: 28px; height: 28px;
  background: var(--indigo);
  color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: .7rem; font-weight: 700;
  flex-shrink: 0;
}
.admin-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 220px;
  z-index: 300;
  display: none;
}
.admin-dropdown.open { display: block; }
.dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.dropdown-header strong { font-size: .9rem; }
.dropdown-header small { color: var(--text-muted); font-size: .78rem; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  font-size: .85rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--content-bg); text-decoration: none; }
.dropdown-item.text-danger { color: var(--red); }
.badge-role {
  background: var(--indigo-light);
  color: var(--indigo-dark);
  font-size: .68rem;
  align-self: flex-start;
}

/* ── Main content area ───────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  padding: var(--topbar-h) 0 0;
  width: calc(100% - var(--sidebar-w));
}
.content-inner { padding: 28px 28px 60px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: .95rem; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--content-bg);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Metric cards ────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.metric-card__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.metric-card__icon.indigo { background: var(--indigo-light); color: var(--indigo); }
.metric-card__icon.green  { background: #dcfce7; color: #16a34a; }
.metric-card__icon.blue   { background: #dbeafe; color: #2563eb; }
.metric-card__icon.orange { background: #ffedd5; color: #ea580c; }
.metric-card__icon.red    { background: #fee2e2; color: #dc2626; }
.metric-card__icon.yellow { background: #fef9c3; color: #ca8a04; }
.metric-card__body { flex: 1; min-width: 0; }
.metric-card__value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.metric-card__label { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.metric-card__sub { font-size: .75rem; color: var(--text-muted); margin-top: 6px; }

/* ── Tables ──────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: var(--content-bg);
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--indigo); }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child { border-bottom: none; }
td { padding: 12px 14px; vertical-align: middle; }
td.mono { font-family: 'Fira Code', 'Courier New', monospace; font-size: .8rem; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem; font-weight: 600;
  white-space: nowrap;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-indigo { background: var(--indigo-light); color: var(--indigo-dark); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  border: none;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn-primary   { background: var(--indigo); color: #fff; }
.btn-danger    { background: var(--red); color: #fff; }
.btn-success   { background: var(--green); color: #fff; }
.btn-warning   { background: var(--orange); color: #fff; }
.btn-secondary { background: var(--content-bg); color: var(--text-primary); border: 1px solid var(--border); }
.btn-ghost     { background: transparent; color: var(--indigo); }
.btn-sm        { padding: 5px 10px; font-size: .8rem; }
.btn-full      { width: 100%; justify-content: center; }
.btn:disabled  { opacity: .5; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: 6px; }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: .875rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-light); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.input-wrapper { position: relative; }
.input-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: .85rem; pointer-events: none;
}
.input-wrapper .form-input { padding-left: 34px; }
.input-suffix {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); font-size: .85rem;
}
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: .85rem; cursor: pointer; }
.checkbox-label input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--indigo); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 16px;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Toasts ──────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 380px;
  font-size: .875rem;
  animation: slideIn .2s ease;
}
.toast.toast-success { border-left: 4px solid var(--green); }
.toast.toast-danger  { border-left: 4px solid var(--red); }
.toast.toast-warning { border-left: 4px solid var(--orange); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Modals ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgb(0 0 0 / .4);
  z-index: 500;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgb(0 0 0 / .2);
  width: 100%; max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
.modal-lg { max-width: 760px; }
@keyframes modalIn {
  from { transform: scale(.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-weight: 600; }
.modal-close {
  background: none; border: none;
  font-size: 1.1rem; color: var(--text-muted);
  padding: 4px 6px;
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; gap: 4px; }
.tab-btn {
  background: none; border: none;
  padding: 10px 18px;
  font-size: .875rem; font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  cursor: pointer; font-family: inherit;
}
.tab-btn:hover { color: var(--indigo); }
.tab-btn.active { color: var(--indigo); border-bottom-color: var(--indigo); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Filters bar ─────────────────────────────────────────── */
.filters-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-input, .filter-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: .85rem;
  font-family: inherit;
  background: var(--card-bg);
  outline: none;
  transition: border-color var(--transition);
}
.filter-input:focus, .filter-select:focus { border-color: var(--indigo); }
.filter-input { min-width: 200px; }
.spacer { flex: 1; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 6px;
  justify-content: center; padding: 16px;
}
.page-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  display: grid; place-items: center;
  font-size: .85rem; font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.page-btn:hover { background: var(--content-bg); border-color: var(--indigo); }
.page-btn.active { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Dashboard grids ─────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.chart-grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.chart-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.chart-card canvas { max-height: 240px; }

.activity-feed { list-style: none; }
.activity-item {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: .8rem;
  flex-shrink: 0;
}
.activity-icon.blue   { background: #dbeafe; color: #2563eb; }
.activity-icon.green  { background: #dcfce7; color: #16a34a; }
.activity-icon.red    { background: #fee2e2; color: #dc2626; }
.activity-icon.orange { background: #ffedd5; color: #ea580c; }
.activity-icon.gray   { background: #f1f5f9; color: #64748b; }
.activity-body { flex: 1; }
.activity-time { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }

/* ── Health grid ─────────────────────────────────────────── */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.health-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.health-card.offline { border-left: 4px solid var(--red); }
.health-card.online  { border-left: 4px solid var(--green); }
.health-card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--green); box-shadow: 0 0 0 3px #bbf7d0; }
.status-dot.offline { background: var(--red); box-shadow: 0 0 0 3px #fecaca; }

/* ── Login page ──────────────────────────────────────────── */
.login-body { background: var(--sidebar-bg); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrapper { width: 100%; max-width: 420px; padding: 24px; }
.login-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 20px 60px rgb(0 0 0 / .3);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-logo-img { width: 40px; height: 40px; }
.brand-name { display: block; font-size: 1.1rem; font-weight: 700; color: var(--indigo); }
.brand-sub  { display: block; font-size: .75rem; color: var(--text-muted); }
.login-heading { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }
.login-sub { font-size: .85rem; color: var(--text-muted); margin-bottom: 24px; }
.login-form { margin-bottom: 20px; }
.login-footer { font-size: .75rem; color: var(--text-muted); text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ── Step wizard ─────────────────────────────────────────── */
.wizard-steps {
  display: flex; align-items: center; margin-bottom: 32px;
}
.wizard-step {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; color: var(--text-muted); font-weight: 500;
}
.wizard-step.active { color: var(--indigo); }
.wizard-step.done   { color: var(--green); }
.step-circle {
  width: 30px; height: 30px;
  border-radius: 50%; border: 2px solid currentColor;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.wizard-step.done .step-circle { background: var(--green); border-color: var(--green); color: #fff; }
.wizard-step.active .step-circle { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.step-connector { flex: 1; height: 2px; background: var(--border); margin: 0 8px; }
.step-connector.done { background: var(--green); }

/* ── Log stream ──────────────────────────────────────────── */
.log-stream {
  background: #0f172a; color: #94a3b8;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: .8rem;
  line-height: 1.7;
  max-height: 360px;
  overflow-y: auto;
}
.log-stream .log-success { color: #4ade80; }
.log-stream .log-error   { color: #f87171; }
.log-stream .log-info    { color: #60a5fa; }

/* ── Section heading ─────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.section-title { font-size: 1rem; font-weight: 600; }

/* ── Skeleton loading ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Misc utilities ──────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--red); }
.text-success { color: var(--green); }
.text-center  { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; } .mb-4 { margin-bottom: 28px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.font-mono { font-family: 'Fira Code','Courier New',monospace; font-size: .85em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.expiry-warn  { color: var(--orange); font-weight: 600; }
.expiry-crit  { color: var(--red); font-weight: 700; }
.country-flag { font-size: 1.2rem; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .chart-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close { display: block; }
  .sidebar-overlay.open { display: block; }
  .topbar { left: 0; }
  .main-content { margin-left: 0; width: 100%; }
  .hamburger { display: block; }
  .topbar-search { display: none; }
  .admin-name { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid, .chart-grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .content-inner { padding: 16px; }
}

@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px; }
}
