*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue:       #1565C0;
    --blue-dark:  #0D47A1;
    --blue-light: #1976D2;
    --teal:       #00796B;
    --text:       #0f172a;
    --text-muted: #64748b;
    --bg:         #f1f5f9;
    --white:      #ffffff;
    --border:     #e2e8f0;
    --radius:     8px;
    --nav-h:      60px;
    --bc-h:       36px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 0.92rem;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: linear-gradient(90deg, var(--blue-dark) 0%, var(--blue) 100%);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 200;
}

.logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: #fff; flex-shrink: 0;
}
.logo-icon { width: 22px; height: 22px; color: #90CAF9; }
.logo-text { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.02em; }

.topbar-nav { display: flex; gap: 4px; flex: 1; }
.topbar-right { flex-shrink: 0; }

.nav-link {
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem; font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover  { background: rgba(255,255,255,0.12); color: #fff; }
.nav-link.active { background: rgba(255,255,255,0.18); color: #fff; }

.btn-login {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 6px 18px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 500;
    cursor: pointer; transition: background 0.15s;
}
.btn-login:hover { background: rgba(255,255,255,0.25); }

/* ── Breadcrumb bar ─────────────────────────────────────────── */
.breadcrumb-bar {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    height: var(--bc-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 24px;
    z-index: 100;
}
.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; }
.breadcrumbs a { color: var(--blue-light); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.bc-sep { color: var(--text-muted); }
.bc-current { color: var(--text); font-weight: 500; }

/* ── Content area ───────────────────────────────────────────── */
.content {
    margin-top: var(--nav-h);
    padding: 36px 32px;
    max-width: 1280px;
}
.content.has-breadcrumbs {
    margin-top: calc(var(--nav-h) + var(--bc-h));
}

/* ── Page header ────────────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.7rem; font-weight: 700; }
.subtitle { color: var(--text-muted); margin-top: 4px; }

.section-title {
    font-size: 1rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.07em; margin: 32px 0 14px;
}

/* ── Search bar ─────────────────────────────────────────────── */
.search-bar {
    display: flex; align-items: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 14px;
    margin-bottom: 28px;
    max-width: 520px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar:focus-within { border-color: var(--blue-light); box-shadow: 0 0 0 3px rgba(25,118,210,0.12); }
.search-icon { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
    flex: 1; border: none; outline: none;
    padding: 11px 10px; font-size: 0.92rem;
    background: transparent; color: var(--text);
}
.search-clear { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; padding: 4px; }
.search-clear:hover { color: var(--text); }

/* ── Site grid ──────────────────────────────────────────────── */
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.site-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none; color: inherit;
    display: flex; flex-direction: column;
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
    overflow: hidden;
}
.site-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-2px); border-color: #bfdbfe; }
.site-card-header {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    padding: 20px;
    display: flex; align-items: center; justify-content: center;
}
.site-card-header svg { width: 32px; height: 32px; color: rgba(255,255,255,0.7); }
.site-card-body { padding: 16px; flex: 1; }
.site-name { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.site-location { font-size: 0.82rem; color: var(--text-muted); }
.site-address { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.site-card-footer { padding: 10px 16px; border-top: 1px solid var(--border); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 10px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 600;
}
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-teal { background: #ccfbf1; color: #065f46; }

/* ── Equipment cards (site detail) ─────────────────────────── */
.card-grid { display: flex; gap: 16px; flex-wrap: wrap; }
.eq-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 20px 20px 20px;
    text-decoration: none; color: inherit;
    min-width: 260px;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.eq-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-color: #bfdbfe; }
.eq-card-icon {
    width: 48px; height: 48px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.eq-card-icon svg { width: 26px; height: 26px; }
.eq-icon-blue { background: #dbeafe; color: var(--blue); }
.eq-icon-teal { background: #ccfbf1; color: #0d9488; }
.eq-card-body { flex: 1; }
.eq-card-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.eq-card-count { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.eq-card-sub { font-size: 0.8rem; color: var(--text-muted); }
.eq-card-arrow { font-size: 1.4rem; color: var(--text-muted); }

/* ── Info card ──────────────────────────────────────────────── */
.info-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 0;
    margin-bottom: 8px;
}
.info-row {
    display: flex; align-items: center; gap: 16px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label { width: 120px; font-size: 0.82rem; color: var(--text-muted); font-weight: 500; flex-shrink: 0; }

/* ── Data table ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-bottom: 24px; }
.data-table {
    width: 100%; border-collapse: collapse;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.data-table th {
    background: #f8fafc;
    padding: 10px 16px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }
.clickable-row { cursor: pointer; }

.td-hostname { font-weight: 600; }
.td-mono { font-family: 'Cascadia Code', 'Consolas', monospace; font-size: 0.85rem; }
.td-muted { color: var(--text-muted); }

.ports-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-green { background: #22c55e; }

.status-dot {
    font-size: 0.78rem; font-weight: 600; padding: 2px 8px;
    border-radius: 4px; display: inline-block;
}
.status-up { background: #dcfce7; color: #15803d; }
.status-down { background: #f1f5f9; color: #64748b; }
.status-disabled { background: #fef9c3; color: #854d0e; }

/* ── Switch diagram ─────────────────────────────────────────── */
.switch-diagram {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 8px;
    overflow-x: auto;
}

.switch-chassis {
    background: #1e293b;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
    min-width: min-content;
}

.switch-label {
    flex-shrink: 0;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.switch-model-tag {
    display: block;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 0.6rem; font-weight: 700;
    letter-spacing: 0.1em; color: #94a3b8;
    text-transform: uppercase; white-space: nowrap;
}
.switch-status-dot {
    width: 8px; height: 8px; border-radius: 50%;
}
.sw-online  { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.sw-offline { background: #ef4444; }

/* Switch face holds port banks side by side */
.switch-face {
    display: flex; align-items: center; gap: 10px; flex: 1;
}

/* A bank is two rows of ports */
.port-bank {
    display: flex; flex-direction: column; gap: 3px;
}
.port-bank-uplink {
    position: relative; padding-bottom: 14px;
}
.port-bank-divider {
    width: 2px; align-self: stretch;
    background: #334155; border-radius: 2px; flex-shrink: 0;
}
.port-row {
    display: flex; flex-direction: row; gap: 3px;
}
.uplink-label {
    position: absolute; bottom: 0; left: 0; right: 0;
    text-align: center; font-size: 0.55rem;
    color: #64748b; text-transform: uppercase; letter-spacing: 0.08em;
}

.port {
    width: 26px; height: 22px;
    border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0; /* hide port-num by default, show on hover */
    cursor: pointer;
    transition: transform 0.1s, filter 0.1s;
    border-bottom: 3px solid rgba(0,0,0,0.35);
    user-select: none;
    position: relative;
}
.port-num {
    font-size: 0.52rem; font-weight: 700;
    color: rgba(255,255,255,0.85);
    line-height: 1;
}
.port:hover { transform: scale(1.25); filter: brightness(1.3); z-index: 10; }
.port:hover .port-num { font-size: 0.52rem; }

/* SFP uplink ports — slightly taller */
.port-sfp {
    width: 22px; height: 28px;
    border-radius: 4px;
}

/* Port status colors */
.port-linked   { background: #16a34a; }
.port-up       { background: #16a34a; }
.port-down     { background: #334155; }
.port-disabled { background: #1e293b; border: 1px solid #2d3f55; border-bottom: 3px solid rgba(0,0,0,0.35); }

.port-legend {
    display: flex; align-items: center; gap: 20px;
    margin-top: 14px; padding-top: 14px;
    border-top: 1px solid var(--border);
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); }
.legend-dot { width: 12px; height: 12px; border-radius: 2px; }
.dot-linked   { background: #16a34a; }
.dot-up       { background: #16a34a; }
.dot-down     { background: #334155; }
.dot-disabled { background: #1e293b; border: 1px solid #334155; }

/* ── Port info panel ────────────────────────────────────────── */
.port-info-panel {
    background: #0f172a;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 12px 0 0;
    min-height: 56px;
    color: #e2e8f0;
}
.port-info-hint { font-size: 0.82rem; color: #475569; }
.pi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 24px; }
.pi-row { display: flex; flex-direction: column; gap: 2px; }
.pi-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: #475569; }
.pi-divider { grid-column: 1 / -1; border-top: 1px solid #1e293b; margin: 4px 0; }

/* ── Page header row (title + action button) ────────────────── */
.page-header-row {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 28px; gap: 16px;
}
.page-header-row h1 { font-size: 1.7rem; font-weight: 700; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex; align-items: center;
    background: var(--blue); color: #fff;
    padding: 8px 20px; border-radius: 8px;
    font-size: 0.9rem; font-weight: 600;
    text-decoration: none; border: none; cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.btn-primary:hover { background: var(--blue-dark); }

.btn-secondary {
    display: inline-flex; align-items: center;
    background: var(--white); color: var(--text);
    padding: 8px 18px; border-radius: 8px;
    font-size: 0.9rem; font-weight: 500;
    text-decoration: none; border: 1px solid var(--border); cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.btn-secondary:hover { background: var(--bg); }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }

/* ── Toast notifications (bottom-right, auto-dismiss) ────────── */
.toast-stack {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 500;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-radius: 10px;
    font-size: 0.88rem; font-weight: 500;
    pointer-events: all;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 260px; max-width: 400px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.toast-hide {
    opacity: 0;
    transform: translateY(12px);
}
.toast-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.toast-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.toast-close {
    background: none; border: none; cursor: pointer;
    color: inherit; opacity: 0.5; font-size: 0.85rem; padding: 0; flex-shrink: 0;
}
.toast-close:hover { opacity: 1; }

/* ── Site card — site_code badge overlay ─────────────────────── */
.site-card-header { position: relative; }
.site-code-badge {
    position: absolute; top: 8px; right: 8px;
    background: rgba(255,255,255,0.2);
    color: #fff; font-size: 0.72rem; font-weight: 700;
    padding: 2px 8px; border-radius: 20px;
    letter-spacing: 0.05em; backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* ── Tabs ────────────────────────────────────────────────────── */
.tab-bar {
    display: flex; gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}
.tab-btn {
    background: none; border: none; cursor: pointer;
    padding: 10px 24px; font-size: 0.9rem; font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Form card ───────────────────────────────────────────────── */
.form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    max-width: 560px;
}

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: 0.85rem; font-weight: 600;
    margin-bottom: 6px; color: var(--text);
}
.required { color: #ef4444; }
.form-group input[type="text"],
.form-group input[type="email"] {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--border); border-radius: 7px;
    font-size: 0.92rem; color: var(--text);
    background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.form-group input:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(25,118,210,0.1);
}

.form-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 24px; padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ── CSV format box ──────────────────────────────────────────── */
.csv-format-box {
    background: #f8fafc; border: 1px solid var(--border);
    border-radius: 8px; padding: 16px; margin-bottom: 20px;
}
.csv-format-title { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.csv-example {
    display: block; font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.8rem; color: var(--text);
    line-height: 1.7; margin-bottom: 10px;
}
.csv-note { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }

/* ── File drop zone ──────────────────────────────────────────── */
.file-drop {
    border: 2px dashed var(--border); border-radius: 10px;
    padding: 32px 20px; text-align: center;
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.file-drop:hover, .file-drop.drag-over {
    border-color: var(--blue-light); background: #eff6ff;
}
.file-drop svg { width: 36px; height: 36px; color: var(--text-muted); margin-bottom: 10px; }
.file-drop p { font-size: 0.88rem; color: var(--text-muted); }
.file-browse { color: var(--blue-light); cursor: pointer; text-decoration: underline; }
.file-name { font-size: 0.8rem; margin-top: 6px; color: var(--text); font-weight: 500; }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 64px 32px;
    color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; opacity: 0.3; margin-bottom: 16px; }
.empty-state p { font-size: 1rem; }

/* ── Logo image ─────────────────────────────────────────────── */
.logo-img { height: 28px; display: block; }

/* ── Topbar user display ────────────────────────────────────── */
.topbar-user {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    margin-right: 10px;
}

/* ── Login page ─────────────────────────────────────────────── */
.login-body {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, var(--teal) 100%);
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
}
.login-wrap { width: 100%; max-width: 400px; padding: 24px; }
.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-header {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    margin-bottom: 28px; text-align: center;
}
.login-header svg { width: 36px; height: 36px; color: var(--blue); }
.login-header h1 { font-size: 1.4rem; font-weight: 700; }

/* ── Page title row (h1 + badge inline) ─────────────────────── */
.page-title-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.page-title-row h1 { font-size: 1.7rem; font-weight: 700; }

.page-header-meta {
    display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap;
}

.type-badge {
    background: #f1f5f9;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.78rem; font-weight: 500;
    padding: 3px 10px; border-radius: 20px;
}

/* ── Site stats row ─────────────────────────────────────────── */
.site-stats {
    display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.stat-block {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 24px; min-width: 110px; text-align: center;
}
.stat-number { font-size: 1.7rem; font-weight: 700; color: var(--blue); line-height: 1.1; }
.stat-label  { font-size: 0.73rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-top: 4px; }

/* ── Site card type tag ─────────────────────────────────────── */
.site-type-tag { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ── Form helpers ───────────────────────────────────────────── */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row-2, .form-row-3 { grid-template-columns: 1fr; } }

.form-group select {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--border); border-radius: 7px;
    font-size: 0.92rem; color: var(--text); background: var(--white);
    outline: none; transition: border-color 0.15s, box-shadow 0.15s;
    appearance: auto;
}
.form-group select:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(25,118,210,0.1);
}
.form-group input[type="number"] {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--border); border-radius: 7px;
    font-size: 0.92rem; color: var(--text); background: var(--white);
    outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input[type="number"]:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(25,118,210,0.1);
}

/* ── Hidden util ────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── View toggle ────────────────────────────────────────────── */
.view-toggle-bar {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
}
.view-btn {
    background: none; border: none; cursor: pointer;
    padding: 7px 10px; display: flex; align-items: center;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
}
.view-btn svg { width: 16px; height: 16px; display: block; }
.view-btn:hover  { background: var(--bg); color: var(--text); }
.view-btn.active { background: var(--blue); color: #fff; }
.view-btn + .view-btn { border-left: 1px solid var(--border); }

/* ── Site code pill (list view) ─────────────────────────────── */
.site-code-pill {
    display: inline-block;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.78rem; font-weight: 700;
    background: #dbeafe; color: #1e40af;
    padding: 2px 8px; border-radius: 4px;
    white-space: nowrap;
}

/* ── Sites list table row spacing ───────────────────────────── */
.sites-table td { padding: 12px 16px; }

/* ── Settings overview ──────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.settings-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--white);
    border: 1px solid var(--border); border-radius: 12px;
    padding: 20px; text-decoration: none; color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.settings-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-color: #bfdbfe; }
.settings-card-icon {
    width: 46px; height: 46px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.settings-card-icon svg { width: 24px; height: 24px; }
.icon-blue   { background: #dbeafe; color: var(--blue); }
.icon-teal   { background: #ccfbf1; color: #0d9488; }
.icon-purple { background: #ede9fe; color: #7c3aed; }
.icon-orange { background: #ffedd5; color: #c2410c; }
.icon-slate  { background: #f1f5f9; color: #475569; }
.settings-card-body { flex: 1; }
.settings-card-title { font-weight: 600; font-size: 0.95rem; }
.settings-card-sub   { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.settings-card-arrow { font-size: 1.4rem; color: var(--text-muted); }

/* ── Row actions (edit/delete buttons in table) ─────────────── */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ── Danger button ──────────────────────────────────────────── */
.btn-danger {
    display: inline-flex; align-items: center;
    background: #fee2e2; color: #b91c1c;
    padding: 8px 18px; border-radius: 8px;
    font-size: 0.9rem; font-weight: 500;
    border: 1px solid #fecaca; cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.btn-danger:hover { background: #fecaca; }

/* ── Inline reset form (users table) ───────────────────────── */
.inline-reset-form { display: flex; gap: 6px; align-items: center; }
.inline-input {
    padding: 5px 10px; border: 1px solid var(--border); border-radius: 7px;
    font-size: 0.85rem; outline: none; width: 160px;
    transition: border-color 0.15s;
}
.inline-input:focus { border-color: var(--blue-light); }

/* ── Vendor link ────────────────────────────────────────────── */
.vendor-link {
    color: var(--blue-light); text-decoration: none; font-weight: 600;
}
.vendor-link:hover { text-decoration: underline; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 500;
}
.modal-card {
    background: var(--white);
    border-radius: 12px;
    padding: 28px;
    width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

/* ── Page header row (title + action button side by side) ───── */
.page-header-row {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 20px;
}
.page-header-row .btn-secondary { flex-shrink: 0; margin-top: 4px; }

/* ── Form card ───────────────────────────────────────────────── */
.form-card {
    background: var(--white); border-radius: 12px;
    padding: 28px; border: 1px solid var(--border);
    margin-bottom: 24px;
}
.form-section-title {
    font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted);
    margin: 24px 0 14px;
}
.form-section-title:first-child { margin-top: 0; }

/* ── API key input with show/hide button ─────────────────────── */
.api-key-wrap {
    display: flex; gap: 8px; align-items: center;
}
.api-key-wrap input { flex: 1; }

/* ── Field hint ──────────────────────────────────────────────── */
.field-hint {
    font-size: 0.78rem; color: var(--text-muted); margin-top: 5px;
}
.field-hint a { color: var(--blue-light); }

/* ── Badge teal ──────────────────────────────────────────────── */
.badge-teal { background: #ccfbf1; color: #0d9488; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state svg {
    width: 48px; height: 48px; margin-bottom: 14px; opacity: 0.35;
    display: block; margin-left: auto; margin-right: auto;
}
.empty-state p { font-size: 0.9rem; }

/* ── Settings card muted variant ────────────────────────────── */
.settings-card-muted { opacity: 0.55; pointer-events: none; }

/* ── AAA placeholder ────────────────────────────────────────── */
.aaa-placeholder { text-align: center; padding: 16px 0; }
.aaa-placeholder svg { width: 48px; height: 48px; color: var(--text-muted); opacity: 0.4; margin-bottom: 14px; }
.aaa-placeholder h2 { font-size: 1.1rem; margin-bottom: 8px; }
.aaa-placeholder p  { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.aaa-options { display: flex; flex-direction: column; gap: 10px; text-align: left; margin-top: 20px; }
.aaa-option {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: #f8fafc;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 0.9rem; font-weight: 500;
}
.coming-soon { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); background: var(--border); padding: 2px 8px; border-radius: 20px; }
