/* DevOps Control Portal - single stylesheet for every page. */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef1f5;
  --border: #e2e6ec;
  --border-strong: #cdd3dc;
  --text: #1a2130;
  --text-2: #465063;
  --muted: #6b7486;
  --primary: #2458d6;
  --primary-hover: #1c47b3;
  --primary-soft: #e8eefc;
  --primary-text: #1c47b3;
  --success: #17804a;
  --success-soft: #e2f4e9;
  --warning: #9a5b00;
  --warning-soft: #fff3d9;
  --danger: #c2372a;
  --danger-hover: #a52d22;
  --danger-soft: #fdebea;
  --info: #0e6b8a;
  --info-soft: #e1f2f8;
  --neutral-soft: #eef0f4;
  --sidebar-bg: #121826;
  --sidebar-text: #aab3c5;
  --sidebar-text-strong: #ffffff;
  --sidebar-hover: #1c2433;
  --sidebar-active: #253049;
  --focus: 0 0 0 3px rgba(36, 88, 214, 0.28);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 18px 40px rgba(16, 24, 40, 0.18);
  --radius: 10px;
  --radius-sm: 7px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --p-aws: #d97706;
  --p-gcp: #2563eb;
  --p-vastai: #7c3aed;
  --p-tensordock: #0d9488;
  --p-hetzner: #d50c2d;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e131c;
    --surface: #151b26;
    --surface-2: #19202c;
    --surface-3: #1f2733;
    --border: #283142;
    --border-strong: #354055;
    --text: #e6e9ef;
    --text-2: #b8c0cf;
    --muted: #8892a6;
    --primary: #4a7cf0;
    --primary-hover: #6390f5;
    --primary-soft: #1c2a4a;
    --primary-text: #8db0ff;
    --success: #3fbf7f;
    --success-soft: #133325;
    --warning: #e0a33b;
    --warning-soft: #362a12;
    --danger: #ef6b5e;
    --danger-hover: #f3857a;
    --danger-soft: #3a1b19;
    --info: #4fb6d6;
    --info-soft: #11303b;
    --neutral-soft: #232b38;
    --sidebar-bg: #0a0e15;
    --sidebar-hover: #151c28;
    --sidebar-active: #1d2638;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
p { margin: 0 0 0.75rem; }
code, pre, .mono { font-family: var(--mono); font-size: 0.92em; }
[hidden] { display: none !important; }
button { font: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }

.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--sidebar-bg); color: var(--sidebar-text);
  transition: transform 0.2s ease;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px; color: var(--sidebar-text-strong); font-weight: 650; font-size: 15px;
}
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.nav-section { margin: 16px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #6f7a8f; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px; color: var(--sidebar-text); font-weight: 500;
}
.nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); text-decoration: none; }
.nav-link.active { background: var(--sidebar-active); color: var(--sidebar-text-strong); }
.nav-link.active .icon { color: #7fa3ff; }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.sidebar-user form { margin: 0 0 0 auto; }
.sidebar-user .icon-btn { color: var(--sidebar-text); }
.sidebar-user .icon-btn:hover { background: var(--sidebar-hover); color: #fff; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #2d3a55; color: #fff; font-weight: 600; flex: none; }
.sidebar-user-info { min-width: 0; }
.sidebar-user-name { color: var(--sidebar-text-strong); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.sidebar-user-role { font-size: 12px; color: #7d889d; }
.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; margin-left: 248px; display: flex; flex-direction: column; }
.page-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.page-heading { flex: 1; min-width: 200px; }
.page-heading h1 { font-size: 20px; }
.page-heading .subtitle { color: var(--muted); margin-top: 2px; font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-body { padding: 22px 28px 48px; max-width: 1480px; width: 100%; }
.menu-btn { display: none; }

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 30; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .page-header { padding: 12px 16px; }
  .page-body { padding: 16px 16px 40px; }
}

/* ---------------------------------------------------------------- primitives */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 15px; }
.card-header .card-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.section { margin-top: 22px; }
.section-title { font-size: 15px; margin-bottom: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.divider { height: 1px; background: var(--border); margin: 16px 0; border: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 550; font-size: 13.5px; line-height: 1;
  cursor: pointer; white-space: nowrap; text-decoration: none; user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-danger-soft:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-success-soft { background: var(--success-soft); color: var(--success); }
.btn-success-soft:hover:not(:disabled) { background: var(--success); color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.btn-google { background: var(--surface); color: var(--text); border-color: var(--border-strong); height: 42px; font-size: 14.5px; gap: 12px; }
.btn-google:hover { background: var(--surface-3); }
.btn-google svg { width: 18px; height: 18px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 7px;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; flex: none; }
.spinner-lg { width: 22px; height: 22px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- badges & chips */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--neutral-soft); color: var(--text-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge-plain::before { display: none; }
.badge-state-running, .badge-status-approved, .badge-status-succeeded, .badge-success { background: var(--success-soft); color: var(--success); }
.badge-state-stopped, .badge-status-rejected, .badge-status-failed, .badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-state-pending, .badge-state-stopping, .badge-status-pending, .badge-status-running, .badge-status-queued, .badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-state-unknown, .badge-status-interrupted, .badge-status-cancelled { background: var(--neutral-soft); color: var(--muted); }
.badge-info, .badge-role-manager { background: var(--info-soft); color: var(--info); }
.badge-role-admin { background: var(--primary-soft); color: var(--primary-text); }
.badge-role-user { background: var(--neutral-soft); color: var(--text-2); }
.badge-role-admin::before, .badge-role-manager::before, .badge-role-user::before { display: none; }

.provider-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.provider-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--muted); flex: none; }
.provider-aws .provider-dot, .provider-dot.provider-aws { background: var(--p-aws); }
.provider-gcp .provider-dot, .provider-dot.provider-gcp { background: var(--p-gcp); }
.provider-vastai .provider-dot, .provider-dot.provider-vastai { background: var(--p-vastai); }
.provider-tensordock .provider-dot, .provider-dot.provider-tensordock { background: var(--p-tensordock); }
.provider-hetzner .provider-dot, .provider-dot.provider-hetzner { background: var(--p-hetzner); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font-weight: 550; font-size: 13px; cursor: pointer;
}
.chip:hover { background: var(--surface-3); }
.chip[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
.chip .chip-count { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.chip[aria-pressed="true"] .chip-count { background: var(--primary); color: #fff; }
.user-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; margin: 1px 4px 1px 0; white-space: nowrap; }
.user-chip.me { background: var(--primary-soft); color: var(--primary-text); }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; gap: 14px; }
.form-grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-weight: 600; font-size: 13px; color: var(--text); }
.field .hint { font-size: 12px; color: var(--muted); }
.required::after { content: " *"; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit;
}
.textarea { height: auto; min-height: 110px; padding: 9px 11px; resize: vertical; }
.select { padding-right: 28px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: var(--focus); outline: none; }
.input-sm { height: 30px; font-size: 13px; }
.input-with-icon { position: relative; }
.input-with-icon .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-with-icon .input { padding-left: 32px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 200px; }

/* ---------------------------------------------------------------- alerts & toasts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid transparent; margin-bottom: 12px; }
.alert > span { flex: 1; }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-close { border: 0; background: transparent; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; opacity: 0.7; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--info); animation: toast-in 0.18s ease;
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast .toast-msg { flex: 1; word-break: break-word; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .col-check { width: 36px; padding-right: 0; }
.table .col-actions { text-align: right; white-space: nowrap; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--muted); }
.cell-id { display: block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-machine { max-width: 240px; }
.machine-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 2px; }
.cell-assigned { max-width: 150px; }
.table .col-actions .btn-group { flex-wrap: nowrap; }
/* Actions stay visible on the right even when a wide table scrolls horizontally. */
.table .col-actions { position: sticky; right: 0; background: var(--surface); box-shadow: -1px 0 0 var(--border); }
.table th.col-actions { background: var(--surface-2); }
.copyable { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12.5px; }
.copy-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 4px; display: inline-grid; place-items: center; }
.copy-btn:hover { color: var(--primary-text); background: var(--surface-3); }
.copy-btn .icon { width: 13px; height: 13px; }

/* ---------------------------------------------------------------- KPI tiles */
.kpi { padding: 16px 18px; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 26px; font-weight: 650; margin-top: 6px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi a { color: inherit; }

/* ---------------------------------------------------------------- dialogs */
.dialog { border: 0; padding: 0; border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.dialog-sm { width: min(440px, calc(100vw - 32px)); }
.dialog-lg { width: min(820px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(12, 17, 27, 0.5); }
.dialog-form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); margin: 0; }
.dialog-header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dialog-header h2 { font-size: 16px; flex: 1; }
.dialog-body { padding: 18px 20px; overflow-y: auto; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 12px 12px; }

/* ---------------------------------------------------------------- misc components */
.empty-state { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty-state .icon { width: 34px; height: 34px; stroke-width: 1.5; color: var(--border-strong); margin-bottom: 8px; }
.empty-state h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty-code { font-size: 44px; font-weight: 700; color: var(--border-strong); margin-bottom: 6px; }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 36px; color: var(--muted); }
.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 16px; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; word-break: break-word; }
.code-block { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.code-line { display: flex; align-items: center; gap: 8px; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px; font-family: var(--mono); font-size: 12.5px; margin-bottom: 6px; }
.code-line code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
.progress { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-bar { height: 100%; background: var(--success); width: 0; transition: width 0.4s ease; }
.meter { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.meter-track { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter-fill { height: 100%; background: var(--success); }
.meter-fill.warn { background: var(--warning); }
.meter-fill.crit { background: var(--danger); }
.meter-value { font-variant-numeric: tabular-nums; font-size: 12.5px; width: 44px; text-align: right; }
.trend-up { color: var(--danger); }
.trend-down { color: var(--success); }
.event-log { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.event { display: flex; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border-left: 3px solid var(--info); font-size: 13px; }
.event-success { border-left-color: var(--success); }
.event-warning { border-left-color: var(--warning); }
.event-error { border-left-color: var(--danger); }
.event-time { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.activity-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex: none; }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 18px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.chart-box { position: relative; height: 380px; }
.rule-ips { display: flex; flex-wrap: wrap; gap: 4px; }
.ip-pill { font-family: var(--mono); font-size: 12px; padding: 1px 7px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.ip-pill.mine { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.ip-pill .owner { font-family: var(--font); font-weight: 500; color: var(--muted); margin-left: 4px; }
.my-ip-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary-text); margin-bottom: 16px; }
.my-ip-box strong { font-family: var(--mono); font-size: 15px; }
.user-pick-list { max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.user-pick { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.user-pick:last-child { border-bottom: 0; }
.user-pick .grow { flex: 1; min-width: 0; }
.role-legend { display: grid; gap: 6px; font-size: 13px; }

/* ---------------------------------------------------------------- auth pages */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 0%, var(--primary-soft), transparent 55%), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 32px 30px; }
.auth-card h1 { font-size: 21px; margin-bottom: 6px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-weight: 650; }
.auth-brand .brand-mark { width: 34px; height: 34px; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.status-illustration { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; margin-bottom: 14px; }
.status-illustration .icon { width: 26px; height: 26px; }
.status-pending { background: var(--warning-soft); color: var(--warning); }
.status-rejected { background: var(--danger-soft); color: var(--danger); }

.show-sm { display: none; }

@media (max-width: 1400px) {
  .hide-md { display: none; }
}

@media (max-width: 640px) {
  .table th, .table td { padding: 9px 10px; }
  .hide-sm { display: none; }
  .show-sm { display: block; }
  .cell-id { max-width: 130px; }
  .cell-machine { max-width: 180px; }
  .kv { grid-template-columns: 1fr; }
}
