/* =========================================================
   WardVault Theme
   ========================================================= */

:root {
    color-scheme: dark;

    --background: #0b0f14;
    --sidebar: #10161e;
    --surface: #151c25;
    --surface-hover: #1a2430;
    --border: #263241;
    --border-hover: #344457;

    --text: #f1f5f9;
    --muted: #94a3b8;

    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.12);

    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.08);

    --danger: #f87171;
    --danger-soft: rgba(239, 68, 68, 0.08);

    --content-width: 900px;

    --radius-small: 8px;
    --radius-medium: 10px;
    --radius-large: 14px;

    --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.18);
}


/* =========================================================
   Base
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    background: var(--background);
    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.5;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}


/* =========================================================
   Main Layout
   ========================================================= */

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
    padding: 28px 20px;

    background: var(--sidebar);
    border-right: 1px solid var(--border);
}

.content {
    min-width: 0;
    padding: 38px;
}


/* =========================================================
   Branding
   ========================================================= */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 36px;
}

.brand-icon {
    width: 42px;
    height: 42px;

    display: grid;
    flex-shrink: 0;
    place-items: center;

    background: var(--accent-soft);
    color: var(--accent);

    border-radius: 12px;

    font-size: 22px;
}

.brand-name {
    margin: 0;
    font-size: 20px;
}

.brand-subtitle {
    margin: 3px 0 0;

    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   Navigation
   ========================================================= */

.navigation {
    display: grid;
    gap: 8px;
}

.mobile-menu-toggle {
    display: none;
}

.nav-item {
    display: grid;
    align-items: center;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 11px;

    min-height: 46px;
    padding: 11px 14px;

    color: var(--muted);
    text-decoration: none;

    border-radius: 9px;

    font-size: 14px;
    font-weight: 600;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.nav-item span:first-child {
    display: grid;
    place-items: center;

    width: 24px;
    height: 24px;

    font-size: 18px;
    line-height: 1;
}

.nav-item span:last-child {
    min-width: 0;

    overflow: hidden;

    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.logout-item {
    margin-top: 18px;
}


/* =========================================================
   Page Headers
   ========================================================= */

.page-header {
    max-width: var(--content-width);
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 0 0 8px;

    font-size: 30px;
    line-height: 1.2;
}

.page-header p {
    margin: 0;

    color: var(--muted);
}


/* =========================================================
   Breadcrumbs
   ========================================================= */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;

    max-width: var(--content-width);
    margin-bottom: 18px;

    color: var(--muted);

    font-size: 13px;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}


/* =========================================================
   Dashboard Statistics
   ========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 20px;

    max-width: var(--content-width);
}

.stat-card {
    padding: 24px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-card);
}

.stat-label {
    margin: 0 0 12px;

    color: var(--muted);

    font-size: 14px;
}

.stat-value {
    margin: 0;

    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
}

.stat-detail {
    margin: 10px 0 0;

    color: var(--muted);

    font-size: 13px;
}

.dashboard-insights {
    display: grid;
    align-items: stretch;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 20px;

    max-width: var(--content-width);
    margin-top: 20px;
}

.insight-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-card);
}

.insight-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    margin-bottom: 18px;
}

.insight-header h2 {
    margin: 0;

    font-size: 19px;
    line-height: 1.2;
}

.insight-total {
    flex-shrink: 0;
    padding: 6px 10px;

    background: rgba(148, 163, 184, 0.08);
    color: var(--muted);

    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;
}

.device-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    flex: 1;
    align-content: stretch;

    margin-top: 4px;
}

.device-category-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: inherit;
    min-width: 0;
    padding: 13px 14px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.03),
            rgba(255, 255, 255, 0)
        ),
        rgba(148, 163, 184, 0.06);

    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius-medium);

    text-decoration: none;

    transition:
        border-color 0.2s ease,
        filter 0.2s ease,
        transform 0.15s ease;
}

.device-category-tile:hover {
    border-color: var(--border-hover);

    filter: brightness(1.06);
    transform: translateY(-1px);
}

.device-category-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;

    color: var(--muted);
    font-size: 12px;
}

.device-category-heading span:last-child {
    min-width: 0;
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-category-value {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;

    margin-top: 8px;
}

.device-category-value strong {
    color: var(--text);
    font-size: 22px;
    line-height: 1.05;
}

.device-category-value small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.device-category-meter {
    overflow: hidden;

    height: 5px;
    margin-top: 11px;

    background: rgba(11, 15, 20, 0.42);

    border-radius: 999px;
}

.device-category-meter span {
    display: block;
    min-width: 3px;
    height: 100%;
}

.category-tile-router,
.category-tile-network {
    background:
        linear-gradient(
            180deg,
            rgba(56, 189, 248, 0.1),
            rgba(56, 189, 248, 0.03)
        ),
        var(--surface);

    border-color: rgba(56, 189, 248, 0.22);
}

.category-tile-extender {
    background:
        linear-gradient(
            180deg,
            rgba(34, 197, 94, 0.1),
            rgba(34, 197, 94, 0.03)
        ),
        var(--surface);

    border-color: rgba(34, 197, 94, 0.22);
}

.category-tile-iot {
    background:
        linear-gradient(
            180deg,
            rgba(250, 204, 21, 0.1),
            rgba(250, 204, 21, 0.03)
        ),
        var(--surface);

    border-color: rgba(250, 204, 21, 0.22);
}

.category-tile-printer {
    background:
        linear-gradient(
            180deg,
            rgba(45, 212, 191, 0.1),
            rgba(45, 212, 191, 0.03)
        ),
        var(--surface);

    border-color: rgba(45, 212, 191, 0.22);
}

.category-tile-phone,
.category-tile-computer {
    background:
        linear-gradient(
            180deg,
            rgba(168, 85, 247, 0.1),
            rgba(168, 85, 247, 0.03)
        ),
        var(--surface);

    border-color: rgba(168, 85, 247, 0.22);
}

.category-tile-vehicle,
.category-tile-wearable {
    background:
        linear-gradient(
            180deg,
            rgba(244, 114, 182, 0.1),
            rgba(244, 114, 182, 0.03)
        ),
        var(--surface);

    border-color: rgba(244, 114, 182, 0.2);
}

.mix-dot {
    width: 10px;
    height: 10px;

    border-radius: 50%;
}

.security-metrics {
    display: grid;
    gap: 10px;
}

.security-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    color: inherit;
    min-width: 0;
    padding: 11px 12px;

    background: rgba(148, 163, 184, 0.07);

    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius-small);

    text-decoration: none;

    transition:
        border-color 0.2s ease,
        filter 0.2s ease,
        transform 0.15s ease;
}

.security-metric:hover {
    border-color: var(--border-hover);

    filter: brightness(1.06);
    transform: translateY(-1px);
}

.security-metric span {
    overflow: hidden;

    color: var(--muted);

    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.security-metric strong {
    color: var(--text);
    font-size: 18px;
}

.security-wps,
.security-open,
.security-wep {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.22);
}

.security-wpa3 {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.22);
}

.security-wpa2,
.security-wpa {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.2);
}


/* =========================================================
   Status Panel
   ========================================================= */

.status-panel {
    display: flex;
    align-items: center;
    gap: 12px;

    max-width: var(--content-width);
    margin-top: 20px;
    padding: 20px 24px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-card);
}

.status-indicator {
    width: 10px;
    height: 10px;

    flex-shrink: 0;

    background: var(--success);

    border-radius: 50%;

    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
}

.status-panel strong {
    display: block;
}

.status-panel span {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================================
   Authentication
   ========================================================= */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: clamp(36px, 8vh, 86px) clamp(22px, 6vw, 84px);

    background:
        linear-gradient(
            135deg,
            rgba(56, 189, 248, 0.1),
            transparent 34%
        ),
        linear-gradient(
            315deg,
            rgba(34, 197, 94, 0.07),
            transparent 38%
        ),
        repeating-linear-gradient(
            90deg,
            rgba(148, 163, 184, 0.045) 0,
            rgba(148, 163, 184, 0.045) 1px,
            transparent 1px,
            transparent 72px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(148, 163, 184, 0.035) 0,
            rgba(148, 163, 184, 0.035) 1px,
            transparent 1px,
            transparent 72px
        ),
        var(--background);
}

.auth-shell {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: clamp(28px, 6vw, 76px);

    width: min(100%, 960px);
}

.auth-copy {
    min-width: 0;
}

.auth-brand {
    margin-bottom: 22px;
}

.auth-brand-icon {
    width: 54px;
    height: 54px;

    border: 1px solid rgba(56, 189, 248, 0.34);

    font-size: 29px;
}

.auth-title {
    font-size: 28px;
    line-height: 1.1;
}

.auth-lede {
    max-width: 480px;
    margin: 0;

    color: var(--muted);

    font-size: 18px;
    line-height: 1.6;
}

.auth-panel {
    position: relative;

    overflow: hidden;
    padding: clamp(28px, 5vw, 42px);

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.04),
            rgba(255, 255, 255, 0)
        ),
        var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.3),
        var(--shadow-card);
}

.auth-panel::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;

    height: 3px;

    background: linear-gradient(
        90deg,
        var(--accent),
        var(--success)
    );

    content: "";
}

.auth-header {
    margin-bottom: 24px;
}

.auth-header p {
    margin: 0 0 8px;

    color: var(--accent);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-header h2 {
    margin: 0;

    font-size: 28px;
    line-height: 1.15;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field span {
    color: var(--muted);

    font-size: 13px;
    font-weight: 650;
}

.auth-field input {
    width: 100%;
    height: 50px;
    min-width: 0;
    padding: 0 15px;

    background: var(--background);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.auth-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-error {
    margin: 0;
    padding: 11px 12px;

    background: var(--danger-soft);
    color: var(--danger);

    border: 1px solid rgba(248, 113, 113, 0.28);
    border-radius: var(--radius-small);

    font-size: 13px;
}

.auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 50px;
    margin-top: 4px;
    padding: 12px 16px;

    background: var(--accent);
    color: #05111a;

    border: 0;
    border-radius: var(--radius-medium);

    cursor: pointer;
    font-weight: 700;

    transition:
        filter 0.2s ease,
        transform 0.2s ease;
}

.auth-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

@media (max-width: 760px) {
    .auth-body {
        align-items: flex-start;
        padding: 34px 18px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        gap: 24px;
        width: min(100%, 480px);
    }

    .auth-lede {
        font-size: 15px;
    }

    .auth-panel {
        border-radius: var(--radius-medium);
    }
}


/* =========================================================
   Forms and Search
   ========================================================= */

.search-form {
    display: flex;
    gap: 10px;

    max-width: var(--content-width);
    margin-bottom: 16px;
}

.search-input {
    min-width: 0;
    flex: 1;

    padding: 13px 15px;

    background: var(--surface);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-button,
.clear-button {
    padding: 13px 18px;

    border-radius: var(--radius-medium);

    font-weight: 600;
    text-decoration: none;

    cursor: pointer;
}

.search-button {
    background: var(--accent);
    color: #041019;

    border: 0;

    transition:
        filter 0.2s ease,
        transform 0.15s ease;
}

.search-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.clear-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--surface);
    color: var(--muted);

    border: 1px solid var(--border);

    transition:
        border-color 0.2s ease,
        color 0.2s ease;
}

.clear-button:hover {
    color: var(--text);
    border-color: var(--muted);
}

.results-summary {
    max-width: var(--content-width);
    margin-bottom: 18px;

    color: var(--muted);

    font-size: 14px;
}


/* =========================================================
   Shared Buttons and Actions
   ========================================================= */

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 8px 14px;

    background: var(--surface);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: var(--radius-small);

    font-size: 13px;
    font-weight: 600;
    text-decoration: none;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.action-link:hover {
    border-color: var(--accent);
    color: var(--accent);

    transform: translateY(-1px);
}

.action-link.secondary {
    background: transparent;
}

.action-link.danger {
    background: var(--danger-soft);
    color: var(--danger);

    border-color: rgba(248, 113, 113, 0.5);
}

.action-link.danger:hover {
    background: rgba(248, 113, 113, 0.16);
    border-color: var(--danger);
    color: var(--danger);
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 18px;
}

.session-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;

    max-width: var(--content-width);
    margin-top: 24px;
}

.session-actions form {
    margin: 0;
}


/* =========================================================
   Device List
   ========================================================= */

.device-list {
    display: grid;
    gap: 10px;

    width: 100%;
    max-width: var(--content-width);
    min-width: 0;
}

.device-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;

    width: 100%;
    min-width: 0;
    padding: 18px 20px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 12px;

    box-shadow: var(--shadow-card);

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}

.device-row:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);

    transform: translateY(-1px);
}

.device-row-link {
    color: inherit;
    text-decoration: none;
}

.device-row-link:visited {
    color: inherit;
}

.device-main {
    flex: 1 1 320px;
    min-width: 0;
    max-width: 100%;
}

.device-title {
    margin-bottom: 6px;
    max-width: 100%;

    overflow: hidden;

    color: var(--text);

    font-size: 16px;
    font-weight: 650;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-identifier {
    max-width: 100%;
    overflow: hidden;

    color: var(--muted);

    font-family: monospace;
    font-size: 13px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-metadata {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 280px;
    flex-wrap: wrap;
    gap: 14px;
    min-width: 0;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================================
   Captured Networks
   ========================================================= */

.capture-upload-panel {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1fr);
    gap: 18px;
    align-items: stretch;

    width: 100%;
    max-width: var(--content-width);
    margin-bottom: 18px;
    padding: 18px;

    background:
        linear-gradient(
            135deg,
            rgba(56, 189, 248, 0.12),
            rgba(34, 197, 94, 0.07)
        ),
        var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-card);
}

.captured-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.captured-add-link {
    flex: 0 0 auto;
    margin-top: 4px;
}

.capture-upload-copy {
    display: grid;
    align-content: center;

    min-width: 0;
    padding: 16px;

    background: rgba(11, 15, 20, 0.22);

    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--radius-medium);
}

.capture-upload-panel h2 {
    margin: 0 0 8px;

    font-size: 18px;
}

.capture-upload-panel p {
    max-width: 540px;
    margin: 0;

    color: var(--muted);

    font-size: 14px;
}

.capture-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 12px;
    align-items: stretch;
}

.capture-upload-form .file-picker {
    min-height: 0;
    padding: 16px 18px;

    display: grid;
    grid-template-columns: 34px minmax(82px, auto) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    justify-content: stretch;

    text-align: left;
}

.capture-upload-form .file-picker-icon {
    margin: 0;

    font-size: 26px;
}

.capture-upload-form .file-picker input {
    min-width: 0;
    margin: 0;
}

.capture-upload-form .import-button {
    height: 100%;
    margin: 0;
}

.captured-list {
    display: grid;
    gap: 12px;

    width: 100%;
    max-width: var(--content-width);
    min-width: 0;
}

.captured-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) minmax(0, 1.7fr) auto;
    gap: 18px;
    align-items: center;

    min-width: 0;
    padding: 18px 20px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 12px;

    box-shadow: var(--shadow-card);
}

.captured-heading {
    display: flex;
    align-items: center;
    gap: 10px;

    min-width: 0;
}

.captured-heading h2 {
    min-width: 0;
    margin: 0;

    overflow: hidden;

    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.captured-bssid {
    margin-top: 8px;

    overflow-wrap: anywhere;

    color: var(--muted);

    font-family: monospace;
    font-size: 13px;
}

.captured-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;

    min-width: 0;
    margin: 0;
}

.captured-fields div {
    min-width: 0;
    padding: 10px 12px;

    background: rgba(11, 15, 20, 0.28);

    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius-small);
}

.captured-fields dt {
    margin-bottom: 4px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.captured-fields dd {
    min-width: 0;
    margin: 0;

    overflow-wrap: anywhere;

    color: var(--text);

    font-size: 13px;
    font-weight: 650;
}

.captured-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;

    min-width: 132px;
}

.capture-form-error {
    max-width: var(--content-width);
    margin-bottom: 18px;
}

.capture-form-error p {
    margin: 10px 0 0;
}

.capture-form-card {
    width: 100%;
    max-width: var(--content-width);
    padding: 24px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-card);
}

.capture-manual-form {
    display: grid;
    gap: 22px;
}

.capture-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.capture-form-field {
    display: grid;
    gap: 8px;

    min-width: 0;
}

.capture-form-field > span {
    color: var(--muted);

    font-size: 13px;
    font-weight: 700;
}

.capture-form-field input {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;

    background: var(--background);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    outline: none;
}

.capture-form-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.capture-form-field small {
    color: var(--muted);
    font-size: 12px;
}

.capture-form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.capture-form-actions .import-button {
    margin: 0;
}

.capture-delete-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-top: 26px;
    padding-top: 22px;

    border-top: 1px solid rgba(248, 113, 113, 0.3);
}

.capture-delete-panel strong {
    color: var(--danger);
}

.capture-delete-panel p {
    max-width: 650px;
    margin: 7px 0 0;

    color: var(--muted);
    font-size: 13px;
}

.capture-delete-panel .action-link {
    cursor: pointer;
}

.captured-no-match {
    padding: 8px 10px;

    color: var(--muted);

    border: 1px dashed var(--border);
    border-radius: var(--radius-small);

    font-size: 12px;
    font-weight: 650;
    text-align: center;
}

.empty-state {
    padding: 32px 22px;

    background: var(--surface);

    border: 1px dashed var(--border);
    border-radius: var(--radius-large);

    text-align: center;
}

.empty-state h2 {
    margin: 0 0 8px;

    font-size: 18px;
}

.empty-state p {
    margin: 0;

    color: var(--muted);
}


/* =========================================================
   Device Type Badges
   ========================================================= */

.type-badge {
    padding: 5px 9px;

    border: 1px solid var(--border);
    border-radius: 999px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.type-wifi {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}

.wps-list-badge {
    letter-spacing: 0.05em;
}

.wps-list-enabled {
    background: rgba(34, 197, 94, 0.14);
    color: var(--success);

    border-color: rgba(34, 197, 94, 0.46);
}

.wps-list-disabled {
    background: rgba(248, 113, 113, 0.14);
    color: var(--danger);

    border-color: rgba(248, 113, 113, 0.46);
}

.type-ble {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
}

.type-bt {
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
}

.type-lte {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.type-unknown {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

.category-badge {
    background: rgba(148, 163, 184, 0.1);
    color: #d8dee9;

    border-color: rgba(148, 163, 184, 0.28);
}

.category-router,
.category-network {
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;

    border-color: rgba(56, 189, 248, 0.38);
}

.category-extender {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;

    border-color: rgba(34, 197, 94, 0.38);
}

.category-iot {
    background: rgba(250, 204, 21, 0.12);
    color: #fde047;

    border-color: rgba(250, 204, 21, 0.34);
}

.category-printer {
    background: rgba(45, 212, 191, 0.12);
    color: #5eead4;

    border-color: rgba(45, 212, 191, 0.36);
}

.category-phone,
.category-computer {
    background: rgba(168, 85, 247, 0.12);
    color: #d8b4fe;

    border-color: rgba(168, 85, 247, 0.36);
}

.category-vehicle,
.category-wearable {
    background: rgba(244, 114, 182, 0.12);
    color: #f9a8d4;

    border-color: rgba(244, 114, 182, 0.34);
}

.category-unknown {
    background: rgba(148, 163, 184, 0.09);
    color: var(--muted);
}


/* =========================================================
   Device Detail
   ========================================================= */

.device-detail-identifier {
    overflow-wrap: anywhere;

    font-family: monospace;
}

.device-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;

    max-width: var(--content-width);
}

.detail-card {
    min-width: 0;
    padding: 20px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 13px;

    box-shadow: var(--shadow-card);
}

.detail-text {
    overflow-wrap: anywhere;

    font-size: 14px;
    line-height: 1.5;
}

.category-detail-value {
    display: block;
    margin-bottom: 10px;
}

.category-note {
    display: block;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.45;
}

.device-context-actions {
    max-width: var(--content-width);
    margin-bottom: 18px;
}

.wps-card {
    border-width: 2px;
}

.wps-enabled {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.68);
}

.wps-disabled {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.68);
}

.wps-value {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 18px;
}

.wps-enabled .wps-value {
    color: var(--success);
}

.wps-disabled .wps-value {
    color: var(--danger);
}

.wps-icon {
    width: 30px;
    height: 30px;

    display: inline-grid;
    flex-shrink: 0;
    place-items: center;

    border-radius: 50%;

    font-size: 19px;
    font-weight: 900;
    line-height: 1;
}

.wps-enabled .wps-icon {
    background: var(--success);
    color: #041019;
}

.wps-disabled .wps-icon {
    background: var(--danger);
    color: #041019;
}

.wps-note {
    display: block;
    margin-top: 10px;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.45;
}


/* =========================================================
   Estimated Device Location
   ========================================================= */

.estimated-location {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    max-width: var(--content-width);
    margin-top: 20px;
    padding: 22px;

    background: var(--success-soft);

    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: var(--radius-large);
}

.estimated-location p {
    max-width: 620px;
    margin: 8px 0 0;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.55;
}

.estimated-coordinates {
    flex-shrink: 0;

    padding: 10px 12px;

    background: var(--background);

    border: 1px solid var(--border);
    border-radius: 9px;

    font-family: monospace;
    font-size: 13px;
}


/* =========================================================
   Map
   ========================================================= */

.map-section {
    max-width: var(--content-width);
    margin-top: 28px;
}

.section-heading {
    margin-bottom: 14px;
}

.section-heading h2 {
    margin: 0 0 6px;

    font-size: 20px;
}

.section-heading p {
    margin: 0;

    color: var(--muted);

    font-size: 13px;
}

#device-map {
    width: 100%;
    height: 520px;

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-card);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--surface);
    color: var(--text);
}

.leaflet-popup-content {
    line-height: 1.55;
}


/* =========================================================
   Import Page
   ========================================================= */

.import-card {
    max-width: 700px;
    padding: 24px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-card);
}

.file-picker {
    min-height: 220px;
    padding: 30px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;

    text-align: center;

    background: var(--background);

    border: 2px dashed var(--border);
    border-radius: 12px;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.file-picker:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.file-picker-icon {
    margin-bottom: 4px;

    color: var(--accent);

    font-size: 38px;
}

.file-picker span:not(.file-picker-icon) {
    color: var(--muted);

    font-size: 13px;
}

.file-picker input {
    max-width: 100%;
    margin-top: 15px;

    color: var(--muted);
}

.import-button {
    width: 100%;

    margin-top: 16px;
    padding: 14px 20px;

    background: var(--accent);
    color: #041019;

    border: 0;
    border-radius: var(--radius-medium);

    font-weight: 700;

    cursor: pointer;

    transition:
        filter 0.2s ease,
        transform 0.15s ease;
}

.import-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}


/* =========================================================
   Import Results and Messages
   ========================================================= */

.message-panel {
    max-width: 700px;
    margin-top: 20px;
    padding: 22px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-card);
}

.message-panel pre {
    margin: 16px 0 0;
    padding: 16px;

    overflow-x: auto;

    background: var(--background);
    color: var(--text);

    border-radius: var(--radius-medium);

    font-family: monospace;
    line-height: 1.65;

    white-space: pre-wrap;
}

.success-panel {
    border-color: rgba(34, 197, 94, 0.45);
}

.error-panel {
    background: var(--danger-soft);
    border-color: rgba(239, 68, 68, 0.5);
}

.error-panel strong {
    color: var(--danger);
}

.uploaded-file {
    margin: 8px 0 0;

    color: var(--muted);

    font-family: monospace;
}


/* =========================================================
   Backup and Restore
   ========================================================= */

.backup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 18px;

    max-width: var(--content-width);
}

.backup-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 22px;

    padding: 24px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-card);
}

.backup-card h2 {
    margin: 0 0 10px;

    font-size: 20px;
}

.backup-card p {
    margin: 0;

    color: var(--muted);
}

.backup-card-danger {
    border-color: rgba(248, 113, 113, 0.42);
}

.backup-card form {
    display: grid;
    gap: 14px;

    width: min(100%, 320px);
}

.backup-field {
    display: grid;
    gap: 7px;
}

.backup-field span {
    color: var(--muted);

    font-size: 13px;
    font-weight: 600;
}

.backup-field input[type="file"] {
    width: 100%;
    padding: 12px;

    background: var(--background);
    color: var(--muted);

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
}

.restore-confirmation {
    padding: 12px 14px;

    background: var(--danger-soft);
    color: var(--muted);

    border: 1px solid rgba(248, 113, 113, 0.34);
    border-radius: var(--radius-medium);

    font-size: 13px;
}

.restore-confirmation code {
    color: var(--danger);

    font-weight: 700;
}

.danger-button {
    background: var(--danger);
    color: #190606;
}

.backup-button {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
    padding-right: 18px;
    padding-left: 18px;
}


/* =========================================================
   Sessions List
   ========================================================= */

.session-list {
    display: grid;
    gap: 12px;

    max-width: var(--content-width);
}

.session-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding: 20px 22px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 13px;

    box-shadow: var(--shadow-card);

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}

.session-card:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);

    transform: translateY(-1px);
}

.session-card-link,
.session-card-link:hover,
.session-card-link:focus,
.session-card-link:visited {
    color: inherit;
    text-decoration: none;
}

.session-main {
    min-width: 0;
}

.session-title {
    overflow: hidden;

    font-family: monospace;
    font-size: 15px;
    font-weight: 650;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-date {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: 7px;

    color: var(--muted);

    font-size: 13px;
}

.country-badge {
    display: inline-flex;
    align-items: center;

    padding: 4px 8px;

    background: var(--accent-soft);
    color: var(--accent);

    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 999px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
}

.session-stats {
    display: flex;
    flex-shrink: 0;
    gap: 34px;
}

.session-stats div {
    min-width: 105px;
}

.session-stats strong {
    display: block;

    font-size: 20px;
}

.session-stats span {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   Session Detail
   ========================================================= */

.session-detail-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;

    max-width: var(--content-width);

    overflow: hidden;

    background: var(--border);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-card);
}

.detail-section {
    min-width: 0;
    padding: 22px;

    background: var(--surface);
}

.detail-label {
    display: block;

    margin-bottom: 9px;

    color: var(--muted);

    font-size: 13px;
}

.detail-value {
    display: block;

    overflow-wrap: anywhere;

    font-size: 16px;
}

.detail-filename {
    font-family: monospace;
}

.session-detail-stats {
    margin-top: 28px;
}


/* =========================================================
   Empty States
   ========================================================= */

.empty-state {
    padding: 50px 24px;

    text-align: center;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-card);
}

.empty-state h2 {
    margin: 0 0 8px;
}

.empty-state p {
    margin: 0;

    color: var(--muted);
}


/* =========================================================
   Responsive: Tablets
   ========================================================= */

@media (max-width: 900px) {
    .device-row {
        display: block;
    }

    .device-metadata {
        margin-top: 14px;
        flex-wrap: wrap;
    }

    .capture-upload-panel,
    .captured-row {
        grid-template-columns: 1fr;
    }

    .capture-upload-form {
        grid-template-columns: 1fr;
    }

    .capture-upload-form .import-button {
        min-height: 48px;
    }

    .captured-actions {
        justify-content: flex-start;
    }

    .captured-page-header {
        display: grid;
    }
}

@media (max-width: 800px) {
    .device-detail-grid {
        grid-template-columns: 1fr 1fr;
    }

    .estimated-location {
        display: block;
    }

    .estimated-coordinates {
        display: inline-block;

        margin-top: 16px;
    }
}

@media (max-width: 760px) {
    .layout {
        display: block;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 20;

        display: grid;
        align-items: center;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;

        padding: 16px 18px 14px;

        background: rgba(16, 22, 30, 0.96);
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .brand {
        min-width: 0;
        margin-bottom: 0;
    }

    .brand-icon {
        width: 36px;
        height: 36px;

        border-radius: 10px;

        font-size: 19px;
    }

    .brand-name {
        font-size: 17px;
    }

    .brand-subtitle {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-grid;
        align-items: center;
        grid-template-columns: 22px auto;
        gap: 7px;

        min-height: 42px;
        padding: 9px 12px;

        background: var(--surface);
        color: var(--text);

        border: 1px solid var(--border);
        border-radius: var(--radius-medium);

        cursor: pointer;
        font-size: 13px;
        font-weight: 700;
    }

    .mobile-menu-toggle span:first-child {
        display: grid;
        place-items: center;

        width: 22px;
        height: 22px;

        color: var(--accent);

        font-size: 18px;
        line-height: 1;
    }

    .navigation {
        display: none;
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
        gap: 8px;
        padding-top: 14px;

        border-top: 1px solid rgba(148, 163, 184, 0.12);
    }

    .nav-item {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 12px;

        min-width: 0;
        min-height: 50px;
        padding: 11px 13px;

        background: rgba(21, 28, 37, 0.86);

        border: 1px solid rgba(148, 163, 184, 0.12);
        border-radius: var(--radius-medium);

        font-size: 13px;
    }

    .nav-item span:first-child {
        width: 30px;
        height: 30px;

        font-size: 20px;
    }

    .nav-item span:last-child {
        white-space: normal;
    }

    .nav-item.active {
        border-color: rgba(56, 189, 248, 0.34);
    }

    .mobile-menu-open .navigation {
        display: grid;
    }

    .logout-item {
        margin-top: 0;
    }

    .content {
        padding: 24px 18px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-insights {
        grid-template-columns: 1fr;
    }

    .backup-grid {
        grid-template-columns: 1fr;
    }

    .session-detail-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .session-card {
        display: block;
    }

    .session-stats {
        margin-top: 18px;
    }
}


/* =========================================================
   Responsive: Phones
   ========================================================= */

@media (max-width: 560px) {
    .mobile-menu-toggle span:last-child {
        display: none;
    }

    .search-form {
        display: grid;
    }

    .search-button,
    .clear-button {
        justify-content: center;
        text-align: center;
    }

    .insight-header {
        display: block;
    }

    .insight-total {
        display: inline-block;
        margin-top: 12px;
    }

    .device-category-grid {
        grid-template-columns: 1fr;
    }

    .last-seen {
        width: 100%;
    }

    .result-actions,
    .session-actions {
        display: grid;
    }

    .action-link {
        width: 100%;
        text-align: center;
    }

    .captured-fields {
        grid-template-columns: 1fr;
    }

    .capture-form-grid {
        grid-template-columns: 1fr;
    }

    .capture-form-actions,
    .capture-delete-panel {
        display: grid;
    }

    .captured-actions {
        display: grid;
        min-width: 0;
    }

    .captured-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .capture-upload-form .file-picker {
        grid-template-columns: 1fr;

        text-align: center;
    }
}

@media (max-width: 520px) {
    .device-detail-grid {
        grid-template-columns: 1fr;
    }

    #device-map {
        height: 420px;
    }
}

/* =========================================================
   Global Map
   ========================================================= */

.map-page-content {
    min-width: 0;
}

.map-page-header {
    margin-bottom: 20px;
}

.map-filter-form {
    display: flex;
    gap: 10px;

    max-width: var(--content-width);
    margin-bottom: 14px;
}

.map-display-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    max-width: var(--content-width);
    margin-bottom: 14px;
}

.map-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    min-height: 42px;
    padding: 8px 13px;

    background: var(--surface);
    color: var(--muted);

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    font-size: 13px;
    font-weight: 650;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.map-toggle:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.map-toggle input {
    position: absolute;

    width: 1px;
    height: 1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);
}

.map-toggle-control {
    position: relative;

    width: 40px;
    height: 22px;

    background: rgba(148, 163, 184, 0.18);

    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 999px;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.map-toggle-control::after {
    content: "";

    position: absolute;
    top: 3px;
    left: 3px;

    width: 14px;
    height: 14px;

    background: var(--muted);

    border-radius: 999px;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.map-toggle input:checked + .map-toggle-control {
    background: var(--accent-soft);
    border-color: rgba(56, 189, 248, 0.55);
}

.map-toggle input:checked + .map-toggle-control::after {
    background: var(--accent);

    transform: translateX(18px);
}

.map-toggle input:focus-visible + .map-toggle-control {
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.map-type-select {
    min-width: 170px;
    padding: 13px 38px 13px 14px;

    background: var(--surface);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    outline: none;

    cursor: pointer;
}

.map-type-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.map-summary {
    max-width: var(--content-width);
    margin-bottom: 16px;

    color: var(--muted);

    font-size: 13px;
}

.hidden-device-summary {
    color: var(--accent);
    font-weight: 650;
}

#global-map {
    width: 100%;
    height: calc(100vh - 235px);
    min-height: 520px;
    max-width: 1400px;

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-card);
}

.map-empty-state {
    max-width: var(--content-width);
}

.map-popup {
    min-width: 210px;
}

.map-popup > strong {
    display: block;

    padding-right: 8px;

    font-size: 15px;
}

.map-popup-type {
    display: inline-block;

    margin-top: 5px;
    padding: 3px 7px;

    background: var(--accent-soft);
    color: var(--accent);

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
}

.map-popup-identifier {
    margin-top: 8px;

    color: var(--muted);

    font-family: monospace;
    font-size: 11px;

    overflow-wrap: anywhere;
}

.map-popup dl {
    margin: 12px 0;
}

.map-popup dl div {
    display: flex;
    justify-content: space-between;
    gap: 18px;

    padding: 3px 0;
}

.map-popup dt {
    color: var(--muted);
}

.map-popup dd {
    margin: 0;

    color: var(--text);

    font-weight: 600;
}

.map-popup-link {
    display: inline-flex;

    margin-top: 4px;

    color: var(--accent);

    font-weight: 650;
    text-decoration: none;
}

.map-popup-link:hover {
    text-decoration: underline;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: rgba(56, 189, 248, 0.22);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: var(--accent);
    color: #041019;

    font-weight: 700;
}

@media (max-width: 760px) {
    .map-filter-form {
        display: grid;
    }

    .map-display-options {
        display: grid;
    }

    .map-toggle {
        justify-content: space-between;
    }

    .map-type-select {
        width: 100%;
    }

    #global-map {
        height: 620px;
        min-height: 0;
    }
}

.security-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.security-item {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    background: var(--accent-soft);
    color: var(--accent);

    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 999px;

    font-size: 11px;
    font-weight: 650;
}

/* =========================================================
   Manufacturer Information
   ========================================================= */

.manufacturer-layout {
    display: grid;
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;

    max-width: var(--content-width);
}

.manufacturer-column,
.manufacturer-detail {
    min-width: 0;
}

.manufacturer-list,
.manufacturer-device-list {
    display: grid;
    gap: 10px;
}

.manufacturer-list-page,
.manufacturer-results-panel {
    max-width: var(--content-width);
}

.manufacturer-detail-actions {
    justify-content: flex-start;
    margin: -6px 0 18px;
}

.manufacturer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    min-width: 0;
    min-height: 82px;
    padding: 16px 18px;

    background: var(--surface);
    color: inherit;

    border: 1px solid var(--border);
    border-radius: 12px;

    box-shadow: var(--shadow-card);

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}

.manufacturer-row:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);

    transform: translateY(-1px);
}

.manufacturer-device-row:hover {
    background: var(--surface-hover);
}

.manufacturer-row.active {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow:
        var(--shadow-card),
        0 0 0 3px var(--accent-soft);
}

.manufacturer-main,
.manufacturer-device-main {
    min-width: 0;
}

.manufacturer-main strong,
.manufacturer-device-main strong {
    display: block;

    overflow: hidden;

    color: var(--text);

    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manufacturer-main span,
.manufacturer-device-main span {
    display: block;

    margin-top: 5px;

    overflow: hidden;

    color: var(--muted);

    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manufacturer-device-main span {
    font-family: monospace;
}

.manufacturer-count {
    flex-shrink: 0;

    min-width: 76px;

    text-align: right;
}

.manufacturer-count strong {
    display: block;

    font-size: 18px;
}

.manufacturer-count span {
    display: block;

    color: var(--muted);

    font-size: 11px;
}

.manufacturer-detail-panel {
    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 13px;

    box-shadow: var(--shadow-card);
}

.manufacturer-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    min-height: 82px;
    padding: 18px 20px;

    border-bottom: 1px solid var(--border);
}

.manufacturer-detail-header h2 {
    margin: 0 0 5px;

    font-size: 20px;
    line-height: 1.25;
}

.manufacturer-detail-header p {
    margin: 0;

    color: var(--muted);

    font-size: 13px;
}

.manufacturer-detail-count {
    flex-shrink: 0;

    min-width: 86px;

    text-align: right;
}

.manufacturer-detail-count strong {
    display: block;

    font-size: 24px;
    line-height: 1.1;
}

.manufacturer-detail-count span {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 11px;
}

.manufacturer-device-row {
    display: grid;
    gap: 10px;

    min-width: 0;
    min-height: 72px;
    padding: 14px 18px;

    color: inherit;

    border-bottom: 1px solid var(--border);

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.manufacturer-device-row:last-child {
    border-bottom: 0;
}

.manufacturer-device-meta {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;

    max-width: none;

    color: var(--muted);

    font-size: 12px;
}

.manufacturer-device-meta span {
    max-width: 220px;
    padding: 4px 8px;

    overflow: hidden;

    background: rgba(148, 163, 184, 0.08);

    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 999px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    margin-top: 18px;
}

.manufacturer-detail-panel > .pagination {
    margin: 0;
    padding: 14px 18px;

    background: rgba(11, 15, 20, 0.22);

    border-top: 1px solid var(--border);
}

.manufacturer-pagination {
    justify-content: flex-start;
}

.pagination a,
.pagination span,
.pagination strong {
    padding: 8px 12px;

    background: var(--surface);
    color: var(--muted);

    border: 1px solid var(--border);
    border-radius: var(--radius-small);

    font-size: 13px;
    text-decoration: none;
}

.pagination a {
    color: var(--text);
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination strong {
    color: var(--text);
}

.manufacturer-name {
    line-height: 1.4;
}

.manufacturer-note {
    display: block;
    margin-top: 8px;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.45;
}

@media (max-width: 980px) {
    .manufacturer-layout {
        grid-template-columns: 1fr;
        max-width: var(--content-width);
    }
}

@media (max-width: 700px) {
    .manufacturer-detail-panel {
        overflow: visible;

        background: transparent;

        border: 0;
        border-radius: 0;

        box-shadow: none;
    }

    .manufacturer-detail-header {
        display: block;
        margin-bottom: 10px;
        padding: 16px 18px;

        background: var(--surface);

        border: 1px solid var(--border);
        border-radius: 12px;

        box-shadow: var(--shadow-card);
    }

    .manufacturer-detail-count {
        margin-top: 12px;

        text-align: left;
    }

    .manufacturer-device-row {
        display: block;
        min-height: 0;

        margin-bottom: 10px;

        background: var(--surface);

        border: 1px solid var(--border);
        border-radius: 12px;

        box-shadow: var(--shadow-card);
    }

    .manufacturer-device-meta {
        justify-content: flex-start;
        margin-top: 12px;
    }

    .manufacturer-detail-panel > .pagination {
        margin-top: 8px;
        padding: 0;

        background: transparent;

        border-top: 0;
    }
}

/* =========================================================
   Search Visible Map Area
   ========================================================= */

.global-map-wrapper {
    position: relative;

    width: 100%;
    max-width: 1400px;
}

.search-area-button {
    position: absolute;
    z-index: 1000;
    top: 18px;
    left: 50%;

    padding: 10px 18px;

    transform: translateX(-50%);

    background: var(--accent);
    color: #041019;

    border: 0;
    border-radius: 999px;

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.35);

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        filter 0.2s ease,
        transform 0.15s ease;
}

.search-area-button:hover {
    filter: brightness(1.08);

    transform:
        translateX(-50%)
        translateY(-1px);
}

.search-area-button:focus-visible {
    outline: 3px solid var(--accent-soft);
    outline-offset: 3px;
}

.map-loading-indicator {
    position: absolute;
    z-index: 1000;
    top: 18px;
    left: 50%;

    padding: 10px 18px;

    transform: translateX(-50%);

    background: var(--surface);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 999px;

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.35);

    font-size: 13px;
    font-weight: 650;
}

.map-result-message {
    max-width: var(--content-width);
    min-height: 22px;
    margin-top: 12px;

    color: var(--muted);

    font-size: 13px;
}

@media (max-width: 560px) {
    .search-area-button,
    .map-loading-indicator {
        top: 12px;

        max-width: calc(100% - 32px);

        white-space: nowrap;
    }
}

/* =========================================================
   High-contrast Leaflet Popup
   ========================================================= */

.leaflet-popup-content-wrapper {
    overflow: hidden;

    background: #ffffff;
    color: #111827;

    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 18px;

    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.22),
        0 4px 12px rgba(15, 23, 42, 0.12);
}

.leaflet-popup-tip {
    background: #ffffff;

    box-shadow:
        3px 3px 8px rgba(15, 23, 42, 0.12);
}

.leaflet-popup-content {
    width: 270px !important;
    margin: 20px 20px 18px;

    color: #111827;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.45;
}

.map-popup {
    min-width: 0;

    color: #111827;
}

.map-popup > strong {
    display: block;

    margin: 0 28px 8px 0;

    color: #111827;

    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;

    overflow-wrap: anywhere;
}

.map-popup-type {
    display: inline-flex;
    align-items: center;

    margin-top: 2px;
    padding: 4px 9px;

    background: #e0f2fe;
    color: #0284c7;

    border: 0;
    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
}

.map-popup-identifier {
    margin-top: 12px;
    padding-bottom: 14px;

    color: #64748b;

    border-bottom: 1px solid #e2e8f0;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 12px;
    line-height: 1.4;

    overflow-wrap: anywhere;
}

.map-popup dl {
    margin: 0;
}

.map-popup dl div {
    display: grid;
    grid-template-columns: minmax(80px, 1fr) auto;
    align-items: center;
    gap: 16px;

    min-height: 38px;
    padding: 8px 0;

    border-bottom: 1px solid #e2e8f0;
}

.map-popup dt {
    color: #64748b;

    font-size: 13px;
    font-weight: 600;
}

.map-popup dd {
    margin: 0;

    color: #0f172a;

    font-size: 13px;
    font-weight: 800;

    text-align: right;
    white-space: nowrap;
}

.map-popup-link {
    display: inline-flex;
    align-items: center;

    margin-top: 14px;

    color: #0369a1;

    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.map-popup-link:hover {
    color: #075985;
    text-decoration: underline;
}

.leaflet-container a.leaflet-popup-close-button {
    top: 9px;
    right: 10px;

    width: 26px;
    height: 26px;

    color: #64748b;

    font-size: 22px;
    font-weight: 400;
    line-height: 24px;

    border-radius: 50%;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    background: #f1f5f9;
    color: #0f172a;
    text-decoration: none;
}

@media (max-width: 420px) {
    .leaflet-popup-content {
        width: 230px !important;
        margin: 17px 17px 15px;
    }

    .map-popup > strong {
        font-size: 17px;
    }

    .map-popup dl div {
        gap: 10px;
    }
}
