:root {
    --wf-brand: #0eb8ae;
    --wf-brand-dark: #07736f;
    --wf-navy: #0b1d28;
    --wf-navy-soft: #123140;
    --wf-canvas: #f3f6f9;
    --wf-surface: #ffffff;
    --wf-border: #dfe7ec;
    --wf-text: #17242c;
    --wf-muted: #5f727d;
    --wf-sidebar-width: 268px;
    --wf-topbar-height: 72px;
    --wf-radius: 14px;
    --wf-shadow: 0 6px 24px rgba(16, 43, 56, .07);
    --bs-primary: #087f7a;
    --bs-primary-rgb: 8, 127, 122;
    --bs-link-color: #07736f;
    --bs-link-hover-color: #065f5b;
}

[data-bs-theme="dark"] {
    --wf-canvas: #07131a;
    --wf-surface: #0d222c;
    --wf-border: #1e3d49;
    --wf-text: #eef6f7;
    --wf-muted: #99adb6;
    --wf-brand-dark: #63ded7;
    --wf-shadow: 0 8px 28px rgba(0, 0, 0, .24);
    --bs-body-bg: var(--wf-canvas);
    --bs-body-color: var(--wf-text);
    --bs-border-color: var(--wf-border);
}

* { box-sizing: border-box; }

html, body { max-width: 100%; overflow-x: clip; }

body {
    color: var(--wf-text);
    background: var(--wf-canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-rendering: optimizeLegibility;
}

a { text-underline-offset: 3px; }

:focus-visible {
    outline: 3px solid #087f7a !important;
    outline-offset: 2px;
}

.ui-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.skip-link {
    position: fixed;
    left: 12px;
    top: -60px;
    z-index: 2000;
    padding: 10px 16px;
    color: #fff;
    background: var(--wf-brand-dark);
    border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    width: var(--wf-sidebar-width);
    padding: 22px 16px 16px;
    color: #dce9ed;
    background:
        radial-gradient(circle at 10% 5%, rgba(14, 184, 174, .2), transparent 26%),
        linear-gradient(180deg, #0c2531 0%, #071923 100%);
    flex-direction: column;
    box-shadow: 8px 0 30px rgba(7, 25, 35, .12);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 10px;
    color: #fff;
    text-decoration: none;
}

.sidebar-brand:hover { color: #fff; }
.sidebar-brand > span:last-child { display: grid; line-height: 1.1; }
.sidebar-brand strong { font-size: 16px; letter-spacing: .01em; }
.sidebar-brand small { margin-top: 4px; color: #8db2bd; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    color: #052b2c;
    background: linear-gradient(135deg, #52ded5, #0eb8ae);
    border-radius: 11px;
    box-shadow: 0 7px 18px rgba(14, 184, 174, .25);
    font-weight: 900;
}

.sidebar-nav { margin-top: 28px; }
.sidebar-section-label {
    padding: 0 12px 8px;
    color: #698f9b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.sidebar-admin-label { margin-top: 24px; }

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 44px;
    margin: 3px 0;
    padding: 10px 12px;
    color: #a9c1c9;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 560;
    transition: color .16s ease, background .16s ease, transform .16s ease;
}
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.sidebar-link.active { color: #fff; background: linear-gradient(90deg, rgba(14,184,174,.24), rgba(14,184,174,.1)); }
.sidebar-link.active::before {
    position: absolute;
    left: -16px;
    width: 3px;
    height: 24px;
    background: #38d3ca;
    border-radius: 0 4px 4px 0;
    content: "";
}

.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 8px; color: #e4eff2; border-radius: 10px; text-decoration: none; }
.sidebar-profile:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-profile > span:last-child { min-width: 0; display: grid; line-height: 1.25; }
.sidebar-profile strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile small { color: #829fab; font-size: 11px; }

.avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    color: #075f5d;
    background: #d9f5f2;
    border: 1px solid #b7e9e4;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
}

.app-offcanvas { --bs-offcanvas-width: 286px; color: #dce9ed; background: #0a202b; }
.app-offcanvas .offcanvas-header { min-height: 76px; border-bottom: 1px solid rgba(255,255,255,.08); }
.app-offcanvas .offcanvas-body { padding: 0 16px; }
.app-offcanvas .sidebar-brand { padding-left: 0; }

.app-frame { min-height: 100vh; margin-left: var(--wf-sidebar-width); }
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 18px;
    height: var(--wf-topbar-height);
    padding: 0 30px;
    background: color-mix(in srgb, var(--wf-surface) 93%, transparent);
    border-bottom: 1px solid var(--wf-border);
    backdrop-filter: blur(12px);
}

.top-search {
    position: relative;
    align-items: center;
    width: min(520px, 47vw);
    height: 40px;
}
.top-search .ui-icon { position: absolute; left: 13px; width: 17px; color: var(--wf-muted); }
.top-search input {
    width: 100%;
    height: 40px;
    padding: 8px 60px 8px 40px;
    color: var(--wf-text);
    background: var(--wf-canvas);
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
}
.top-search input:focus { background: var(--wf-surface); border-color: var(--wf-brand); outline: none; box-shadow: 0 0 0 3px rgba(14,184,174,.12); }
.top-search kbd { position: absolute; right: 10px; padding: 3px 7px; color: var(--wf-muted); background: var(--wf-surface); border: 1px solid var(--wf-border); border-radius: 5px; font: 11px inherit; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.environment-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; color: var(--wf-muted); background: var(--wf-canvas); border-radius: 999px; font-size: 11px; font-weight: 700; }
.environment-badge > span { width: 7px; height: 7px; background: #19a974; border-radius: 50%; box-shadow: 0 0 0 3px rgba(25,169,116,.14); }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; color: var(--wf-muted); border: 1px solid transparent; border-radius: 10px; }
.icon-button:hover { color: var(--wf-text); background: var(--wf-canvas); border-color: var(--wf-border); }
.profile-trigger { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 4px 7px; border: 0; }
.profile-trigger > span:last-child { display: grid !important; min-width: 90px; text-align: left; line-height: 1.15; }
.profile-trigger strong { max-width: 145px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.profile-trigger small { margin-top: 3px; color: var(--wf-muted); font-size: 10px; }
.dropdown-item { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 13px; }
.dropdown-item .ui-icon { width: 17px; height: 17px; }

.app-content { max-width: 1600px; min-height: calc(100vh - 126px); margin: 0 auto; padding: 30px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 2px 0 0; font-size: clamp(25px, 2.4vw, 34px); font-weight: 750; letter-spacing: -.035em; }
.eyebrow { margin: 0; color: var(--wf-brand-dark); font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.page-subtitle { max-width: 740px; margin: 7px 0 0; color: var(--wf-muted); font-size: 13px; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.page-actions .btn { min-height: 40px; }

.btn { --bs-btn-font-weight: 650; --bs-btn-border-radius: 9px; font-size: 13px; }
.btn-primary { --bs-btn-bg: #087f7a; --bs-btn-border-color: #087f7a; --bs-btn-hover-bg: #066f6b; --bs-btn-hover-border-color: #066f6b; }
.btn .ui-icon { width: 17px; height: 17px; margin-right: 6px; vertical-align: -4px; }
.btn-icon-only .ui-icon { margin: 0; }

.app-alert { display: flex; align-items: flex-start; gap: 10px; border: 0; box-shadow: var(--wf-shadow); }
.app-alert .ui-icon { margin-top: 1px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card {
    position: relative;
    min-height: 126px;
    padding: 20px;
    overflow: hidden;
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    color: var(--wf-text);
    text-decoration: none;
}
.metric-card:hover { color: var(--wf-text); border-color: color-mix(in srgb, var(--wf-brand) 48%, var(--wf-border)); transform: translateY(-1px); }
.metric-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--metric-color, var(--wf-brand-dark)); background: var(--metric-bg, #ddf5f2); border-radius: 10px; }
.metric-icon .ui-icon { width: 19px; height: 19px; }
.metric-card .metric-label { margin-top: 15px; color: var(--wf-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.metric-card .metric-value { margin-top: 2px; font-size: 27px; font-weight: 780; letter-spacing: -.04em; }
.metric-card .metric-link { position: absolute; right: 16px; bottom: 16px; color: var(--wf-muted); }
.metric-card.warning { --metric-color: #aa7010; --metric-bg: #fff1cc; }
.metric-card.danger { --metric-color: #b43d4f; --metric-bg: #fde1e5; }
.metric-card.info { --metric-color: #3267b2; --metric-bg: #e2edfc; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, .75fr); gap: 20px; }
.content-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.content-grid > *, .panel-stack, .panel { min-width: 0; }
.panel {
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
}
.panel + .panel, .panel-stack > .panel + .panel { margin-top: 20px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 61px; padding: 15px 20px; border-bottom: 1px solid var(--wf-border); }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 15px; font-weight: 730; }
.panel-header p { margin: 4px 0 0; color: var(--wf-muted); font-size: 12px; }
.panel-body { padding: 20px; }
.panel-body.flush { padding: 0; }

.table-responsive { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; contain: paint; border-radius: 0 0 var(--wf-radius) var(--wf-radius); }
.table-responsive:focus-visible { outline-offset: -3px; }
.app-table { margin: 0; color: var(--wf-text); font-size: 12.5px; vertical-align: middle; }
.app-table > :not(caption) > * > * { padding: 13px 14px; background: transparent; border-bottom-color: var(--wf-border); }
.app-table thead th { color: var(--wf-muted); background: color-mix(in srgb, var(--wf-canvas) 70%, var(--wf-surface)); border-bottom-width: 1px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.app-table tbody tr { transition: background .12s ease; }
.app-table tbody tr:hover { background: color-mix(in srgb, var(--wf-brand) 4%, transparent); }
.app-table tbody tr:last-child > * { border-bottom: 0; }
.table-primary-link { display: block; max-width: 260px; overflow: hidden; color: var(--wf-text); font-weight: 700; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.table-primary-link:hover { color: var(--wf-brand-dark); }
.table-secondary { display: block; max-width: 280px; margin-top: 3px; overflow: hidden; color: var(--wf-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.table-actions { white-space: nowrap; }
.table-actions .btn { min-height: 34px; padding: 6px 10px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--wf-border); }
.result-text { display: block; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .92em; overflow-wrap: anywhere; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 4px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 750; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.status-success { color: #147a58; background: #dcf5ea; }
.status-warning { color: #94620b; background: #fff0c8; }
.status-danger { color: #a63849; background: #fde2e6; }
.status-info { color: #2c64a9; background: #e0ebfb; }
.status-neutral { color: #52646d; background: #edf1f3; }

.filter-bar { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(130px, .65fr)) auto; gap: 10px; padding: 16px; }
.filter-search { position: relative; }
.filter-search .ui-icon { position: absolute; left: 12px; top: 11px; width: 17px; color: var(--wf-muted); }
.filter-search input { padding-left: 38px; }
.form-control, .form-select { min-height: 40px; color: var(--wf-text); background-color: var(--wf-surface); border-color: var(--wf-border); border-radius: 9px; font-size: 13px; }
.form-control:focus, .form-select:focus { border-color: var(--wf-brand); box-shadow: 0 0 0 3px rgba(14,184,174,.12); }
.form-label { color: var(--wf-text); font-size: 12px; font-weight: 700; }
.form-text { color: var(--wf-muted); font-size: 11px; }
.form-section + .form-section { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--wf-border); }
.form-section h3 { margin: 0 0 4px; font-size: 14px; font-weight: 730; }
.form-section > p { margin: 0 0 16px; color: var(--wf-muted); font-size: 12px; }

.status-list { display: grid; gap: 2px; }
.status-list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--wf-border); }
.status-list-row:last-child { border-bottom: 0; }
.status-list-row strong { font-size: 12px; }
.status-list-row small { display: block; margin-top: 3px; color: var(--wf-muted); font-size: 10.5px; }

.version-bar { margin-bottom: 15px; }
.version-bar:last-child { margin-bottom: 0; }
.version-bar-header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 11px; }
.version-bar-header span:first-child { max-width: 75%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; background: var(--wf-canvas); }
.progress-bar { background: linear-gradient(90deg, var(--wf-brand-dark), var(--wf-brand)); }

.empty-state, .empty-page { display: grid; place-items: center; min-height: 270px; padding: 40px; text-align: center; }
.empty-page { min-height: 62vh; }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 14px; color: var(--wf-brand-dark); background: #ddf5f2; border-radius: 16px; }
.empty-icon .ui-icon { width: 27px; height: 27px; }
.empty-state h3, .empty-page h2 { margin: 0; font-size: 18px; }
.empty-state p, .empty-page p { max-width: 460px; margin: 8px 0 18px; color: var(--wf-muted); font-size: 13px; }

.device-header-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 20px; margin-bottom: 20px; }
.device-identity { display: flex; align-items: center; gap: 15px; min-width: 0; }
.device-glyph { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto; color: var(--wf-brand-dark); background: #ddf5f2; border-radius: 13px; }
.device-glyph .ui-icon { width: 25px; height: 25px; }
.device-identity h2 { max-width: 600px; margin: 0 0 5px; overflow: hidden; font-size: 18px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.device-meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--wf-muted); font-size: 11.5px; }
.device-meta-line .separator::before { margin-right: 8px; content: "·"; }
.device-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.detail-tabs { margin-bottom: 20px; padding: 0 6px; background: var(--wf-surface); border: 1px solid var(--wf-border); border-radius: 12px; box-shadow: var(--wf-shadow); }
.detail-tabs .nav-link { min-height: 48px; padding: 14px 13px 11px; color: var(--wf-muted); border: 0; border-bottom: 3px solid transparent; border-radius: 0; font-size: 12px; font-weight: 700; }
.detail-tabs .nav-link.active { color: var(--wf-brand-dark); background: transparent; border-bottom-color: var(--wf-brand); }

.definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.definition-item { padding: 12px 0; border-bottom: 1px solid var(--wf-border); }
.definition-item dt { margin-bottom: 4px; color: var(--wf-muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.definition-item dd { margin: 0; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }

.health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.health-item { padding: 14px; background: var(--wf-canvas); border: 1px solid var(--wf-border); border-radius: 10px; }
.health-item small { display: block; color: var(--wf-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.health-item strong { display: block; margin-top: 6px; font-size: 14px; }

.command-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.command-card { position: relative; display: flex; flex-direction: column; min-height: 190px; padding: 18px; color: var(--wf-text); background: var(--wf-surface); border: 1px solid var(--wf-border); border-radius: 12px; text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.command-card:hover { color: var(--wf-text); border-color: color-mix(in srgb, var(--wf-brand) 55%, var(--wf-border)); box-shadow: var(--wf-shadow); transform: translateY(-2px); }
.command-card.selected { border-color: var(--wf-brand-dark); box-shadow: 0 0 0 2px color-mix(in srgb, var(--wf-brand) 26%, transparent); }
.command-card-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--wf-brand-dark); background: #ddf5f2; border-radius: 10px; }
.command-card h3 { margin: 14px 0 6px; font-size: 13px; font-weight: 750; }
.command-card p { margin: 0 0 12px; color: var(--wf-muted); font-size: 11.5px; line-height: 1.5; }
.command-card .command-example { margin-top: auto; padding-top: 10px; color: var(--wf-muted); border-top: 1px dashed var(--wf-border); font-size: 10.5px; }
.risk-badge { position: absolute; top: 15px; right: 15px; padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.risk-low { color: #147a58; background: #dcf5ea; }
.risk-medium { color: #94620b; background: #fff0c8; }
.risk-high { color: #a63849; background: #fde2e6; }

.command-builder { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 20px; }
.command-help { padding: 16px; color: var(--wf-muted); background: var(--wf-canvas); border: 1px solid var(--wf-border); border-radius: 11px; font-size: 12px; }
.command-help strong { display: block; margin-bottom: 5px; color: var(--wf-text); }
.command-form-section[hidden] { display: none !important; }
.notification-preview { margin-top: 14px; padding: 15px; color: #eaf4f7; background: #102a37; border-left: 4px solid var(--wf-brand); border-radius: 10px; }
.notification-preview strong, .notification-preview span { display: block; }
.notification-preview span { margin-top: 5px; color: #b7cbd1; font-size: 11px; }

.technical-block { padding: 13px; color: var(--wf-muted); background: var(--wf-canvas); border: 1px solid var(--wf-border); border-radius: 9px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.copy-field { display: flex; gap: 8px; }
.copy-field .form-control { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }

.pagination-compact { align-items: center; }
.pagination-summary { color: var(--wf-muted); background: transparent; white-space: nowrap; }

.settings-nav { position: sticky; top: calc(var(--wf-topbar-height) + 20px); }
.settings-nav a { display: block; padding: 9px 11px; color: var(--wf-muted); border-left: 2px solid var(--wf-border); font-size: 12px; text-decoration: none; }
.settings-nav a:hover { color: var(--wf-brand-dark); border-left-color: var(--wf-brand); }

.app-footer { display: flex; justify-content: space-between; gap: 12px; padding: 16px 30px; color: var(--wf-muted); border-top: 1px solid var(--wf-border); font-size: 10.5px; }

.auth-body { min-height: 100vh; background: #071923; }
.auth-shell { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(480px, 1.1fr); min-height: 100vh; }
.auth-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 8vw; overflow: hidden; color: #e9f4f6; background: radial-gradient(circle at 20% 20%, rgba(14,184,174,.28), transparent 30%), linear-gradient(150deg,#0d2a38,#071923); }
.auth-brand-panel::after { position: absolute; right: -130px; bottom: -150px; width: 420px; height: 420px; border: 1px solid rgba(75,213,204,.13); border-radius: 50%; box-shadow: 0 0 0 55px rgba(75,213,204,.025),0 0 0 110px rgba(75,213,204,.018); content: ""; }
.auth-brand-panel .brand-mark { width: 52px; height: 52px; margin-bottom: 36px; font-size: 22px; }
.auth-brand-panel .eyebrow { color: #50d8d0; }
.auth-brand-panel h1 { max-width: 520px; margin: 12px 0 18px; font-size: clamp(34px, 4vw, 58px); font-weight: 760; letter-spacing: -.055em; line-height: 1.02; }
.auth-brand-panel > p:not(.eyebrow) { max-width: 480px; color: #9db7c0; font-size: 14px; line-height: 1.7; }
.auth-feature { display: flex; align-items: center; gap: 10px; margin-top: 34px; color: #9fc2c9; font-size: 12px; }
.auth-feature .ui-icon { color: #4bd5cc; }
.auth-form-panel { display: grid; place-items: center; padding: 40px; background: #f5f8fa; }
.auth-card { width: min(430px, 100%); padding: 40px; color: #17242c; background: #fff; border: 1px solid #e2eaee; border-radius: 18px; box-shadow: 0 18px 55px rgba(7,25,35,.11); }
.auth-card h2 { margin: 0; font-size: 24px; font-weight: 760; letter-spacing: -.03em; }
.auth-card .auth-copy { margin: 7px 0 26px; color: #5f727d; font-size: 12.5px; }
.auth-card .form-control { color: #17242c; background: #fff; border-color: #d7e1e6; }
.auth-card .btn-primary { min-height: 46px; }
.brand-mobile { align-items: center; gap: 10px; margin-bottom: 28px; }

[data-bs-theme="dark"] .metric-icon,
[data-bs-theme="dark"] .device-glyph,
[data-bs-theme="dark"] .command-card-icon,
[data-bs-theme="dark"] .empty-icon { color: #4bd5cc; background: #103a42; }
[data-bs-theme="dark"] .status-success { color: #78ddb6; background: #103a31; }
[data-bs-theme="dark"] .status-warning { color: #f3c56b; background: #3a2e12; }
[data-bs-theme="dark"] .status-danger { color: #f19aaa; background: #3b1e26; }
[data-bs-theme="dark"] .status-info { color: #8dbaf4; background: #172e4b; }
[data-bs-theme="dark"] .status-neutral { color: #a2b3ba; background: #1b323c; }
[data-bs-theme="dark"] .risk-low { color: #78ddb6; background: #103a31; }
[data-bs-theme="dark"] .risk-medium { color: #f3c56b; background: #3a2e12; }
[data-bs-theme="dark"] .risk-high { color: #f19aaa; background: #3b1e26; }
[data-bs-theme="dark"] .avatar { color: #78ddd6; background: #123a42; border-color: #22545c; }
[data-bs-theme="dark"] :focus-visible { outline-color: #52ded5 !important; }

@media (max-width: 1199.98px) {
    .environment-badge { display: none; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar { grid-template-columns: 1fr 1fr 1fr; }
    .filter-search { grid-column: span 2; }
    .command-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .app-frame { margin-left: 0; }
    .app-topbar { padding: 0 18px; }
    .app-content { padding: 24px 18px; }
    .content-grid, .content-grid.equal, .command-builder { grid-template-columns: 1fr; }
    .settings-nav { position: static; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
    .brand-mobile { display: flex !important; }
}

@media (max-width: 767.98px) {
    .page-heading { align-items: stretch; flex-direction: column; margin-bottom: 18px; }
    .page-actions { justify-content: flex-start; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .metric-card { min-height: 112px; padding: 15px; }
    .metric-card .metric-value { font-size: 23px; }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .filter-search { grid-column: 1 / -1; }
    .filter-actions { grid-column: 1 / -1; }
    .command-catalog { grid-template-columns: 1fr; }
    .command-card { min-height: 165px; }
    .definition-grid, .health-grid { grid-template-columns: 1fr 1fr; }
    .device-header-card { align-items: flex-start; flex-direction: column; }
    .device-header-actions { justify-content: flex-start; }
    .table-footer { align-items: flex-start; flex-direction: column; }
    .app-footer { padding: 16px 18px; }
}

@media (max-width: 575.98px) {
    .app-topbar { height: 64px; padding: 0 12px; }
    .app-content { padding: 20px 12px; }
    .profile-trigger > span:last-child { display: none !important; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 102px; }
    .metric-card .metric-label { margin-top: 10px; }
    .filter-bar { grid-template-columns: 1fr; padding: 12px; }
    .filter-search, .filter-actions { grid-column: auto; }
    .definition-grid, .health-grid { grid-template-columns: 1fr; }
    .detail-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .detail-tabs .nav-link { white-space: nowrap; }
    .auth-form-panel { padding: 18px; }
    .auth-card { padding: 26px 22px; }
    .app-footer { align-items: flex-start; flex-direction: column; }
}

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