/* ============================================================================
   Design system — dark theme, canonical source of truth for every template.

   Every page should link this file and rely on it for: tokens (:root),
   .ops-header/.ops-nav/.ops-nav-item, .page-content (+ --narrow/--wide),
   .page-header, .card/.card-header/.card-body, .btn + variants, .badge +
   variants, .filter-bar, .stats-grid/.stat-item, .form-group, .devices-table.
   Pages should only define their own inline <style> for genuinely
   page-specific things (a Leaflet map, a drawer panel, a generator form
   flow) — not by re-declaring any of the above. See CLAUDE.md's Frontend
   Notes section for the do/don't list this enforces.

   --font-mono leads with IBM Plex Mono (loaded below) rather than a generic
   system-mono stack — deliberate: this app's actual content is IP addresses,
   MACs, and numeric telemetry (RSSI/frequency/capacity), and Plex Mono's
   strong 0/O and 1/l/I disambiguation plus real engineering-instrument
   character reads as a network tool built for this, not a generic
   admin-dashboard template. --font-ui pairs it with IBM Plex Sans (same type
   family, designed together) rather than the OS default — one deliberate
   voice across chrome and data instead of "data font + whatever the OS gives
   us".
   ============================================================================ */

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

:root {
    /* Surfaces */
    --color-bg-app: #0f1419;
    --color-bg-surface: #1a1f26;
    --color-bg-hover: #252a31;
    --color-border: #2d3339;

    /* Text */
    --color-text-primary: #e6edf3;
    --color-text-secondary: #8b949e;
    --color-text-tertiary: #6e7681;

    /* Accents — two deliberate roles, not decoration:
       blue = interactive/actionable (buttons, links, active nav, focus rings)
       cyan = live telemetry values (stat tiles, RSSI/frequency/capacity readouts) */
    --color-data-blue: #58a6ff;
    --color-data-cyan: #39c5cf;

    /* Status */
    --color-status-success: #3fb950;
    --color-status-warning: #d29922;
    --color-status-error: #f85149;
    --color-status-neutral: #6e7681;

    /* Type */
    --font-ui: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-lg: 16px;
    --text-xl: 20px;
    --text-2xl: 24px;

    /* Space */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;

    --border-subtle: 1px solid var(--color-border);
    --radius-card: 8px;
    --radius-control: 5px;

    /* Page-content width tiers — see .page-content--narrow / --wide */
    --page-max-width: 1200px;
    --sidebar-width: 240px;
}

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

body {
    font-family: var(--font-ui);
    font-size: var(--text-base);
    background: var(--color-bg-app);
    color: var(--color-text-primary);
    min-height: 100vh;
}

.container {
    background: var(--color-bg-app);
}

/* ---- Links (no shared rule existed before — bare <a> tags fell back to
   browser-default blue/purple, invisible against the dark theme) ---- */
a { color: var(--color-data-blue); }
a:visited { color: var(--color-data-blue); }
a:hover { opacity: 0.85; }

/* ---- Keyboard focus (quality floor — was absent everywhere) ---- */
:focus-visible {
    outline: 2px solid var(--color-data-blue);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---- Nav / header ---- */
.ops-header {
    background: var(--color-bg-surface);
    border-bottom: var(--border-subtle);
    padding: var(--space-3) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}
.ops-header-brand { display: flex; align-items: center; gap: var(--space-3); }
.ops-logo { height: 32px; filter: brightness(0) invert(1); }
.ops-title { color: var(--color-text-primary); font-size: var(--text-lg); font-weight: 600; }
.ops-subtitle { color: var(--color-text-tertiary); font-size: var(--text-xs); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.5px; }

.ops-nav { display: flex; gap: var(--space-1); align-items: center; }
.ops-nav-item {
    padding: var(--space-2) var(--space-3);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.ops-nav-item:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.ops-nav-item.active { background: rgba(88, 166, 255, 0.1); color: var(--color-data-blue); }
.ops-nav-item.logout { color: var(--color-status-error); }
.ops-nav-item.logout:hover { background: rgba(248, 81, 73, 0.1); }

/* ---- Sidebar nav — opt-in via body.has-ops-sidebar, so pages that haven't
   migrated off the top .ops-header keep working untouched. Left rail on
   desktop; collapses to an off-canvas drawer on mobile behind a slim top
   bar, same show/hide/overlay pattern as map.html's .site-list-panel. ---- */
.ops-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--color-bg-surface);
    border-right: var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 2000;
    transition: transform 0.2s ease;
}
.ops-sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: var(--border-subtle);
    flex-shrink: 0;
}
.ops-sidebar-brand .ops-logo { height: 26px; flex-shrink: 0; }
.ops-sidebar-brand .ops-title { font-size: var(--text-base); line-height: 1.3; }
.ops-sidebar .ops-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: var(--space-3);
    flex: 1;
}
.ops-sidebar .ops-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px var(--space-3);
    min-height: 44px;
    font-size: var(--text-base);
    border-radius: var(--radius-control);
}
.ops-sidebar .ops-nav-item.logout {
    margin-top: var(--space-2);
    border-top: var(--border-subtle);
    padding-top: 14px;
}
.ops-nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.ops-mobile-bar {
    display: none;
    align-items: center;
    gap: var(--space-3);
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--color-bg-surface);
    border-bottom: var(--border-subtle);
    padding: 0 var(--space-3);
    z-index: 1980;
}
.ops-mobile-brand { color: var(--color-text-primary); font-weight: 600; font-size: var(--text-base); }
.ops-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: 22px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
}
.ops-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1990;
}
.ops-sidebar-overlay.active { display: block; }

body.has-ops-sidebar { padding-left: var(--sidebar-width); transition: padding-left 0.2s ease; }
.ops-sidebar { transition: transform 0.2s ease, width 0.2s ease; overflow-x: hidden; }

/* Desktop collapse (static/js/sidebar.js toggles html.ops-collapsed, saved in localStorage):
   the rail shrinks to icons only. Labels are bare text nodes after .ops-nav-icon, so they're
   hidden with font-size: 0 on the item rather than needing a wrapper in every template. */
.ops-sidebar-brand { position: relative; }
/* Pinned to the logo row's top-right corner: inline it would squeeze the title to ~70px and
   break "INFRASTRUCTURE" mid-word. */
.ops-collapse-btn {
    position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; border-radius: var(--radius-control);
    color: var(--color-text-tertiary); font-size: 15px; line-height: 1; cursor: pointer;
}
.ops-collapse-btn:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
@media (min-width: 769px) {
    html.ops-collapsed { --sidebar-width: 64px; }
    html.ops-collapsed .ops-sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
    html.ops-collapsed .ops-sidebar-brand > :not(.ops-collapse-btn) { display: none; }
    html.ops-collapsed .ops-collapse-btn { position: static; width: 32px; height: 32px; border: var(--border-subtle); transform: rotate(180deg); }
    html.ops-collapsed .ops-sidebar .ops-nav { padding-left: var(--space-2); padding-right: var(--space-2); }
    html.ops-collapsed .ops-sidebar .ops-nav-item { font-size: 0; justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
}
@media (max-width: 768px) { .ops-collapse-btn { display: none; } }

@media (max-width: 768px) {
    body.has-ops-sidebar { padding-left: 0; padding-top: 56px; }
    .ops-mobile-bar { display: flex; }
    .ops-sidebar-toggle { display: flex; }
    .ops-sidebar {
        top: 56px;
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    }
    .ops-sidebar.mobile-open { transform: translateX(0); }

    /* Full-height flex layouts (map pages) need to shrink by the mobile bar,
       since body's padding-top pushes them down but height:100vh doesn't know that */
    body.has-ops-sidebar .map-container { height: calc(100vh - 56px); }
}

/* ---- Page shell ---- */
.page-content {
    max-width: var(--page-max-width);
    margin: 0 auto;
    padding: var(--space-6);
}
.page-content--narrow { --page-max-width: 860px; }
.page-content--wide { --page-max-width: 1400px; }

.page-header { margin-bottom: var(--space-6); }
.page-header h1 { font-size: var(--text-xl); font-weight: 600; margin-bottom: 4px; }
.page-header p { color: var(--color-text-secondary); font-size: var(--text-sm); }

/* ---- Cards ---- */
.card {
    background: var(--color-bg-surface);
    border: var(--border-subtle);
    border-radius: var(--radius-card);
    margin-bottom: var(--space-6);
}

.card h2 {
    color: var(--color-text-primary);
    font-size: var(--text-base);
    font-weight: 600;
    padding: var(--space-4) var(--space-6);
    border-bottom: var(--border-subtle);
}

.card-header {
    padding: var(--space-4) var(--space-6);
    border-bottom: var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
}
.card-header h2 { font-size: var(--text-base); font-weight: 600; padding: 0; border: none; }
.card-body { padding: var(--space-4) var(--space-6); }

/* ---- Filter bar ---- */
.filter-bar { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.filter-bar input {
    flex: 1;
    min-width: 200px;
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-app);
    border: var(--border-subtle);
    border-radius: 4px;
    color: var(--color-text-primary);
    font-size: var(--text-sm);
}
.filter-bar input:focus { outline: none; border-color: var(--color-data-blue); }

.result-count { font-size: var(--text-xs); color: var(--color-text-tertiary); font-family: var(--font-mono); white-space: nowrap; }

/* ---- Forms ---- */
.form-group { margin-bottom: var(--space-4); }
.form-group:last-child { margin-bottom: 0; }

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 40px;
    padding: 10px var(--space-3);
    background: var(--color-bg-app);
    border: var(--border-subtle);
    border-radius: 4px;
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    font-family: var(--font-ui);
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-data-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.button-group { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.action-row { display: flex; gap: var(--space-2); margin-top: var(--space-6); flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn {
    padding: 10px var(--space-4);
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary  { background: var(--color-data-blue); color: var(--color-bg-app); border-color: var(--color-data-blue); }
.btn-success  { background: var(--color-status-success); color: var(--color-bg-app); border-color: var(--color-status-success); }
.btn-info     { background: var(--color-data-blue); color: var(--color-bg-app); border-color: var(--color-data-blue); }
.btn-warning  { background: var(--color-status-warning); color: var(--color-bg-app); border-color: var(--color-status-warning); }
.btn-danger   { background: transparent; color: var(--color-status-error); border-color: rgba(248, 81, 73, 0.4); }
.btn-danger:hover { background: rgba(248, 81, 73, 0.1); opacity: 1; }
.btn-secondary { background: transparent; color: var(--color-text-secondary); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-bg-hover); color: var(--color-text-primary); opacity: 1; }

/* ---- Badges — one component, replaces every ad-hoc pill in the app ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: var(--text-xs);
    font-weight: 600;
    font-family: var(--font-mono);
    white-space: nowrap;
    line-height: 1.6;
}
/* Dot indicator is opt-in (.badge-dot), not default — most badges in this app are
   plain colored labels (STATIC, a link type, a status word); reserve the dot for
   genuine "live status" indicators (e.g. a service running/stopped). */
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.badge-success { background: rgba(63, 185, 80, 0.15); color: var(--color-status-success); }
.badge-warning { background: rgba(210, 153, 34, 0.15); color: var(--color-status-warning); }
.badge-error   { background: rgba(248, 81, 73, 0.15); color: var(--color-status-error); }
.badge-info    { background: rgba(88, 166, 255, 0.15); color: var(--color-data-blue); }
.badge-live    { background: rgba(57, 197, 207, 0.15); color: var(--color-data-cyan); }
.badge-neutral { background: rgba(110, 118, 129, 0.15); color: var(--color-text-tertiary); }

/* ---- Tables ---- */
.devices-table { width: 100%; border-collapse: collapse; }
.devices-table thead { background: var(--color-bg-hover); }
.devices-table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: var(--border-subtle);
}
.devices-table tbody tr { border-bottom: var(--border-subtle); transition: background 0.15s; }
.devices-table tbody tr:last-child { border-bottom: none; }
.devices-table tbody tr:hover { background: var(--color-bg-hover); }
.devices-table td { padding: var(--space-3) var(--space-4); color: var(--color-text-primary); font-size: var(--text-sm); }
.devices-table tr[onclick] { cursor: pointer; }

/* Data cells (IPs, MACs, hex, numeric telemetry) get the mono signature */
.data-cell, .devices-table .mono, td.mono { font-family: var(--font-mono); }

/* ---- Device cards ---- */
.device-card {
    background: var(--color-bg-hover);
    border: var(--border-subtle);
    border-radius: 6px;
    padding: var(--space-4);
    transition: border-color 0.15s;
}
.device-card:hover { border-color: var(--color-data-blue); }
.device-card h3 { color: var(--color-data-blue); margin-bottom: var(--space-2); font-size: var(--text-base); }
.device-card p { color: var(--color-text-secondary); font-size: var(--text-sm); margin: 2px 0; }
.device-card .device-ip { font-weight: 600; color: var(--color-text-primary); font-family: var(--font-mono); }

/* ---- Status output / log viewer ---- */
.status-output {
    background: var(--color-bg-app);
    border: var(--border-subtle);
    border-radius: 4px;
    padding: var(--space-3);
    max-height: 400px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    line-height: 1.6;
}
.status-output div { padding: 2px 0; color: var(--color-text-secondary); }
.status-output div:hover { background: var(--color-bg-hover); }

.log-line { padding: 2px 0; line-height: 1.5; }
.log-error   { color: var(--color-status-error); font-weight: 500; }
.log-warning { color: var(--color-status-warning); font-weight: 500; }
.log-info    { color: var(--color-status-success); }
.log-debug   { color: var(--color-text-tertiary); }

/* ---- Stats / KPI tiles — left-border accent, cyan for live values ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}
.stat-item, .stat-card {
    background: var(--color-bg-app);
    border: var(--border-subtle);
    border-left: 3px solid var(--color-data-cyan);
    border-radius: 6px;
    padding: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
}
.stat-label { font-weight: 500; color: var(--color-text-secondary); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.4px; }
.stat-value { font-size: var(--text-2xl); font-weight: 700; color: var(--color-data-cyan); font-family: var(--font-mono); }

/* ---- Site grouping ---- */
.devices-grouped { display: flex; flex-direction: column; gap: var(--space-4); }
.site-group { border: var(--border-subtle); border-radius: 6px; overflow: hidden; }
.site-header {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
    border-bottom: var(--border-subtle);
}
.site-header:hover { background: var(--color-border); }
.site-stats { font-size: var(--text-xs); color: var(--color-text-secondary); }
.toggle-icon { font-size: var(--text-xs); color: var(--color-text-tertiary); margin-left: 8px; }
.site-devices { padding: 0; }
.site-devices .devices-table { margin: 0; border-radius: 0; }

/* ---- Modal (shared overlay + centered box) ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2100; /* above .ops-sidebar (2000), which sits above Leaflet (1000) */
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--color-bg-surface);
    border: var(--border-subtle);
    border-radius: var(--radius-card);
    padding: var(--space-6);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-box h3 { font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--space-4); }
.modal-error {
    display: none;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: var(--color-status-error);
    border-radius: 5px;
    padding: 8px 12px;
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}
.modal-error.show { display: block; }

/* ---- Alerts (inline, non-modal status messages) ---- */
.alert { padding: 10px 14px; border-radius: 5px; font-size: var(--text-sm); margin-bottom: var(--space-4); display: none; }
.alert.show { display: block; }
.alert-success { background: rgba(63, 185, 80, 0.1); border: 1px solid rgba(63, 185, 80, 0.3); color: var(--color-status-success); }
.alert-error   { background: rgba(248, 81, 73, 0.1); border: 1px solid rgba(248, 81, 73, 0.3); color: var(--color-status-error); }
.alert-info    { background: rgba(88, 166, 255, 0.1); border: 1px solid rgba(88, 166, 255, 0.3); color: var(--color-data-blue); }

/* ---- Misc ---- */
.text-muted { color: var(--color-text-tertiary); text-align: center; padding: var(--space-6); font-size: var(--text-sm); }

.ospf-path {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--color-bg-hover);
    border: var(--border-subtle);
    border-radius: 4px;
    display: none;
}
.ospf-path.active { display: block; }
.ospf-path h3 { color: var(--color-data-blue); margin-bottom: var(--space-2); font-size: var(--text-base); }
.ospf-path .path { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0; flex-wrap: wrap; }
.ospf-path .path-node { background: var(--color-data-blue); color: var(--color-bg-app); padding: var(--space-2) var(--space-3); border-radius: 4px; font-weight: 600; font-size: var(--text-sm); font-family: var(--font-mono); }
.ospf-path .path-arrow { font-size: 18px; color: var(--color-text-tertiary); }

.scan-state {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--color-bg-hover);
    border: var(--border-subtle);
    border-radius: 4px;
    font-size: var(--text-sm);
    display: none;
}
.scan-state.active { display: block; }
.scan-state .state-item { margin: 4px 0; color: var(--color-text-secondary); }

.ip-count { color: var(--color-data-blue); font-size: var(--text-xs); font-weight: 600; }

.device-ips-row { background: var(--color-bg-hover); }
.device-ips-detail {
    padding: var(--space-4);
    background: var(--color-bg-surface);
    border: var(--border-subtle);
    border-radius: 4px;
    margin: var(--space-2) var(--space-4);
}
.device-ips-detail ul { list-style: none; margin-top: var(--space-2); }
.device-ips-detail li { padding: 3px 0; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-secondary); }

.clear-options { margin-top: var(--space-6); padding-top: var(--space-6); border-top: var(--border-subtle); }
.clear-options h3 { color: var(--color-status-error); margin-bottom: var(--space-3); font-size: var(--text-base); }

/* ---- Animations ---- */
@keyframes spin { to { transform: rotate(360deg); } }
.loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(88, 166, 255, 0.3);
    border-top-color: var(--color-data-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: var(--space-2);
    vertical-align: middle;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .ops-header { flex-wrap: wrap; gap: var(--space-2); padding: var(--space-2) var(--space-3); }
    .ops-nav { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
    .ops-nav::-webkit-scrollbar { display: none; }
    .ops-nav-item { white-space: nowrap; padding: 5px 8px; font-size: 12px; }

    .page-content { padding: var(--space-3); }

    .card h2 { padding: var(--space-3); }
    .card-header { padding: var(--space-3); }
    .card-body { padding: var(--space-3); }

    .site-group { overflow: visible; }
    .site-devices { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .devices-table { min-width: 520px; }

    .site-header { flex-direction: column; align-items: flex-start; gap: 4px; }

    .form-row { grid-template-columns: 1fr; }
    .button-group { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

@media (max-width: 480px) {
    .ops-subtitle { display: none; }
    .ops-logo { height: 24px; }
    .stats-grid { grid-template-columns: 1fr; }
}
