*, *::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"],
.form-group input[type="password"] {
    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;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.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; }

/* ── Site Feed ──────────────────────────────────────────────── */
.feed-composer {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.composer-body { display: flex; gap: 12px; align-items: flex-start; }
.post-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem; color: #fff;
}
.composer-input-wrap { flex: 1; }
.composer-textarea {
    width: 100%; background: #0f172a; border: 1px solid #334155;
    border-radius: 10px; color: #e2e8f0; padding: 10px 14px;
    font-size: .9rem; resize: none; min-height: 72px;
    font-family: inherit; line-height: 1.5; transition: border-color .15s;
}
.composer-textarea:focus { outline: none; border-color: #2563eb; }
.composer-footer {
    display: flex; align-items: center;
    justify-content: space-between; margin-top: 10px;
}
.composer-attach {
    display: flex; align-items: center; gap: 6px;
    color: #64748b; font-size: .83rem; padding: 6px 10px;
    border-radius: 8px; cursor: pointer; transition: background .15s, color .15s;
    user-select: none;
}
.composer-attach:hover { background: #0f172a; color: #94a3b8; }
.img-preview-row {
    display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px;
}
.img-preview-thumb {
    width: 72px; height: 72px; object-fit: cover;
    border-radius: 8px; border: 2px solid #334155;
}

.feed-post {
    background: #1e293b; border: 1px solid #334155;
    border-radius: 14px; margin-bottom: 14px; overflow: hidden;
}
.post-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px 8px;
}
.post-meta { flex: 1; min-width: 0; }
.post-author { font-weight: 600; font-size: .9rem; color: #f1f5f9; }
.post-time { font-size: .75rem; color: #64748b; margin-top: 1px; }
.post-delete-btn {
    background: none; border: none; cursor: pointer;
    color: #475569; font-size: 1.3rem; padding: 2px 8px;
    border-radius: 6px; line-height: 1; flex-shrink: 0;
    transition: background .15s, color .15s;
}
.post-delete-btn:hover { background: #450a0a40; color: #f87171; }
.post-body {
    padding: 4px 16px 12px; font-size: .92rem;
    line-height: 1.65; white-space: pre-wrap; color: #e2e8f0;
}

/* Image grid */
.post-images { display: grid; gap: 2px; }
.post-images-1 { grid-template-columns: 1fr; max-height: 420px; }
.post-images-2 { grid-template-columns: 1fr 1fr; max-height: 280px; }
.post-images-3 { grid-template-columns: 1fr 1fr 1fr; max-height: 220px; }
.post-images-4 { grid-template-columns: 1fr 1fr; max-height: 280px; }
.post-image-link {
    position: relative; display: block;
    overflow: hidden; cursor: pointer;
}
.post-images-1 .post-image-link { max-height: 420px; }
.post-images-2 .post-image-link,
.post-images-4 .post-image-link { height: 280px; }
.post-images-3 .post-image-link { height: 220px; }
.post-image-link img {
    width: 100%; height: 100%; object-fit: cover;
    display: block; transition: transform .2s;
}
.post-image-link:hover img { transform: scale(1.04); }
.post-image-more {
    position: absolute; inset: 0; background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 700; color: #fff;
}

/* Comments */
.post-comments-section {
    border-top: 1px solid #1a2540;
    background: #111827;
    padding: 12px 16px;
}
.post-comments { margin-bottom: 10px; }
.post-comment {
    display: flex; align-items: flex-start;
    gap: 8px; margin-bottom: 8px;
}
.comment-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .72rem; color: #fff;
}
.comment-bubble {
    background: #1e293b; border-radius: 12px;
    padding: 7px 12px; flex: 1; min-width: 0;
}
.comment-author {
    font-weight: 600; font-size: .8rem; color: #94a3b8;
    margin-right: 6px;
}
.comment-body { font-size: .88rem; color: #e2e8f0; line-height: 1.5; }
.comment-time { font-size: .7rem; color: #475569; margin-top: 4px; }
.comment-delete-btn {
    background: none; border: none; cursor: pointer;
    color: #475569; font-size: 1rem; padding: 4px 6px;
    border-radius: 4px; align-self: flex-start; margin-top: 2px;
    transition: color .15s; flex-shrink: 0;
}
.comment-delete-btn:hover { color: #f87171; }
.comment-form {
    display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.comment-input-form {
    flex: 1; display: flex; align-items: center;
    background: #1e293b; border: 1px solid #334155;
    border-radius: 20px; padding: 6px 8px 6px 14px; gap: 6px;
    transition: border-color .15s;
}
.comment-input-form:focus-within { border-color: #2563eb; }
.comment-input {
    flex: 1; background: none; border: none;
    color: #e2e8f0; font-size: .88rem;
    outline: none; font-family: inherit;
}
.comment-input::placeholder { color: #475569; }
.comment-submit {
    background: none; border: none; cursor: pointer;
    color: #2563eb; padding: 4px; border-radius: 50%;
    display: flex; align-items: center;
    transition: background .15s;
}
.comment-submit:hover { background: #1e3a5f; }

/* ── Equipment status tabs ──────────────────────────────────── */
.status-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    margin-bottom: 16px; border-bottom: 1px solid #1e293b; padding-bottom: 0;
}
.status-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 8px 8px 0 0;
    font-size: .84rem; font-weight: 500; color: #64748b;
    text-decoration: none; border: 1px solid transparent;
    border-bottom: none; margin-bottom: -1px;
    transition: color .15s, background .15s;
}
.status-tab:hover { color: #94a3b8; background: #1e293b40; }
.status-tab.active {
    color: #e2e8f0; background: #1e293b;
    border-color: #334155; border-bottom-color: #1e293b;
}
.status-tab-count {
    background: #334155; color: #94a3b8;
    font-size: .72rem; padding: 1px 6px; border-radius: 10px;
}
.status-tab.active .status-tab-count { background: #0f172a; color: #60a5fa; }
.status-tab-green.active, .status-tab-green:hover { color: #4ade80; }
.status-tab-teal.active,  .status-tab-teal:hover  { color: #2dd4bf; }
.status-tab-red.active,   .status-tab-red:hover   { color: #f87171; }

/* ── Toggle switch ──────────────────────────────────────────── */
.toggle-switch {
    position: relative; display: inline-block;
    width: 40px; height: 22px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; cursor: pointer;
    background: #334155; border-radius: 22px;
    transition: background .2s;
}
.toggle-slider::before {
    content: ''; position: absolute;
    width: 16px; height: 16px; left: 3px; bottom: 3px;
    background: #94a3b8; border-radius: 50%;
    transition: transform .2s, background .2s;
}
.toggle-switch input:checked + .toggle-slider { background: #2563eb; }
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px); background: #fff;
}

/* ── 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; }

/* Dashboard additions */

/* ── Dashboard ──────────────────────────────────────────────── */
.dash-header {
    display: flex; align-items: flex-start;
    justify-content: space-between; flex-wrap: wrap;
    gap: 20px; margin-bottom: 32px;
}
.dash-header h1 { font-size: 1.65rem; font-weight: 700; }

.dash-stats {
    display: flex; gap: 12px; flex-wrap: wrap;
}
.dash-stat {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 20px;
    text-align: center; min-width: 90px;
}
.ds-num   { display: block; font-size: 1.6rem; font-weight: 700; color: var(--blue); line-height: 1.1; }
.ds-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-top: 2px; }

/* ── Widget grid ────────────────────────────────────────────── */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.widget-wide { grid-column: 1 / -1; }

@media (max-width: 768px) {
    .widget-grid { grid-template-columns: 1fr; }
    .widget-wide { grid-column: 1; }
}

/* ── Widget card ────────────────────────────────────────────── */
.widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.widget-head {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 1rem; font-weight: 600;
}
.widget-head svg { width: 20px; height: 20px; color: var(--blue); flex-shrink: 0; }
.widget-body { padding: 20px; flex: 1; }

/* ── Destination tabs ───────────────────────────────────────── */
.dest-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    background: var(--bg); border-radius: 8px;
    padding: 4px;
}
.dest-tab {
    flex: 1; padding: 6px 10px;
    border: none; border-radius: 6px;
    font-size: 0.82rem; font-weight: 500;
    cursor: pointer; color: var(--text-muted);
    background: transparent; transition: background 0.12s, color 0.12s;
    white-space: nowrap; min-width: 60px;
}
.dest-tab:hover  { background: rgba(255,255,255,0.7); color: var(--text); }
.dest-tab.active { background: var(--white); color: var(--blue); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* ── Util ───────────────────────────────────────────────────── */
.mt-8  { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; }
.mt-14 { margin-top: 14px !important; }
.w-full { width: 100%; }
.flex1  { flex: 1; }
.ml-auto { margin-left: auto; }

.input-btn-row {
    display: flex; gap: 8px;
}
.input-btn-row input { flex: 1; }

.btn-row {
    display: flex; gap: 8px; align-items: center;
}

.form-error {
    font-size: 0.83rem; color: #b91c1c;
    background: #fee2e2; border: 1px solid #fecaca;
    border-radius: 7px; padding: 8px 12px;
    margin-top: 8px;
}

/* ── Found item card ────────────────────────────────────────── */
.found-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 10px; overflow: hidden;
}
.found-card-inner {}
.fc-row {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 14px; border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.fc-row:last-child { border-bottom: none; }
.fc-label { width: 72px; font-size: 0.78rem; color: var(--text-muted); font-weight: 500; flex-shrink: 0; }

/* ── Widget success state ───────────────────────────────────── */
.widget-success {
    display: flex; flex-direction: column; align-items: center;
    padding: 24px 16px; text-align: center; gap: 8px;
}
.widget-success svg { width: 40px; height: 40px; color: #16a34a; }
.widget-success p   { font-size: 0.95rem; font-weight: 500; color: var(--text); }

/* ── My Vehicle widget ──────────────────────────────────────── */
.vehicle-active-card {
    display: flex; align-items: center; gap: 14px;
    background: #eff6ff; border: 1px solid #bfdbfe;
    border-radius: 10px; padding: 16px;
}
.vac-icon {
    width: 46px; height: 46px; border-radius: 10px;
    background: var(--blue); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.vac-icon svg { width: 26px; height: 26px; color: #fff; }
.vac-name { font-size: 1rem; font-weight: 600; }
.vac-desc { font-size: 0.83rem; color: var(--text-muted); margin-top: 2px; }

.no-vehicle-state {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; padding: 20px; color: var(--text-muted);
}
.no-vehicle-state svg { width: 40px; height: 40px; opacity: 0.3; }
.no-vehicle-state p   { font-size: 0.9rem; }

/* ── Port mapping ───────────────────────────────────────────── */
.pm-table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; }
.pm-table td { padding: 8px 12px; vertical-align: middle; }
.pm-table th { position: sticky; top: 0; z-index: 2; background: #f8fafc; }

.pm-input {
    width: 100%; padding: 5px 8px;
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 0.85rem; color: var(--text); background: var(--white);
    outline: none; transition: border-color 0.12s;
}
.pm-input:focus { border-color: var(--blue-light); }
.pm-vlan { max-width: 80px; }

.pm-save-btn {
    padding: 4px 10px; font-size: 0.8rem; font-weight: 500;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg); color: var(--text-muted);
    cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s;
    white-space: nowrap;
}
.pm-save-btn:hover { background: var(--white); color: var(--text); }
.pm-save-btn.dirty { background: #dbeafe; color: var(--blue); border-color: #93c5fd; }

.pm-footer {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 0 4px;
    border-top: 1px solid var(--border); margin-top: 12px;
}
.pm-save-status { font-size: 0.83rem; color: #16a34a; font-weight: 500; }

/* ── Badge extras ───────────────────────────────────────────── */
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-grey   { background: #f1f5f9; color: #64748b; }

/* Searchable Select + Quick Links additions */

/* ── Searchable Select ── */
.ss-wrap { position: relative; }
.ss-btn {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 8px 12px; gap: 8px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--white); font-size: 0.9rem; cursor: pointer;
    transition: border-color .12s, box-shadow .12s; text-align: left;
    font-family: inherit;
}
.ss-btn:hover:not(:disabled) { border-color: #94a3b8; }
.ss-btn:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21,101,192,.15); }
.ss-btn:disabled { opacity: .55; cursor: not-allowed; background: #f8fafc; }
.ss-btn svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted); }
.ss-val { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-drop {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 200; overflow: hidden;
}
.ss-search-wrap { padding: 8px; border-bottom: 1px solid var(--border); }
.ss-search {
    width: 100%; padding: 6px 10px; font-size: .875rem; box-sizing: border-box;
    border: 1px solid var(--border); border-radius: 6px;
    outline: none; background: #f8fafc; color: var(--text); font-family: inherit;
}
.ss-search:focus { border-color: var(--blue); background: var(--white); }
.ss-list { max-height: 220px; overflow-y: auto; }
.ss-opt {
    padding: 8px 12px; font-size: .9rem; cursor: pointer; color: var(--text);
    transition: background .08s;
}
.ss-opt:hover { background: #f1f5f9; }
.ss-opt.ss-selected { background: #eff6ff; color: var(--blue); font-weight: 500; }
.ss-empty { padding: 10px 12px; font-size: .875rem; color: var(--text-muted); text-align: center; }

/* ── Quick Links ── */
.quick-links {
    display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px;
}
.ql-card {
    flex: 1; min-width: 220px;
    display: flex; align-items: center; gap: 14px;
    background: var(--white); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px 18px;
    text-decoration: none; color: var(--text);
    transition: border-color .12s, box-shadow .12s, transform .1s;
}
.ql-card:hover { border-color: var(--blue); box-shadow: 0 4px 12px rgba(21,101,192,.12); transform: translateY(-1px); }
.ql-icon {
    width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.ql-icon svg { width: 22px; height: 22px; color: #fff; }
.ql-text { flex: 1; }
.ql-title { display: block; font-size: 0.95rem; font-weight: 600; }
.ql-sub   { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.ql-arrow { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

/* ── Vehicle Inventory page ── */
.veh-grid { display: flex; flex-direction: column; gap: 10px; }
.veh-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
}
.veh-card-btn {
    display: flex; align-items: center; gap: 14px;
    width: 100%; padding: 16px 20px;
    background: none; border: none; cursor: pointer;
    text-align: left; font-family: inherit;
    transition: background .1s;
}
.veh-card-btn:hover { background: #f8fafc; }
.veh-icon {
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--teal, #00796B); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.veh-icon svg { width: 24px; height: 24px; color: #fff; }
.veh-info { flex: 1; }
.veh-name { display: block; font-size: 1rem; font-weight: 600; }
.veh-desc { display: block; font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.veh-chevron { width: 18px; height: 18px; color: var(--text-muted); transition: transform .2s; flex-shrink: 0; }
.veh-items { border-top: 1px solid var(--border); }
.veh-loading { padding: 20px; text-align: center; color: var(--text-muted); font-size: .9rem; }
.veh-empty  { padding: 20px; text-align: center; color: var(--text-muted); font-size: .9rem; }
.veh-badge  { flex-shrink: 0; }
.widget { overflow: visible; }
.ss-list { max-height: min(500px, 60vh); }

/* Inventory redesign additions */

/* ── Page hero header ── */
.page-hero {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 14px; margin-bottom: 24px;
}
.page-title { font-size: 1.5rem; font-weight: 700; }

/* ── Filter bar ── */
.filter-bar {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-bottom: 18px; align-items: center;
}
.filter-search {
    flex: 1; min-width: 220px; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.9rem; color: var(--text); background: var(--white);
    outline: none; font-family: inherit;
}
.filter-search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21,101,192,.12); }
.filter-select {
    padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--white);
    font-size: 0.9rem; color: var(--text); font-family: inherit; cursor: pointer;
}

/* ── Table card ── */
.table-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
}
.td-empty { text-align: center; padding: 32px; color: var(--text-muted); }

/* ── Pagination ── */
.page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--white);
    font-size: 0.85rem; color: var(--text); text-decoration: none;
    transition: background .1s, border-color .1s;
}
.page-btn:hover { background: #f1f5f9; }
.page-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Modals ── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 16px;
}
.modal {
    background: var(--white); border-radius: 14px;
    width: 100%; max-width: 520px;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
    display: flex; flex-direction: column; overflow: hidden;
    max-height: 90vh;
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
    font-size: 1.05rem; font-weight: 600; flex-shrink: 0;
}
.modal-close {
    background: none; border: none; font-size: 1.1rem;
    cursor: pointer; color: var(--text-muted); padding: 4px 8px;
    border-radius: 6px; line-height: 1;
}
.modal-close:hover { background: #f1f5f9; color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px; border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ── Vehicle & tech inventory page ── */
.vi-tabs {
    display: flex; gap: 4px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 10px;
    padding: 4px; margin-bottom: 20px; width: fit-content;
}
.vi-tab {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; border: none; border-radius: 7px;
    font-size: 0.9rem; font-weight: 500; cursor: pointer;
    color: var(--text-muted); background: transparent;
    font-family: inherit; transition: background .12s, color .12s;
}
.vi-tab svg { width: 16px; height: 16px; }
.vi-tab:hover { background: rgba(255,255,255,.6); color: var(--text); }
.vi-tab.active { background: var(--white); color: var(--blue); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.vi-count {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 20px; padding: 1px 7px; font-size: 0.75rem;
    font-weight: 600; color: var(--text-muted);
}
.vi-tab.active .vi-count { background: #eff6ff; border-color: #bfdbfe; color: var(--blue); }

.vi-list { display: flex; flex-direction: column; gap: 10px; }
.vi-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
}
.vi-card-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 0;
}
.vi-expand-btn {
    display: flex; align-items: center; gap: 14px;
    flex: 1; padding: 10px 0 10px 16px;
    background: none; border: none; cursor: pointer;
    text-align: left; font-family: inherit;
}
.vi-expand-btn:hover .vi-info { color: var(--blue); }
.vi-icon {
    width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.vi-icon svg { width: 22px; height: 22px; color: #fff; }
.vi-info { flex: 1; text-align: left; }
.vi-name { display: block; font-size: 1rem; font-weight: 600; color: var(--text); }
.vi-desc { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 1px; }
.vi-chev { width: 18px; height: 18px; color: var(--text-muted); transition: transform .2s; flex-shrink: 0; }
.vi-actions { display: flex; gap: 6px; padding-right: 6px; flex-shrink: 0; }
.vi-items { border-top: 1px solid var(--border); }
.vi-loading, .vi-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: .9rem; }

.empty-state {
    text-align: center; padding: 48px 24px;
    color: var(--text-muted); font-size: 0.95rem;
    background: var(--white); border: 1px solid var(--border);
    border-radius: 12px;
}

.widget-grid{grid-template-columns:repeat(3,1fr)}
@media(max-width:1100px){.widget-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.widget-grid{grid-template-columns:1fr}}

.content{max-width:1400px;margin:0 auto;box-sizing:border-box}

.content{padding-top:calc(var(--nav-h, 60px) + 24px)}

/* ── Scan log (Add Equipment widget) ───────────────────────── */
.scan-log { margin: 6px 0 2px; padding: 8px 10px; background: var(--bg,#f1f5f9); border-radius: 6px; border: 1px solid var(--border,#e2e8f0); }
.scan-log-hdr { font-size:.75rem; color:var(--text-muted,#64748b); margin-bottom:4px; display:flex; justify-content:space-between; }
.scan-clear { color:var(--blue,#1565C0); text-decoration:none; font-size:.75rem; }
#addScanList { list-style:none; margin:0; padding:0; max-height:150px; overflow-y:auto; }
#addScanList li { font-size:.82rem; font-family:monospace; padding:2px 0; border-bottom:1px solid var(--border,#e2e8f0); }
#addScanList li:last-child { border-bottom:none; }
#addScanList .scan-ok  { color:#15803d; }
#addScanList .scan-err { color:#dc2626; }
.field-hint { font-size: .68rem; color: var(--text-muted, #64748b); margin-top: 3px; display: block; }

/* ── Port mapping unit SearchableSelect ──────────────────── */
.ss-compact .ss-btn { font-size:.78rem; padding:3px 8px; min-height:28px; }
.ss-compact .ss-drop { font-size:.78rem; min-width:210px; z-index:9999; }
.ss-compact .ss-list { max-height:200px; }
.td-unit { overflow:visible !important; position:relative; min-width:160px; }
.pm-table-wrap { overflow:visible !important; }

/* ── Port mapping unit dropdown: fill cell width ─────────────── */
.ss-compact { width: 100%; }
.ss-compact .ss-btn { width: 100%; box-sizing: border-box; text-align: left; }

/* ── Port mapping table column sizing ────────────────────────── */
#pmTable table { table-layout: fixed; width: 100%; }
#pmTable table th:nth-child(1),
#pmTable table td:nth-child(1) { width: 100px; }
#pmTable table th:nth-child(2),
#pmTable table td:nth-child(2) { width: 80px; }
#pmTable table th:nth-child(3),
#pmTable table td:nth-child(3) { width: auto; }
#pmTable table th:nth-child(4),
#pmTable table td:nth-child(4) { width: 110px; }
#pmTable table th:nth-child(5),
#pmTable table td:nth-child(5) { width: 70px; }
.td-unit { overflow: visible !important; position: relative; }
.pm-input.pm-vlan { width: 100%; box-sizing: border-box; }

/* ── Port mapping table: fixed column widths ─────────────────── */
.pm-table { table-layout: fixed; width: 100%; }
.pm-table th:nth-child(1), .pm-table td:nth-child(1) { width: 100px; }
.pm-table th:nth-child(2), .pm-table td:nth-child(2) { width: 80px; }
.pm-table th:nth-child(3), .pm-table td:nth-child(3) { }
.pm-table th:nth-child(4), .pm-table td:nth-child(4) { width: 110px; }
.pm-table th:nth-child(5), .pm-table td:nth-child(5) { width: 70px; }

/* Fix: remove max-height so table overflows cleanly and footer stays below */
.pm-table-wrap { max-height: none !important; }
