:root {
    --bg: #eef3f4;
    --bg-deep: #dce8e7;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-hi: rgba(255, 255, 255, 0.96);
    --surface-strong: #ffffff;
    --surface-soft: rgba(245, 249, 248, 0.9);
    --ink: #102128;
    --ink-2: #3a5460;
    --muted: #64737a;
    --line: rgba(36, 62, 66, 0.14);
    --brand: #006d77;
    --brand-strong: #03464d;
    --brand-soft: rgba(0, 109, 119, 0.10);
    --brand-soft-solid: #d7f2ef;
    --accent: #d97706;
    --accent-soft: rgba(217, 119, 6, 0.10);
    --accent-strong: #92400e;
    --danger: #b42318;
    --danger-soft: rgba(180, 35, 24, 0.10);
    --ok: #047857;
    --ok-soft: rgba(4, 120, 87, 0.10);
    --warning: #b7791f;
    --warn-soft: rgba(183, 121, 31, 0.10);
    --shadow: 0 24px 70px rgba(16, 33, 40, 0.12);
    --shadow-soft: 0 12px 34px rgba(16, 33, 40, 0.08);
    --shadow-sm: 0 8px 28px rgba(16, 33, 40, 0.08);
    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --font-ui: "Segoe UI", "Arial", sans-serif;
    --font-body: "Segoe UI", "Arial", sans-serif;
    --font-mono: "Cascadia Mono", "Consolas", monospace;
    --sidebar-w: 240px;
    --topbar-h: 60px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    font-family: var(--font-body);
    background:
        radial-gradient(ellipse at 8% 6%, rgba(0, 109, 119, 0.15) 0, transparent 40%),
        radial-gradient(ellipse at 94% 8%, rgba(217, 119, 6, 0.12) 0, transparent 36%),
        linear-gradient(165deg, var(--bg), var(--bg-deep));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(16, 33, 40, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 33, 40, 0.035) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 80%);
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    color: var(--brand-strong);
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 0.9rem 0.75rem;
    gap: 0.08rem;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.55rem 1rem;
    text-decoration: none;
    border: none;
    background: none;
    min-width: unset;
    min-height: unset;
    border-radius: 0;
    box-shadow: none;
    font-size: unset;
}

.sidebar .brand:hover {
    transform: none;
    box-shadow: none;
    background: none;
    border-color: transparent;
}

.brand-mark-sq {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #0e9b88 60%, var(--accent));
    box-shadow: 0 8px 20px rgba(0, 109, 119, 0.28);
    flex-shrink: 0;
}

.brand-name {
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.brand-sub {
    font-size: 0.67rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: -2px;
}

.nav-section-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.7rem 0.55rem 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 0.6rem;
    border-radius: var(--radius-xs);
    color: var(--ink-2);
    font-weight: 500;
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: background 150ms, color 150ms;
    position: relative;
    min-height: unset;
    box-shadow: none;
    letter-spacing: normal;
}

.nav-item:hover {
    background: var(--brand-soft);
    color: var(--brand);
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.nav-item.active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: -0.8rem;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
}

.nav-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    flex-shrink: 0;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 0.8rem 0.55rem 0;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    flex-shrink: 0;
}

.sidebar-user {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.66rem;
    color: var(--muted);
}

.sidebar-logout {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: var(--muted);
    cursor: pointer;
    transition: background 150ms, color 150ms;
    flex-shrink: 0;
}

.sidebar-logout:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ── Main shell ── */
.shell {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.shell-guest {
    margin-left: 0;
}

/* ── Topbar ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0 1.4rem;
    border-bottom: 1px solid var(--line);
    background: rgba(238, 243, 244, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-shrink: 0;
}

/* topbar when sidebar is NOT shown (guest) */
.shell-guest .topbar {
    justify-content: space-between;
    padding: 0 1.4rem;
}

.brand-lockup {
    min-width: max-content;
}

/* ── Topbar breadcrumb & actions ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--muted);
    flex: 1;
    min-width: 0;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--brand);
}

.breadcrumb-sep {
    opacity: 0.4;
}

.breadcrumb strong {
    color: var(--ink);
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

/* ── New btn system (sidebar/topbar; page templates keep .button) ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-hi);
    color: var(--ink);
    font: 600 0.78rem var(--font-body);
    cursor: pointer;
    text-decoration: none;
    transition: transform 160ms, box-shadow 160ms, border-color 160ms, background 160ms;
    white-space: nowrap;
    letter-spacing: normal;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 109, 119, 0.22);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), #0e9b88 60%, #0891b2);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 109, 119, 0.22);
}

.btn-primary:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-strong), var(--brand), #0e9b88);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--brand-soft);
    border-color: transparent;
    box-shadow: none;
    color: var(--brand);
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
    position: relative;
}

.btn-danger {
    border-color: rgba(180, 35, 24, 0.2);
    color: var(--danger);
    background: var(--danger-soft);
}

/* Theme toggle in topbar */
.theme-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-hi);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 160ms;
    color: var(--ink);
}

.theme-btn:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.62rem;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.brand-mark {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent),
        linear-gradient(135deg, var(--brand), #0f766e 55%, var(--accent));
    box-shadow: 0 8px 20px rgba(0, 109, 119, 0.28);
}

.brand-subtitle {
    display: block;
    margin: 0.1rem 0 0 3rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

/* ── Nav link shared base ── */
.nav-link,
.button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    min-height: 38px;
    padding: 0.48rem 0.82rem;
    border: 1px solid rgba(16, 33, 40, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.nav-link svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 160ms ease;
}

.nav-link:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 109, 119, 0.24);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 28px rgba(16, 33, 40, 0.1);
    color: var(--brand-strong);
}

.nav-link:hover svg {
    opacity: 1;
}

/* Active state */
.nav-active {
    border-color: rgba(0, 109, 119, 0.28);
    background: linear-gradient(135deg, rgba(0, 109, 119, 0.1), rgba(255, 255, 255, 0.82));
    color: var(--brand-strong);
    font-weight: 800;
}

.nav-active svg {
    opacity: 1;
}

/* Icon-only buttons */
.nav-icon-only {
    padding: 0.48rem;
    width: 38px;
}

.nav-icon-only span:not(.notification-badge) {
    display: none;
}

/* Divider */
.nav-divider {
    width: 1px;
    height: 22px;
    background: rgba(16, 33, 40, 0.12);
    margin: 0 0.15rem;
    flex-shrink: 0;
}

/* Theme toggle — show correct icon */
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

/* Logout */
.nav-logout:hover {
    border-color: rgba(180, 35, 24, 0.24);
    background: rgba(254, 242, 242, 0.82);
    color: var(--danger);
}

/* User pill */
.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    border: 1px solid rgba(0, 109, 119, 0.18);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(0, 109, 119, 0.08), rgba(255,255,255,0.6));
}

.user-avatar {
    display: inline-grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), #0f766e);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand-strong);
}

/* theme-toggle is also a nav-link */
.theme-toggle {
    cursor: pointer;
}

.button-primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--brand), #0f766e 58%, #0e7490);
    color: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 109, 119, 0.24);
    font-weight: 800;
}

.button-primary:hover {
    color: #ffffff;
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--brand-strong), var(--brand), #0e7490);
    box-shadow: 0 16px 36px rgba(0, 109, 119, 0.32);
}

.button-secondary {
    border-color: rgba(217, 119, 6, 0.3);
    background: linear-gradient(135deg, #fff7ed, #ffffff);
    color: var(--accent-strong);
}

/* .shell override removed — defined above with sidebar layout */
.content {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.page-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-title h1 {
    margin: 0;
    max-width: 780px;
    font-family: var(--font-ui);
    font-size: clamp(2rem, 4vw, 4.6rem);
    line-height: 0.96;
    letter-spacing: -0.07em;
}

.hero-panel {
    position: relative;
    min-height: 280px;
    overflow: hidden;
    padding: clamp(1.1rem, 3vw, 2.1rem);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 30px;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.92), rgba(235, 248, 247, 0.76)),
        radial-gradient(circle at 75% 35%, rgba(0, 109, 119, 0.16), transparent 22rem);
    box-shadow: var(--shadow);
}

.hero-panel::after {
    content: "";
    position: absolute;
    width: 480px;
    height: 480px;
    right: -160px;
    bottom: -230px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.28), transparent 62%);
}

.hero-copy,
.actions,
.hero-visual {
    position: relative;
    z-index: 1;
}

.hero-lead {
    max-width: 660px;
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.55;
}

.actions {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.signal-strip {
    display: inline-grid;
    grid-template-columns: repeat(3, auto auto);
    gap: 0.5rem 0.8rem;
    align-items: center;
    margin-top: 1.25rem;
    padding: 0.72rem 0.85rem;
    border: 1px solid rgba(0, 109, 119, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-soft);
}

.signal-strip span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.signal-strip strong {
    color: var(--brand-strong);
    font-family: var(--font-ui);
    font-size: 1rem;
}

.signal-danger {
    color: var(--danger);
    font-weight: 900;
}

.hero-visual {
    flex: 0 0 280px;
    align-self: center;
}

.orbital-map {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 18%, transparent 19%),
        radial-gradient(circle, rgba(0, 109, 119, 0.12), rgba(255, 255, 255, 0.24));
}

.orbit {
    position: absolute;
    inset: 20px;
    border: 1px dashed rgba(0, 109, 119, 0.32);
    border-radius: 50%;
    animation: orbit-spin 18s linear infinite;
}

.orbit-two {
    inset: 55px;
    border-color: rgba(217, 119, 6, 0.38);
    animation-direction: reverse;
    animation-duration: 12s;
}

.node {
    position: absolute;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 16px;
    color: #ffffff;
    font-family: var(--font-ui);
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(16, 33, 40, 0.16);
}

.node-core {
    inset: 100px auto auto 102px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--brand), #0f766e);
}

.node-one {
    top: 20px;
    left: 102px;
    background: #0e7490;
}

.node-two {
    right: 20px;
    top: 118px;
    background: var(--accent);
}

.node-three {
    left: 25px;
    bottom: 42px;
    background: #334155;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.metric-grid,
.module-grid,
.layout-two,
.layout-three {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
}

.module-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.layout-two {
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.8fr);
}

.layout-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric,
.module,
.panel {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.metric::before,
.module::before,
.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.52), transparent 40%);
}

.metric {
    min-height: 118px;
    padding: 1rem;
}

.metric::after {
    content: "";
    position: absolute;
    right: 1rem;
    bottom: 0.9rem;
    width: 58px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    opacity: 0.75;
}

.metric span,
.module p,
.list-row span,
.detail-grid span {
    color: var(--muted);
}

.metric strong {
    display: block;
    margin-top: 0.35rem;
    font-family: var(--font-ui);
    font-size: clamp(1.8rem, 3vw, 2.55rem);
    line-height: 1;
    letter-spacing: -0.06em;
}

.metric-accent {
    background: linear-gradient(135deg, rgba(0, 109, 119, 0.94), rgba(15, 118, 110, 0.88));
    color: #ffffff;
}

.metric-accent span {
    color: rgba(255, 255, 255, 0.78);
}

.metric-accent strong {
    color: #ffffff;
}

.metric-accent small {
    color: rgba(255, 255, 255, 0.68);
}

.metric-online {
    background: linear-gradient(135deg, rgba(4, 120, 87, 0.14), rgba(255, 255, 255, 0.84));
}

.metric-warning {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.16), rgba(255, 255, 255, 0.84));
}

.metric-danger {
    background: linear-gradient(135deg, rgba(180, 35, 24, 0.16), rgba(255, 255, 255, 0.84));
}

.module {
    min-height: 150px;
    padding: 1.05rem 1.05rem 1.2rem;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.module:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 109, 119, 0.28);
    box-shadow: var(--shadow);
}

.module::after {
    content: attr(data-icon);
    position: absolute;
    right: 1rem;
    top: 0.75rem;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 15px;
    color: #ffffff;
    font-family: var(--font-ui);
    font-size: 1.1rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 14px 28px rgba(0, 109, 119, 0.18);
}

.module-link {
    display: block;
    color: var(--ink);
}

.module h2,
.panel h2 {
    position: relative;
    margin: 0;
    padding-right: 3rem;
    font-family: var(--font-ui);
    font-size: 1.06rem;
    letter-spacing: -0.03em;
}

.module p {
    position: relative;
    margin: 0.55rem 0 0;
    max-width: 92%;
    font-size: 0.92rem;
    line-height: 1.55;
}

.panel {
    padding: 1.05rem;
}

.muted {
    color: var(--muted);
    line-height: 1.5;
}

.small {
    font-size: 0.82rem;
}

.alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    background: #fef2f2;
    color: var(--danger);
    font-weight: 800;
    margin-bottom: 0.8rem;
}

.alert-danger {
    border-color: rgba(180, 35, 24, 0.28);
    background: rgba(254, 242, 242, 0.9);
    color: var(--danger);
}

.alert-success {
    border-color: rgba(4, 120, 87, 0.24);
    background: rgba(236, 253, 245, 0.95);
    color: #047857;
}

/* ── Health issue list ── */
.health-issue-list {
    display: grid;
    gap: 0.5rem;
}

.health-issue {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.72rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.health-issue-ok {
    border-color: rgba(4, 120, 87, 0.2);
    background: rgba(236, 253, 245, 0.7);
}

.health-issue-warning {
    border-color: rgba(183, 121, 31, 0.24);
    background: rgba(255, 247, 237, 0.8);
}

.health-issue-critical {
    border-color: rgba(180, 35, 24, 0.24);
    background: rgba(254, 242, 242, 0.8);
}

.health-issue-severity {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    padding: 2px 7px;
    border-radius: 999px;
}

.health-issue-ok .health-issue-severity { background: rgba(4, 120, 87, 0.14); color: var(--ok); }
.health-issue-warning .health-issue-severity { background: rgba(183, 121, 31, 0.16); color: var(--warning); }
.health-issue-critical .health-issue-severity { background: rgba(180, 35, 24, 0.14); color: var(--danger); }

.health-issue > div { flex: 1; }
.health-issue > div strong { display: block; font-size: 0.88rem; }
.health-issue > div span { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* ── Security checks ── */
.security-checks {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.2rem;
}

.security-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.security-check > div { flex: 1; }
.security-check > div strong { display: block; font-size: 0.88rem; }
.security-check > div span { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.security-check > svg { flex-shrink: 0; }

.security-check-ok {
    border-color: rgba(4, 120, 87, 0.2);
    background: rgba(236, 253, 245, 0.7);
    color: var(--ok);
}
.security-check-warning {
    border-color: rgba(183, 121, 31, 0.24);
    background: rgba(255, 247, 237, 0.8);
    color: var(--warning);
}
.security-check-critical {
    border-color: rgba(180, 35, 24, 0.24);
    background: rgba(254, 242, 242, 0.8);
    color: var(--danger);
}
.security-check-ok > div strong,
.security-check-warning > div strong,
.security-check-critical > div strong { color: var(--ink); }

/* ── Login — split layout ── */
.login-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 8%, rgba(0, 109, 119, 0.18), transparent 32rem),
        radial-gradient(circle at 92% 10%, rgba(217, 119, 6, 0.16), transparent 30rem),
        linear-gradient(145deg, var(--bg), var(--bg-deep));
}

.login-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* Left brand panel */
.login-brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: linear-gradient(145deg, var(--brand-strong) 0%, var(--brand) 55%, #0e7490 100%);
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.92);
    max-width: 380px;
}

.login-brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 2rem;
    color: #ffffff;
    font-family: var(--font-ui);
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.login-brand-headline {
    margin: 0 0 2rem;
    font-family: var(--font-ui);
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.05em;
    color: #ffffff;
}

.login-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.login-feature-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
}

.login-feature-icon {
    display: inline-grid;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

/* Decorative orb on brand panel */
.login-orb {
    position: absolute;
    width: 480px;
    height: 480px;
    right: -160px;
    bottom: -200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 62%);
    pointer-events: none;
}

/* Right form panel */
.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(20px);
}

.login-form-inner {
    width: min(400px, 100%);
}

.login-form-header {
    margin-bottom: 1.75rem;
}

.login-title {
    margin: 0.35rem 0 0.5rem;
    font-family: var(--font-ui);
    font-size: 2.2rem;
    letter-spacing: -0.06em;
}

.login-subtitle {
    margin: 0;
    line-height: 1.55;
}

.login-alert {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1.1rem;
}

/* Input with leading icon */
.login-field > span {
    display: block;
    margin-bottom: 0.32rem;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.input-wrap input {
    padding-left: 2.5rem;
}

.login-form {
    gap: 1rem;
    margin-bottom: 1rem;
}

.login-submit {
    width: 100%;
    margin-top: 0.5rem;
    gap: 0.5rem;
    min-height: 46px;
    font-size: 0.95rem;
}

.login-help {
    margin: 0;
    text-align: center;
}

/* Responsive — stack on small screens */
@media (max-width: 800px) {
    .login-split {
        grid-template-columns: 1fr;
    }
    .login-brand-panel {
        min-height: 240px;
        padding: 2rem 1.5rem;
    }
    .login-brand-headline {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }
    .login-feature-list {
        display: none;
    }
}

/* Legacy single-card fallback (unused but kept for compat) */
.login-shell { width: min(460px, 100%); }
.login-card {
    padding: 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}
.login-card h1 {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 2.1rem;
    letter-spacing: -0.06em;
}

.form-stack,
.form-grid {
    display: grid;
    gap: 0.75rem;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.inline-form select {
    min-width: 140px;
}

.login-switch {
    justify-content: stretch;
    margin: 0.85rem 0;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full,
.form-grid button {
    grid-column: 1 / -1;
}

.form-choice-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 42px;
    margin: 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.72);
}

.form-choice-group legend {
    padding: 0 0.25rem;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.choice-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    white-space: nowrap;
}

.choice-dot input {
    width: auto;
    min-height: 0;
    accent-color: var(--brand);
}

.choice-dot span {
    margin: 0;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.compact-choice-group {
    align-self: end;
    justify-content: flex-start;
    gap: 0.45rem;
    min-height: 36px;
    padding: 0.35rem 0.55rem;
}

.compact-choice-group legend {
    font-size: 0.66rem;
}

.compact-choice-group .choice-dot {
    gap: 0.25rem;
}

.compact-choice-group .choice-dot input {
    transform: scale(0.82);
}

.compact-choice-group .choice-dot span {
    font-size: 0.74rem;
}

label span {
    display: block;
    margin-bottom: 0.28rem;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(16, 33, 40, 0.16);
    border-radius: 14px;
    outline: none;
    background: rgba(255, 255, 255, 0.86);
    color: var(--ink);
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(0, 109, 119, 0.55);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 109, 119, 0.12);
}

textarea {
    min-height: 92px;
    resize: vertical;
}

.section-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.table-wrap {
    position: relative;
    overflow-x: auto;
    border: 1px solid rgba(16, 33, 40, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
}

table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
}

.software-table {
    min-width: 1320px;
}

.excel-grid-wrap {
    max-width: 100%;
    overflow: auto;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 252, 251, 0.7));
}

.excel-grid {
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.excel-grid th,
.excel-grid td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid rgba(16, 33, 40, 0.08);
}

.excel-grid th:last-child,
.excel-grid td:last-child {
    border-right: 0;
}

.excel-grid thead th {
    box-shadow: 0 1px 0 rgba(16, 33, 40, 0.08);
}

.excel-grid th {
    min-width: 96px;
    position: sticky;
}

.excel-grid th button {
    width: calc(100% - 10px);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.column-resize-handle {
    position: absolute;
    top: 0;
    right: -4px;
    z-index: 3;
    width: 10px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
}

.column-resize-handle::after {
    content: "";
    position: absolute;
    top: 22%;
    right: 4px;
    width: 1px;
    height: 56%;
    background: rgba(0, 109, 119, 0.18);
    transition: background 140ms ease, width 140ms ease;
}

.column-resize-handle:hover::after,
.excel-grid-resizing .column-resize-handle::after {
    width: 2px;
    background: var(--brand);
}

.excel-grid-resizing,
.excel-grid-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

.diagnostics-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
    gap: 1rem;
}

.diagnostic-command-list {
    display: grid;
    gap: 0.65rem;
}

.diagnostic-command {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid rgba(0, 109, 119, 0.14);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.diagnostic-command:hover,
.diagnostic-command.active {
    transform: translateY(-1px);
    border-color: rgba(0, 109, 119, 0.38);
    box-shadow: 0 12px 28px rgba(16, 33, 40, 0.1);
}

.diagnostic-command strong,
.diagnostic-command span {
    display: block;
}

.diagnostic-command span {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.diagnostic-terminal-panel {
    min-width: 0;
}

.safe-terminal-output {
    min-height: 360px;
    max-height: 580px;
    overflow: auto;
    margin: 0;
    padding: 1rem;
    border: 1px solid rgba(0, 109, 119, 0.18);
    border-radius: 18px;
    background:
        radial-gradient(circle at 12% 0%, rgba(20, 184, 166, 0.12), transparent 18rem),
        #0b1720;
    color: #d9f99d;
    font-family: "Cascadia Mono", "Consolas", monospace;
    font-size: 0.86rem;
    line-height: 1.65;
    white-space: pre-wrap;
}

@media (max-width: 900px) {
    .diagnostics-layout {
        grid-template-columns: 1fr;
    }
}

th,
td {
    padding: 0.8rem;
    border-top: 1px solid rgba(16, 33, 40, 0.08);
    text-align: left;
    vertical-align: top;
    font-size: 0.9rem;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-top: 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(245, 249, 248, 0.94);
}

tbody tr {
    transition: background 150ms ease;
}

tbody tr:hover {
    background: rgba(215, 242, 239, 0.42);
}

td > span {
    display: block;
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.2rem 0.6rem;
    border: 1px solid rgba(4, 120, 87, 0.12);
    border-radius: 999px;
    background: #e7f5ef;
    color: var(--ok);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: capitalize;
}

.list {
    display: grid;
    gap: 0.6rem;
}

.list.compact {
    gap: 0.45rem;
}

.list-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.78rem;
    border: 1px solid rgba(16, 33, 40, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.64);
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.list-row:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-soft);
}

.list-row strong,
.list-row span {
    display: block;
}

.list-row strong {
    margin-bottom: 0.18rem;
    font-family: var(--font-ui);
}

.list-row > span {
    white-space: nowrap;
}

.empty {
    padding: 0.95rem;
    border: 1px dashed rgba(16, 33, 40, 0.18);
    border-radius: 16px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.58);
}

.asset-top {
    align-items: stretch;
}

.qr-panel img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    border: 1px solid rgba(16, 33, 40, 0.12);
    border-radius: 16px;
    background: #ffffff;
    padding: 14px;
}

.owner-summary {
    border: 1px solid rgba(0, 119, 128, 0.22);
    background:
        radial-gradient(circle at top left, rgba(0, 119, 128, 0.13), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(241, 248, 247, 0.9));
}

.owner-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.owner-chip {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(14, 116, 144, 0.18);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.76);
    color: #31525c;
    font-size: 0.9rem;
}

.owner-chip-avatar {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), #0f766e);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 900;
    flex-shrink: 0;
}

.owner-chip-dept {
    color: var(--muted);
    font-size: 0.78rem;
}

.success-banner {
    border: 1px solid rgba(22, 163, 74, 0.24);
    border-radius: 18px;
    margin-bottom: 18px;
    padding: 14px 18px;
    background: #ecfdf3;
    color: #166534;
    font-weight: 700;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.6rem;
}

.detail-grid div {
    padding: 0.78rem;
    border: 1px solid rgba(16, 33, 40, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
}

.detail-grid span {
    display: block;
    margin-bottom: 0.26rem;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.detail-grid strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 0.95rem;
}

.storage-panel {
    margin-bottom: 0.9rem;
}

.drive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.85rem;
}

.drive-card {
    position: relative;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    min-height: 108px;
    padding: 0.9rem;
    border: 1px solid rgba(16, 33, 40, 0.1);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(244, 248, 249, 0.78)),
        radial-gradient(circle at 92% 15%, rgba(0, 109, 119, 0.12), transparent 12rem);
    box-shadow: 0 12px 28px rgba(16, 33, 40, 0.06);
}

.drive-icon {
    position: relative;
    width: 50px;
    height: 38px;
    border-radius: 6px 6px 9px 9px;
    background:
        linear-gradient(180deg, #f8fafc 0 34%, #cfd8df 35% 100%);
    box-shadow:
        inset 0 -5px 0 rgba(16, 33, 40, 0.12),
        0 10px 18px rgba(16, 33, 40, 0.1);
}

.drive-icon::before {
    content: "";
    position: absolute;
    left: 6px;
    bottom: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.drive-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.42rem;
}

.drive-title strong {
    font-family: var(--font-ui);
    letter-spacing: -0.02em;
}

.drive-title span,
.drive-info p {
    color: var(--muted);
    font-size: 0.82rem;
}

.drive-bar {
    height: 16px;
    overflow: hidden;
    border: 1px solid rgba(16, 33, 40, 0.18);
    border-radius: 2px;
    background: linear-gradient(180deg, #f3f4f6, #d9dee3);
}

.drive-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(180deg, #2aa8f2, #0b76d1);
    transition: width 420ms ease;
}

.drive-info p {
    margin: 0.38rem 0 0;
}

.drive-warning .drive-bar span {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.drive-low {
    border-color: rgba(180, 35, 24, 0.28);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(254, 242, 242, 0.9)),
        radial-gradient(circle at 90% 12%, rgba(180, 35, 24, 0.12), transparent 12rem);
}

.drive-low .drive-bar span {
    background: linear-gradient(180deg, #ef4444, #b42318);
}

.drive-low .drive-title strong {
    color: var(--danger);
}

code {
    display: inline-block;
    max-width: 360px;
    overflow-wrap: anywhere;
    padding: 0.18rem 0.38rem;
    border: 1px solid rgba(16, 33, 40, 0.08);
    border-radius: 8px;
    background: rgba(238, 242, 247, 0.9);
    color: #334155;
    font-family: "Cascadia Mono", "Consolas", monospace;
    font-size: 0.78rem;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    display: inline-grid;
    min-width: 17px;
    height: 17px;
    place-items: center;
    padding: 0 0.28rem;
    border: 1.5px solid rgba(255,255,255,0.8);
    border-radius: 999px;
    background: var(--danger);
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 900;
}

.kpi-sections {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.infra-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.9rem;
    margin: 0.9rem 0;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 0.75rem;
    margin: 0.9rem 0;
}

.kpi-link {
    color: inherit;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.kpi-link:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 109, 119, 0.28);
    box-shadow: 0 18px 40px rgba(16, 33, 40, 0.12);
}

.kpi-link small {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.dashboard-panels {
    align-items: stretch;
}

.location-pill-grid,
.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 0.65rem;
}

.location-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.62);
    color: inherit;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.location-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(16, 33, 40, 0.1);
}

.location-pill span {
    color: var(--muted);
    font-weight: 900;
}

.location-pill strong {
    font-family: var(--font-display);
    font-size: 1.25rem;
}

/* Compact variant for 3-column layout */
.location-pill-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .45rem;
}
.location-pill--compact {
    padding: .5rem .75rem;
}
.location-pill--compact span { font-size: .72rem; }
.location-pill--compact strong { font-size: 1rem; }

.analytics-row {
    align-items: start;
}

.chart-list {
    display: grid;
    gap: 0.65rem;
}

.chart-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.75rem;
    align-items: center;
}

.chart-row span {
    overflow: hidden;
    color: var(--muted);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-row strong {
    font-family: var(--font-ui);
}

.chart-row div {
    grid-column: 1 / -1;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(16, 33, 40, 0.08);
}

.chart-row i {
    display: block;
    height: 100%;
    min-width: 3px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

.report-command-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
    gap: 0.9rem;
    align-items: start;
}

.report-sidebar {
    position: sticky;
    top: calc(var(--topbar-h) + 0.9rem);
    display: grid;
    gap: 0.9rem;
}

.side-filter-list {
    display: grid;
    gap: 0.55rem;
}

.side-filter-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.72rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.66);
    color: inherit;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.side-filter-list a:hover,
.compact-chart-list a:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(16, 33, 40, 0.1);
}

.side-filter-list span {
    color: var(--muted);
    font-weight: 900;
}

.side-filter-list strong {
    font-family: var(--font-ui);
    font-size: 1.2rem;
}

.compact-chart-list a {
    color: inherit;
    text-decoration: none;
    padding: 0.35rem;
    border-radius: 14px;
}

.admin-lifecycle {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
}

.health-score {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 0.8rem;
}

.health-score strong {
    display: grid;
    width: 88px;
    height: 88px;
    place-items: center;
    border: 8px solid rgba(0, 109, 119, 0.18);
    border-radius: 50%;
    color: var(--brand-strong);
    font-family: var(--font-ui);
    font-size: 1.75rem;
}

.health-score span {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.5;
}

.kpi-section {
    padding: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.kpi-section .metric-grid {
    margin-bottom: 0;
}

.quick-actions {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin: 0.85rem 0;
}

.quick-launch {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 0.55rem;
    margin: 0.85rem 0;
}

.quick-tile {
    display: grid;
    gap: 0.28rem;
    min-height: 86px;
    padding: 0.75rem;
    border: 1px solid rgba(16, 33, 40, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--ink);
}

.quick-tile strong {
    font-family: var(--font-ui);
}

.quick-tile span {
    color: var(--muted);
    font-size: 0.78rem;
}

.empty-state {
    display: grid;
    gap: 0.75rem;
    justify-items: start;
    padding: 1.1rem;
    border: 1px dashed rgba(0, 109, 119, 0.28);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(235, 248, 247, 0.7)),
        radial-gradient(circle at 90% 10%, rgba(217, 119, 6, 0.14), transparent 16rem);
}

.empty-illustration {
    width: 82px;
    height: 58px;
    border: 2px solid rgba(0, 109, 119, 0.3);
    border-radius: 18px;
    background:
        linear-gradient(90deg, rgba(0, 109, 119, 0.18) 20%, transparent 20% 34%, rgba(217, 119, 6, 0.2) 34% 54%, transparent 54%),
        rgba(255, 255, 255, 0.7);
}

.checklist {
    display: grid;
    gap: 0.45rem;
    margin: 0.4rem 0 0;
}

.checklist span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    font-weight: 800;
}

.checklist span::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand);
}

.required::after {
    content: " *";
    color: var(--danger);
}

.field-error {
    display: block;
    margin-top: 0.24rem;
    color: var(--danger);
    font-size: 0.76rem;
    font-weight: 800;
}

.input-error {
    border-color: rgba(180, 35, 24, 0.65) !important;
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1) !important;
}

.bulk-bar {
    position: sticky;
    top: calc(var(--topbar-h) + 8px);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(0, 109, 119, 0.22);
    border-radius: 999px;
    background: rgba(230, 243, 241, 0.96);
    box-shadow: var(--shadow-soft);
}

.bulk-bar[hidden] {
    display: none;
}

.bulk-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.mini-button {
    min-height: 30px;
    padding: 0.35rem 0.62rem;
    border: 1px solid rgba(16, 33, 40, 0.12);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: #edf6f4;
    color: var(--brand-strong);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: capitalize;
}

.badge-warning {
    background: #fff7ed;
    color: var(--accent-strong);
}

.badge-danger {
    background: #fef2f2;
    color: var(--danger);
}

.badge-ok {
    background: #e7f5ef;
    color: var(--ok);
}

.badge-muted {
    background: #eef2f7;
    color: var(--muted);
}

.timeline {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.timeline span {
    padding: 0.4rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(16, 33, 40, 0.1);
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.issue-list,
.security-grid {
    display: grid;
    gap: 0.65rem;
    margin: 0.8rem 0;
}

.issue-card,
.security-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    padding: 0.72rem;
    border: 1px solid rgba(16, 33, 40, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.issue-card p,
.security-card p,
.security-card span {
    margin: 0.12rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.issue-critical,
.security-missing {
    border-color: rgba(220, 38, 38, 0.18);
    background: rgba(254, 242, 242, 0.78);
}

.issue-warning {
    border-color: rgba(217, 119, 6, 0.2);
    background: rgba(255, 247, 237, 0.78);
}

.security-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.security-card {
    grid-template-columns: minmax(0, 1fr) auto;
}

.show-more-button {
    margin-top: 0.7rem;
}

.notification-list {
    display: grid;
    gap: 0.75rem;
}

.notification-group {
    padding: 0.75rem;
    border: 1px solid rgba(16, 33, 40, 0.1);
    border-left-width: 3px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.66);
}

.notification-group-danger {
    border-left-color: var(--danger);
}

.notification-group-warning {
    border-left-color: var(--warning);
}

.notif-group-title {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.notif-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-icon-danger {
    background: rgba(180, 35, 24, 0.1);
    color: var(--danger);
}

.notif-icon-warning {
    background: rgba(183, 121, 31, 0.12);
    color: var(--warning);
}

.settings-grid {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 0.9rem;
}

.settings-nav {
    display: grid;
    gap: 0.45rem;
    align-content: start;
}

.settings-nav a {
    padding: 0.62rem 0.75rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--ink);
    font-weight: 900;
}

.settings-section {
    margin-bottom: 0.9rem;
}

.settings-section .table-wrap input {
    min-width: 150px;
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.performance-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem;
    border: 1px solid rgba(16, 33, 40, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
}

.performance-card strong {
    display: block;
    font-size: 1rem;
}

.performance-card span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.perf-spark {
    position: relative;
    width: 74px;
    height: 54px;
    flex: 0 0 auto;
    border: 1px solid rgba(16, 33, 40, 0.22);
    background: linear-gradient(180deg, #ffffff, #f7fbfb);
    overflow: hidden;
}

.perf-spark span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 2px;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.35), rgba(14, 165, 233, 0.92));
}

.perf-memory span {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.35), rgba(37, 99, 235, 0.9));
}

.perf-disk span {
    background: linear-gradient(180deg, rgba(132, 204, 22, 0.35), rgba(77, 124, 15, 0.9));
}

.perf-network span {
    background: linear-gradient(180deg, rgba(236, 72, 153, 0.35), rgba(219, 39, 119, 0.9));
}

.perf-gpu span {
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.35), rgba(126, 34, 206, 0.9));
}

@keyframes orbit-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

:root[data-theme="dark"] {
    --bg: #071316;
    --bg-deep: #0d1f24;
    --surface: rgba(15, 31, 36, 0.86);
    --surface-hi: rgba(20, 40, 49, 0.97);
    --surface-strong: #11272d;
    --surface-soft: rgba(20, 43, 49, 0.9);
    --ink: #eef8f8;
    --ink-2: #8faab3;
    --muted: #9eb3b7;
    --line: rgba(226, 246, 246, 0.08);
    --brand: #22c6b8;
    --brand-strong: #86fff5;
    --brand-soft: rgba(34, 198, 184, 0.12);
    --brand-soft-solid: rgba(34, 198, 184, 0.16);
    --accent: #f59e0b;
    --accent-soft: rgba(245, 158, 11, 0.12);
    --accent-strong: #fbbf24;
    --danger: #fb7185;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --ok: #34d399;
    --ok-soft: rgba(52, 211, 153, 0.12);
    --warning: #fbbf24;
    --warn-soft: rgba(245, 158, 11, 0.12);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.24);
    --shadow-sm: 0 8px 28px rgba(0, 0, 0, 0.25);
}

:root[data-theme="dark"] body {
    background:
        radial-gradient(circle at 12% 8%, rgba(34, 198, 184, 0.2), transparent 32rem),
        radial-gradient(circle at 92% 10%, rgba(245, 158, 11, 0.16), transparent 30rem),
        linear-gradient(145deg, var(--bg), var(--bg-deep));
}

:root[data-theme="dark"] .topbar {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: rgba(7, 19, 22, 0.88);
}

:root[data-theme="dark"] .sidebar {
    background: rgba(11, 26, 31, 0.88);
    border-right-color: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .nav-item {
    color: var(--ink-2);
}

:root[data-theme="dark"] .sidebar-bottom {
    border-top-color: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .btn,
:root[data-theme="dark"] .theme-btn {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(15, 31, 36, 0.8);
    color: var(--ink);
}

:root[data-theme="dark"] .btn-ghost {
    background: transparent;
    border-color: transparent;
}

:root[data-theme="dark"] .btn-ghost:hover {
    background: var(--brand-soft);
}

:root[data-theme="dark"] .sync-status {
    background: rgba(15, 31, 36, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .nav-link,
:root[data-theme="dark"] .button,
:root[data-theme="dark"] .quick-tile,
:root[data-theme="dark"] .list-row,
:root[data-theme="dark"] .detail-grid div,
:root[data-theme="dark"] .performance-card,
:root[data-theme="dark"] .notification-group {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(15, 31, 36, 0.8);
    color: var(--ink);
}

:root[data-theme="dark"] .nav-active {
    background: linear-gradient(135deg, rgba(34, 198, 184, 0.18), rgba(15, 31, 36, 0.84));
    border-color: rgba(34, 198, 184, 0.3);
    color: var(--brand-strong);
}

:root[data-theme="dark"] .user-pill {
    border-color: rgba(34, 198, 184, 0.2);
    background: rgba(15, 31, 36, 0.7);
}

:root[data-theme="dark"] .nav-divider {
    background: rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .nav-logout:hover {
    background: rgba(127, 29, 29, 0.3);
}

:root[data-theme="dark"] th {
    background: rgba(17, 39, 45, 0.96);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] code {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(8, 20, 24, 0.9);
    color: var(--ink);
}

:root[data-theme="dark"] .login-form-panel {
    background: rgba(10, 22, 26, 0.72);
}

:root[data-theme="dark"] .login-brand-panel {
    background: linear-gradient(145deg, #031b1f 0%, #043d45 55%, #05526a 100%);
}

:root[data-theme="dark"] .hero-panel,
:root[data-theme="dark"] .owner-summary,
:root[data-theme="dark"] .drive-card,
:root[data-theme="dark"] .empty-state {
    border-color: rgba(255, 255, 255, 0.12);
    background:
        radial-gradient(circle at top left, rgba(34, 198, 184, 0.14), transparent 36%),
        linear-gradient(135deg, rgba(15, 31, 36, 0.94), rgba(9, 24, 28, 0.9));
}

:root[data-theme="dark"] .metric-danger,
:root[data-theme="dark"] .metric-warning,
:root[data-theme="dark"] .metric-online {
    background: rgba(15, 31, 36, 0.86);
}

:root[data-theme="dark"] .status,
:root[data-theme="dark"] .badge-ok {
    border-color: rgba(52, 211, 153, 0.18);
    background: rgba(6, 95, 70, 0.34);
    color: #a7f3d0;
}

:root[data-theme="dark"] .badge-warning {
    background: rgba(146, 64, 14, 0.34);
    color: #fde68a;
}

:root[data-theme="dark"] .badge-danger {
    background: rgba(127, 29, 29, 0.34);
    color: #fecdd3;
}

:root[data-theme="dark"] .badge-muted {
    background: rgba(71, 85, 105, 0.34);
    color: #cbd5e1;
}

:root[data-theme="dark"] .signal-danger {
    color: var(--danger);
}

:root[data-theme="dark"] .asset-dot-online {
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.28);
}

:root[data-theme="dark"] .table-asset-link {
    color: var(--ink);
}

:root[data-theme="dark"] .owner-chip {
    border-color: rgba(34, 198, 184, 0.18);
    background: rgba(15, 31, 36, 0.7);
    color: var(--ink);
}

:root[data-theme="dark"] .health-issue-ok,
:root[data-theme="dark"] .security-check-ok {
    border-color: rgba(52, 211, 153, 0.18);
    background: rgba(6, 78, 59, 0.2);
}

:root[data-theme="dark"] .health-issue-warning,
:root[data-theme="dark"] .security-check-warning {
    border-color: rgba(251, 191, 36, 0.18);
    background: rgba(120, 53, 15, 0.2);
}

:root[data-theme="dark"] .health-issue-critical,
:root[data-theme="dark"] .security-check-critical,
:root[data-theme="dark"] .alert-danger {
    border-color: rgba(251, 113, 133, 0.18);
    background: rgba(127, 29, 29, 0.2);
}

:root[data-theme="dark"] .filter-search-wrap input {
    background: rgba(8, 20, 24, 0.9);
}

:root[data-theme="dark"] .row-deleted td {
    opacity: 0.4;
}

@media (max-width: 1100px) {
    .kpi-sections,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .layout-two,
    .layout-three {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        flex-wrap: wrap;
    }

    .hero-visual {
        flex-basis: 100%;
    }

    .filter-chip-label {
        min-width: 100px;
    }
}

@media (max-width: 720px) {
    .filter-chips {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-chip-label {
        min-width: unset;
    }

    .assets-filter-form .button,
    .assets-filter-form .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 820px) {
    .page-title {
        flex-direction: column;
        align-items: stretch;
    }

    .actions {
        justify-content: flex-start;
    }

    .signal-strip {
        grid-template-columns: repeat(2, auto);
        border-radius: 18px;
    }
}

@media (max-width: 720px) {
    .sidebar {
        display: none;
    }

    .shell {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .list-row {
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .list-row > span {
        white-space: normal;
    }

    .orbital-map {
        transform: scale(0.82);
        transform-origin: center;
    }
}

/* ── Pulse dot (online status) ── */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    position: relative;
    flex-shrink: 0;
}

.pulse-dot::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid var(--ok);
    animation: pulse-ring 2s ease-out infinite;
}

/* ── Sync status chip ── */
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-hi);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.sync-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
    flex-shrink: 0;
    animation: pulse-ring 2s ease-out infinite;
}

/* ── Animations ── */
@keyframes rise {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-ring {
    0%   { transform: scale(1); opacity: 0.6; }
    70%  { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* AssetOps IT console refresh */
@keyframes assetops-rise {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes assetops-glow {
    0%,
    100% {
        box-shadow: 0 24px 70px rgba(0, 109, 119, 0.12);
    }
    50% {
        box-shadow: 0 28px 90px rgba(217, 119, 6, 0.18);
    }
}

.content > section,
.content > article,
.panel {
    animation: assetops-rise 420ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.asset-command-hero {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1.4rem;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid rgba(0, 109, 119, 0.14);
    border-radius: 30px;
    background:
        radial-gradient(circle at 10% 0%, rgba(0, 109, 119, 0.16), transparent 30%),
        radial-gradient(circle at 92% 8%, rgba(217, 119, 6, 0.14), transparent 32%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 247, 247, 0.86));
    animation: assetops-glow 5s ease-in-out infinite;
}

.asset-command-hero h1 {
    margin: 0.15rem 0;
    font-size: clamp(2rem, 4vw, 4rem);
    letter-spacing: -0.07em;
}

.asset-summary-grid,
.attachment-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.hero-stat {
    position: relative;
    overflow: hidden;
}

.hero-stat::after,
.attachment-card::after,
.setup-card::after {
    content: "";
    position: absolute;
    inset: auto -30% -60% 35%;
    height: 120px;
    border-radius: 999px;
    background: rgba(0, 109, 119, 0.08);
    transform: rotate(-12deg);
}

.hero-stat span,
.attachment-card span {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-stat strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.65rem;
    letter-spacing: -0.04em;
}

.hero-stat p,
.attachment-card p {
    position: relative;
    z-index: 1;
    margin-bottom: 0;
    color: var(--muted);
}

.compact-details {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.attachment-card,
.setup-card {
    position: relative;
    display: grid;
    gap: 0.7rem;
    padding: 1rem;
    overflow: hidden;
    border: 1px solid rgba(16, 33, 40, 0.1);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.78);
}

.attachment-card strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 1.05rem;
}

.attachment-card em {
    color: var(--muted);
    font-style: normal;
}

.attachment-card code,
.setup-card code {
    position: relative;
    z-index: 1;
    width: fit-content;
    max-width: 100%;
    padding: 0.35rem 0.5rem;
    overflow: auto;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
}

.attachment-card details {
    position: relative;
    z-index: 1;
}

.attachment-card summary,
.admin-add-panel summary {
    cursor: pointer;
    color: var(--brand);
    font-weight: 900;
}

.mini-edit-form {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(16, 33, 40, 0.14);
}

.review-panel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(16, 33, 40, 0.14);
}

.simple-ops .panel .list {
    min-height: 180px;
}

.settings-grid-lean {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.settings-stack {
    display: grid;
    gap: 1rem;
}

.setup-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--muted);
}

.setup-list li + li {
    margin-top: 0.55rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.tag-cloud span {
    padding: 0.45rem 0.65rem;
    border: 1px solid rgba(0, 109, 119, 0.14);
    border-radius: 999px;
    background: rgba(0, 109, 119, 0.08);
    color: var(--brand);
    font-size: 0.84rem;
    font-weight: 800;
}

.compact-launch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-add-panel {
    margin-bottom: 1rem;
    padding: 0.8rem;
    border: 1px dashed rgba(0, 109, 119, 0.22);
    border-radius: 20px;
    background: rgba(0, 109, 119, 0.04);
}

/* ── Assets page ── */
.assets-filter-panel {
    margin-bottom: 0.6rem;
}

.assets-filter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-search-icon {
    position: absolute;
    left: 0.9rem;
    color: var(--muted);
    pointer-events: none;
    flex-shrink: 0;
}

.filter-search-input {
    width: 100%;
    padding-left: 2.4rem !important;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.55rem;
}

.filter-chip-label {
    display: flex;
    flex-direction: column;
    gap: 0.26rem;
    min-width: 120px;
}

.filter-chip-label span {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Table cell helpers */
.cell-sub {
    display: block;
    color: var(--muted);
    font-size: 0.77rem;
    margin-top: 2px;
}

.cell-owner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.mini-avatar {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), #0f766e);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 900;
    flex-shrink: 0;
}

.row-deleted td {
    opacity: 0.55;
}

/* Asset online/offline indicator dot */
.asset-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 4px;
}

.asset-dot-online {
    background: var(--ok);
    box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.22);
}

.asset-dot-offline {
    background: var(--muted);
    opacity: 0.5;
}

/* Asset name link in tables */
.table-asset-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: var(--ink);
}

.table-asset-link:hover {
    color: var(--brand-strong);
}

th button[data-sort-key] {
    all: unset;
    cursor: pointer;
    color: inherit;
    font: inherit;
    font-weight: 900;
}

th button[data-sort-key]::after {
    content: "  <>";
    color: var(--muted);
    font-size: 0.72rem;
}

th button[data-sort-direction="asc"]::after {
    content: "  ^";
    color: var(--brand);
}

th button[data-sort-direction="desc"]::after {
    content: "  v";
    color: var(--brand);
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
    .content > section,
    .content > article,
    .panel,
    .asset-command-hero {
        animation: none;
    }
}

@media (max-width: 1100px) {
    .report-command-grid {
        grid-template-columns: 1fr;
    }

    .report-sidebar {
        position: static;
    }

    .asset-summary-grid,
    .attachment-grid,
    .compact-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .asset-command-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .asset-summary-grid,
    .attachment-grid,
    .compact-details,
    .compact-launch {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD DYNAMIC UI ADDITIONS
   ═══════════════════════════════════════════════════════════════ */

/* ── Compact hero ─────────────────────────────────────────── */
.compact-hero {
    min-height: unset;
    padding: 1.4rem 1.8rem;
}
.compact-hero h1 {
    font-size: clamp(1.3rem, 2.5vw, 1.85rem);
    letter-spacing: -0.04em;
}

/* ── KPI header row ───────────────────────────────────────── */
.kpi-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: -.1rem;
}

/* ── Refresh indicator ────────────────────────────────────── */
.refresh-indicator {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .68rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .03em;
}

.refresh-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
    opacity: .4;
    transition: opacity 200ms;
}
.refresh-dot.live {
    opacity: 1;
    animation: pulse-ring 1.4s ease-out infinite;
}

/* ── KPI update animation ─────────────────────────────────── */
@keyframes kpi-pop {
    0%   { transform: scale(.92); opacity: .5; }
    60%  { transform: scale(1.06); opacity: 1; }
    100% { transform: scale(1);   opacity: 1; }
}
.kpi-updated strong {
    animation: kpi-pop 320ms ease forwards;
}

/* ── Status dots ──────────────────────────────────────────── */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: middle;
}
.status-dot-online   { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.status-dot-offline  { background: #94a3b8; }
.status-dot-warning  { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.status-dot-critical { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.18); }

/* ── Needs-attention grid ─────────────────────────────────── */
.attention-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: .65rem;
}

.attention-card {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.72);
    text-decoration: none;
    color: inherit;
    transition: transform 150ms, box-shadow 150ms;
}
.attention-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(16,33,40,.08);
}

.attention-card-header {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-weight: 700;
    font-size: .82rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.attention-card-reason {
    font-size: .75rem;
    color: var(--muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.attention-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem .55rem;
    font-size: .7rem;
    color: var(--muted);
    font-weight: 600;
    margin-top: .15rem;
}
.attention-card-meta span { white-space: nowrap; }

.attention-card.severity-critical {
    border-color: rgba(180,35,24,.22);
    background: rgba(254,242,242,.7);
}
.attention-card.severity-warning {
    border-color: rgba(217,119,6,.22);
    background: rgba(255,251,235,.7);
}

/* ── Filter tabs ──────────────────────────────────────────── */
.filter-tabs {
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .28rem .7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: .73rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 140ms, color 140ms, border-color 140ms;
    white-space: nowrap;
}
.filter-tab:hover {
    background: var(--surface-hi);
    color: var(--ink);
}
.filter-tab.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.tab-count {
    display: inline-block;
    padding: 0 .38rem;
    border-radius: 999px;
    background: rgba(255,255,255,.28);
    font-size: .65rem;
    line-height: 1.45;
}
.filter-tab:not(.active) .tab-count {
    background: rgba(16,33,40,.08);
    color: var(--ink);
}

/* ── Last-seen text ───────────────────────────────────────── */
.last-seen {
    font-size: .75rem;
    color: var(--muted);
    font-weight: 600;
}
.last-seen-stale {
    color: var(--danger);
    font-weight: 700;
}

/* ── Dark mode overrides ──────────────────────────────────── */
:root[data-theme="dark"] .attention-card {
    background: rgba(15,31,36,.8);
}
:root[data-theme="dark"] .attention-card.severity-critical {
    background: rgba(127,29,29,.26);
    border-color: rgba(239,68,68,.18);
}
:root[data-theme="dark"] .attention-card.severity-warning {
    background: rgba(120,53,15,.26);
    border-color: rgba(245,158,11,.18);
}
:root[data-theme="dark"] .filter-tab.active {
    background: var(--brand);
    color: #fff;
}
:root[data-theme="dark"] .status-dot-online  { box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
:root[data-theme="dark"] .status-dot-warning { box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
:root[data-theme="dark"] .status-dot-critical{ box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

@media (max-width: 640px) {
    .attention-grid {
        grid-template-columns: 1fr;
    }
    .kpi-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: .2rem;
    }
}

/* ══════════════════════════════════════════════════════════════
   DONUT CHART
   ══════════════════════════════════════════════════════════════ */
.donut-panel { display: flex; flex-direction: column; }
.donut-chart-wrap {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: .4rem 0;
}
.donut-svg { flex-shrink: 0; }
.donut-bg   { stroke: var(--line); }
.donut-offline {
    stroke: var(--danger-soft);
    stroke: #fca5a5;
    transition: stroke-dasharray .6s ease;
}
.donut-online  {
    stroke: var(--brand);
    transition: stroke-dasharray .6s ease;
}
.donut-label-big {
    font-size: 22px;
    font-weight: 700;
    fill: var(--ink);
    font-family: var(--font-ui, "Segoe UI", sans-serif);
}
.donut-label-sub {
    font-size: 9px;
    fill: var(--muted);
    font-family: var(--font-ui, "Segoe UI", sans-serif);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.donut-legend {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.donut-legend-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .82rem;
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
}
.donut-legend-item:hover { color: var(--brand); }
.donut-legend-item strong { margin-left: auto; font-weight: 700; min-width: 2rem; text-align: right; }
.donut-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.donut-dot-online  { background: var(--brand); }
.donut-dot-offline { background: #fca5a5; }
.donut-dot-muted   { background: var(--line); }

:root[data-theme="dark"] .donut-offline { stroke: rgba(239,68,68,.55); }
:root[data-theme="dark"] .donut-label-big { fill: var(--ink); }
:root[data-theme="dark"] .donut-dot-offline { background: rgba(239,68,68,.6); }

/* ══════════════════════════════════════════════════════════════
   AGENT SYNC STAT GRID
   ══════════════════════════════════════════════════════════════ */
.sync-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .65rem;
    margin-bottom: .25rem;
}
.sync-stat {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    padding: .75rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.sync-stat strong {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ink);
}
.sync-stat span {
    font-size: .73rem;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.sync-stat-ok   strong { color: var(--ok); }
.sync-stat-warn strong { color: var(--warning); }
.sync-stat-muted strong { color: var(--muted); }

/* ══════════════════════════════════════════════════════════════
   OS DISTRIBUTION BAR CHART
   ══════════════════════════════════════════════════════════════ */
.os-bar-list {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.os-bar-row {
    display: grid;
    grid-template-columns: 11rem 1fr 2.5rem;
    align-items: center;
    gap: .6rem;
}
.os-bar-label {
    font-size: .78rem;
    color: var(--ink);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.os-bar-track {
    background: var(--line);
    border-radius: 999px;
    height: 7px;
    overflow: hidden;
}
.os-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--brand);
    min-width: 3px;
    transition: width .5s ease;
}
.os-bar-count {
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
    text-align: right;
}

/* ── Department bar chart ─────────────────────────────────────────── */
.dept-bar-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: .2rem;
}
.dept-bar-row {
    display: grid;
    grid-template-columns: 7rem 1fr 2rem;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    color: var(--ink);
    border-radius: var(--radius-sm);
    padding: .15rem .2rem;
    transition: background 150ms;
}
.dept-bar-row:hover { background: var(--line); }
.dept-bar-label {
    font-size: .78rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dept-bar-track {
    background: var(--line);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
}
.dept-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    min-width: 3px;
    transition: width .5s ease;
}
.dept-bar-count {
    font-size: .75rem;
    font-weight: 700;
    color: var(--muted);
    text-align: right;
}

/* ── Fleet Health signal cards ────────────────────────────────────── */
.fhc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem;
    margin-top: .4rem;
}
.fhc-card {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .85rem .9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--bg);
    text-decoration: none;
    color: var(--ink);
    overflow: hidden;
    transition: transform 140ms, box-shadow 140ms;
}
.fhc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
}
.fhc-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .3rem;
    background: var(--line);
    flex-shrink: 0;
}
.fhc-num {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
}
.fhc-label {
    font-size: .75rem;
    font-weight: 600;
}
.fhc-sub {
    font-size: .68rem;
    color: var(--muted);
}
.fhc-card--full { grid-column: 1 / -1; }
.fhc-card-inline {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.fhc-card-inline > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}
.fhc-num--inline {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
}
/* State: ok (count = 0) */
.fhc-ok .fhc-icon { background: rgba(4,120,87,.1); color: var(--ok); }
.fhc-ok .fhc-num  { color: var(--ok); }
/* State: danger */
.fhc-danger .fhc-icon { background: rgba(180,35,24,.1); color: var(--danger); }
.fhc-danger .fhc-num  { color: var(--danger); }
.fhc-danger { border-color: var(--danger-soft); }
/* State: warning */
.fhc-warning .fhc-icon { background: rgba(183,121,31,.12); color: var(--warning); }
.fhc-warning .fhc-num  { color: var(--warning); }
.fhc-warning { border-color: rgba(183,121,31,.25); }
[data-theme="dark"] .fhc-danger  { background: rgba(180,35,24,.08); }
[data-theme="dark"] .fhc-warning { background: rgba(183,121,31,.08); }

/* ══════════════════════════════════════════════════════════════
   REPORT SEARCH BAR
   ══════════════════════════════════════════════════════════════ */
.report-search-wrap {
    position: relative;
    margin-bottom: .75rem;
}
.report-search-input {
    width: 100%;
    padding: .48rem .75rem .48rem 2.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: var(--surface-soft);
    color: var(--ink);
    font-size: .82rem;
    outline: none;
    transition: border-color .18s;
}
.report-search-input:focus {
    border-color: var(--brand);
    background: var(--surface-hi);
}

/* ══════════════════════════════════════════════════════════════
   BRAND LOGO (sidebar)
   ══════════════════════════════════════════════════════════════ */
.brand-logo {
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   MINI-BUTTON DANGER VARIANT
   ══════════════════════════════════════════════════════════════ */
.mini-button-danger {
    color: var(--danger);
    border-color: var(--danger-soft);
}
.mini-button-danger:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
}

/* ══════════════════════════════════════════════════════════════
   SECTION DIVIDER (settings)
   ══════════════════════════════════════════════════════════════ */
.section-divider {
    height: 1px;
    background: var(--line);
    margin: 1rem 0;
}

/* ══════════════════════════════════════════════════════════════
   PRINT STYLES (reports page)
   ══════════════════════════════════════════════════════════════ */
@media print {
    .sidebar, .topbar, .report-sidebar, .hero-panel .actions,
    .section-header .actions, .report-search-wrap { display: none !important; }
    .shell { margin-left: 0 !important; }
    .report-command-grid { grid-template-columns: 1fr !important; }
    .panel { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
    a { color: inherit; text-decoration: none; }
    body { background: #fff; color: #000; }
}

/* ══════════════════════════════════════════════════════════════
   ASSET CATEGORY BREAKDOWN GRID (dashboard)
   ══════════════════════════════════════════════════════════════ */
.category-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .75rem;
    margin-top: .25rem;
}
.cat-kpi-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .45rem;
    padding: .9rem .5rem .75rem;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: box-shadow .15s, border-color .15s;
}
.cat-kpi-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--brand-soft-solid);
}
.cat-kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    flex-shrink: 0;
}
.cat-kpi-body {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}
.cat-kpi-body strong {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}
.cat-kpi-body span {
    font-size: .72rem;
    color: var(--muted);
    letter-spacing: .01em;
}
.cat-kpi-icon-muted {
    background: var(--bg-deep);
    color: var(--muted);
}

/* ══════════════════════════════════════════════════════════════
   CATEGORY PICKER (asset create page)
   ══════════════════════════════════════════════════════════════ */
.category-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: .65rem;
    margin: .5rem 0 1.25rem;
}
.cat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    padding: .85rem .4rem .75rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    font-size: .75rem;
    font-weight: 500;
    color: var(--ink-2);
    text-align: center;
    user-select: none;
}
.cat-tile:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-strong);
}
.cat-tile.active {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-strong);
    box-shadow: 0 0 0 2px var(--brand-soft-solid);
}
.cat-tile svg {
    color: var(--brand);
    opacity: .75;
    flex-shrink: 0;
}
.cat-tile.active svg {
    opacity: 1;
}

.field-group {
    display: contents;
}
.field-group-title {
    grid-column: 1 / -1;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    padding: .65rem 0 .25rem;
    border-top: 1px solid var(--line);
    margin-top: .25rem;
}
.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: .65rem;
    align-items: center;
    padding-top: .5rem;
}

/* ══════════════════════════════════════════════════════════════
   IMPORT DROPZONE
   ══════════════════════════════════════════════════════════════ */
.import-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: 2.5rem 1.5rem;
    border: 2px dashed var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    text-align: center;
    transition: border-color .15s, background .15s;
    cursor: pointer;
}
.import-dropzone.dragover {
    border-color: var(--brand);
    background: var(--brand-soft);
}
.dropzone-label {
    font-size: .9rem;
    color: var(--ink-2);
    margin: 0;
}
.dropzone-browse {
    color: var(--brand);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.dropzone-browse:hover {
    color: var(--brand-strong);
}
.file-chosen {
    font-size: .82rem;
    font-weight: 500;
    color: var(--ok);
    background: var(--ok-soft);
    border-radius: 6px;
    padding: .25rem .65rem;
}
.import-errors {
    margin-top: .5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    padding: .6rem .9rem;
}
.import-errors summary {
    cursor: pointer;
    font-size: .85rem;
    color: var(--ink-2);
    padding: .2rem 0;
}
.import-error-list {
    margin: .5rem 0 0 1.1rem;
    padding: 0;
    font-size: .8rem;
    color: var(--danger);
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

/* ══════════════════════════════════════════════════════════════
   DASHBOARD SYNC BUTTON (per-row agent sync)
   ══════════════════════════════════════════════════════════════ */
.sync-cell {
    white-space: nowrap;
    width: 72px;
}
.sync-form {
    display: inline-flex;
}
.sync-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .28rem .6rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--brand);
    background: var(--brand-soft);
    border: 1px solid rgba(0,109,119,.22);
    border-radius: 6px;
    cursor: pointer;
    transition: background .14s, border-color .14s, color .14s;
    line-height: 1;
    white-space: nowrap;
}
.sync-btn:hover {
    background: var(--brand-soft-solid);
    border-color: var(--brand);
    color: var(--brand-strong);
}
.sync-btn:active {
    transform: scale(.97);
}
.sync-pending-badge {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    padding: .28rem .6rem;
    font-size: .73rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(217,119,6,.18);
    border-radius: 6px;
    white-space: nowrap;
}
.sync-pending-badge svg {
    animation: spin 1.4s linear infinite;
    flex-shrink: 0;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════════════
   EMAIL CONFIG FORM (settings)
   ══════════════════════════════════════════════════════════════ */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--line);
}
.toggle-row:last-of-type {
    border-bottom: none;
}
.toggle-row label {
    font-size: .88rem;
    color: var(--ink-2);
    display: flex;
    align-items: center;
    gap: .4rem;
}
.toggle-switch {
    position: relative;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--line);
    border-radius: 22px;
    cursor: pointer;
    transition: background .2s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--brand);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

@media (max-width: 640px) {
    .donut-chart-wrap { flex-direction: column; gap: 1rem; }
    .sync-stat-grid   { grid-template-columns: 1fr 1fr; }
    .os-bar-row       { grid-template-columns: 7rem 1fr 2rem; }
    .category-breakdown-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .category-picker  { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}

/* ── Asset registry view tabs (Systems / Accessories) ──────────── */
.asset-view-tabs {
    display: flex;
    gap: 4px;
    padding: 0 0 0 2px;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}
.asset-view-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: var(--radius-xs) var(--radius-xs) 0 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-bottom: none;
    transition: background .15s, color .15s;
}
.asset-view-tab:hover { background: var(--surface-hi); color: var(--ink); }
.asset-view-tab.active {
    background: var(--surface-hi);
    color: var(--brand-strong);
    border-color: var(--line);
    border-bottom: 1px solid var(--surface-hi);
}
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    border-radius: 9px;
    font-size: 10px;
    font-weight: 600;
}
.asset-view-tab.active .tab-badge {
    background: var(--brand);
    color: #fff;
}

/* ── Accessory type filter chips (shown at top of accessories tab) ─── */
.acc-type-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 14px 0 6px;
}
.acc-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.acc-type-chip:hover {
    background: var(--surface-hi);
    color: var(--ink);
}
.acc-type-chip.active {
    background: var(--brand-soft);
    color: var(--brand-strong);
    border-color: transparent;
    font-weight: 600;
}
.acc-type-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: rgba(0,0,0,.06);
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
}
.acc-type-chip.active span {
    background: var(--brand);
    color: #fff;
}

/* ── Accessory parent banner (shown at top of accessory detail) ─── */
.accessory-parent-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px !important;
    font-size: 13px;
    border-left: 3px solid var(--brand);
    margin-bottom: 0;
}
.accessory-parent-banner svg { opacity: .5; flex-shrink: 0; }
.accessory-parent-banner .link-strong {
    font-weight: 600;
    color: var(--brand-strong);
    text-decoration: none;
}
.accessory-parent-banner .link-strong:hover { text-decoration: underline; }

/* ── Delete / confirm modal ──────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(2px);
    animation: modal-fade-in 150ms ease;
}
.modal-backdrop[hidden] { display: none; }
@keyframes modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.modal-panel {
    background: var(--surface, #fff);
    border: 1px solid var(--border, rgba(0,0,0,.1));
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    padding: 1.75rem 2rem;
    max-width: 420px;
    width: 100%;
    animation: modal-slide-in 150ms ease;
}
@keyframes modal-slide-in {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}
.modal-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .75rem;
}
.modal-header h3 { margin: 0; font-size: 1.05rem; }
.modal-icon-danger { color: var(--danger); flex-shrink: 0; }
.modal-label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: 1.25rem;
}
.modal-label span { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.modal-label input {
    padding: .5rem .75rem;
    border: 1px solid var(--border, rgba(0,0,0,.15));
    border-radius: var(--radius-sm);
    font-size: .9rem;
    background: var(--bg);
    color: var(--ink);
}
.modal-actions {
    display: flex;
    gap: .6rem;
    justify-content: flex-end;
}
.button-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.button-danger:hover {
    background: #9b1c10;
    border-color: #9b1c10;
}
[data-theme="dark"] .modal-panel {
    background: var(--surface);
    border-color: rgba(255,255,255,.1);
}
[data-theme="dark"] .modal-label input {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.12);
    color: var(--ink);
}

/* ══════════════════════════════════════════════════════════════
   ADMIN CONTROL PANEL — Commercial product shell
   ══════════════════════════════════════════════════════════════ */

/* ── Page header ───────────────────────────────────────────── */
.cp-header { margin-bottom: 1.5rem; }
.cp-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: .85rem;
}
.cp-header-top h1 { margin: 0; font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; }
.cp-header-top .eyebrow { margin-bottom: .2rem; }
.cp-header-desc { font-size: .875rem; color: var(--muted); margin-top: .2rem; }

/* Status chip bar */
.cp-chips { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.cp-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .01em;
    border: 1px solid transparent;
    line-height: 1;
}
.cp-chip svg { flex-shrink: 0; }
.cp-chip-ok     { background: rgba(4,120,87,.09);   color: var(--ok);      border-color: rgba(4,120,87,.2); }
.cp-chip-warn   { background: rgba(183,121,31,.1);  color: var(--warning); border-color: rgba(183,121,31,.2); }
.cp-chip-danger { background: rgba(180,35,24,.09);  color: var(--danger);  border-color: rgba(180,35,24,.2); }
.cp-chip-muted  { background: var(--line);          color: var(--muted); }
[data-theme="dark"] .cp-chip-ok     { background: rgba(4,120,87,.15); }
[data-theme="dark"] .cp-chip-warn   { background: rgba(183,121,31,.13); }
[data-theme="dark"] .cp-chip-danger { background: rgba(180,35,24,.13); }

/* ── Two-column layout ────────────────────────────────────── */
.cp-layout {
    display: grid;
    grid-template-columns: 218px minmax(0,1fr);
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 960px) {
    .cp-layout { grid-template-columns: 1fr; }
    .cp-nav     { position: static !important; }
}

/* ── Sticky nav panel ──────────────────────────────────────── */
.cp-nav {
    position: sticky;
    top: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.cp-nav-group         { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.cp-nav-group:last-child { border-bottom: none; }
.cp-nav-group-label {
    padding: .4rem 1rem .2rem;
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--muted);
}
.cp-nav-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem .95rem;
    margin: .08rem .4rem;
    border-radius: var(--radius-sm);
    font-size: .815rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    transition: background 120ms, color 120ms;
}
.cp-nav-link svg { color: var(--muted); flex-shrink: 0; transition: color 120ms; }
.cp-nav-link:hover { background: var(--line); }
.cp-nav-link:hover svg { color: var(--accent); }
.cp-nav-link.cp-nav-active { background: var(--accent); color: #fff; }
.cp-nav-link.cp-nav-active svg { color: #fff; }

/* ── Section cards ─────────────────────────────────────────── */
.cp-sections { display: flex; flex-direction: column; gap: 1.1rem; }
.cp-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    scroll-margin-top: 1rem;
}
.cp-section-hd {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1.2rem 1.4rem 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}
.cp-section-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(var(--accent-rgb, 20,180,150),.1);
    border: 1px solid rgba(var(--accent-rgb, 20,180,150),.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
}
.cp-section-meta        { flex: 1; min-width: 0; }
.cp-section-meta .eyebrow { margin-bottom: .1rem; font-size: .67rem; }
.cp-section-meta h2     { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.2; }
.cp-section-desc        { font-size: .8rem; color: var(--muted); margin-top: .25rem; line-height: 1.45; }
.cp-section-actions     { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; padding-top: .1rem; }
.cp-section-body        { padding: 1.25rem 1.4rem; }
.cp-section-footer {
    padding: .8rem 1.4rem;
    border-top: 1px solid var(--line);
    background: var(--bg);
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

/* Stats row inside section */
.cp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: .5rem;
    margin-bottom: 1.1rem;
}
.cp-stat {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .65rem .85rem;
    display: flex;
    flex-direction: column;
    gap: .08rem;
}
.cp-stat-num   { font-size: 1.3rem; font-weight: 800; line-height: 1; }
.cp-stat-label { font-size: .7rem;  color: var(--muted); font-weight: 600; }
.cp-stat-ok   .cp-stat-num { color: var(--ok); }
.cp-stat-warn .cp-stat-num { color: var(--warning); }
.cp-stat-warn              { border-color: rgba(183,121,31,.25); }

/* Divider within section body */
.cp-divider { height: 1px; background: var(--line); margin: 1.1rem 0; }

/* Helper text under form fields */
.cp-hint { font-size: .73rem; color: var(--muted); margin-top: .2rem; line-height: 1.4; }

/* Toggle row */
.cp-toggle-rows { display: flex; flex-direction: column; gap: 0; margin-bottom: 1rem; }
.cp-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--line);
}
.cp-toggle-row:last-child { border-bottom: none; }
.cp-toggle-row-label { font-size: .85rem; font-weight: 600; }
.cp-toggle-row-sub   { font-size: .75rem; color: var(--muted); margin-top: .1rem; }

/* Alert / callout inside section */
.cp-alert {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    margin-bottom: .9rem;
    border: 1px solid transparent;
}
.cp-alert-icon     { flex-shrink: 0; margin-top: .05rem; }
.cp-alert-warn     { background: rgba(183,121,31,.08);  border-color: rgba(183,121,31,.2);  color: #8a6119; }
.cp-alert-danger   { background: rgba(180,35,24,.07);   border-color: rgba(180,35,24,.2);   color: var(--danger); }
.cp-alert-success  { background: rgba(4,120,87,.07);    border-color: rgba(4,120,87,.2);    color: var(--ok); }
.cp-alert-info     { background: rgba(59,130,246,.07);  border-color: rgba(59,130,246,.2);  color: #2563eb; }
[data-theme="dark"] .cp-alert-warn    { background: rgba(183,121,31,.12); color: #e8a91e; }
[data-theme="dark"] .cp-alert-danger  { background: rgba(180,35,24,.12); }
[data-theme="dark"] .cp-alert-success { background: rgba(4,120,87,.12); }
[data-theme="dark"] .cp-alert-info    { background: rgba(59,130,246,.1); color: #93c5fd; }

/* Tag cloud */
.cp-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.cp-tag {
    background: var(--line);
    color: var(--ink);
    font-size: .74rem;
    font-weight: 600;
    padding: .28rem .65rem;
    border-radius: 999px;
}

/* Empty state in tables */
.cp-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--muted);
    font-size: .85rem;
}
.cp-empty-icon { margin-bottom: .5rem; opacity: .25; }

/* Danger zone sub-section */
.cp-danger-zone {
    border: 1px solid rgba(180,35,24,.2);
    border-radius: var(--radius-sm);
    padding: .85rem 1rem;
    background: rgba(180,35,24,.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.cp-danger-zone-text { flex: 1; }
.cp-danger-zone-label { font-size: .82rem; font-weight: 600; }
.cp-danger-zone-sub   { font-size: .75rem; color: var(--muted); margin-top: .1rem; }
[data-theme="dark"] .cp-danger-zone { background: rgba(180,35,24,.09); }

/* ── Migrate agents block ───────────────────────────────────── */
.cp-migrate-block {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem;
    background: rgba(var(--accent-rgb, 20,180,150), .04);
}
.cp-migrate-hd {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: .85rem;
}
.cp-migrate-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(var(--accent-rgb, 20,180,150), .12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-top: .05rem;
}
.cp-migrate-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink);
}
.cp-migrate-sub {
    font-size: .78rem;
    color: var(--muted);
    margin-top: .2rem;
    line-height: 1.5;
}
.cp-migrate-form {
    display: flex;
    gap: .55rem;
    flex-wrap: wrap;
    align-items: center;
}
.cp-migrate-input {
    flex: 1;
    min-width: 220px;
}
.cp-migrate-tip {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    font-size: .74rem;
    color: var(--muted);
    margin-top: .65rem;
    line-height: 1.45;
}
.cp-migrate-tip svg { flex-shrink: 0; margin-top: .15rem; }
[data-theme="dark"] .cp-migrate-block { background: rgba(var(--accent-rgb, 20,180,150), .07); }

/* Active nav JS highlight */
.cp-nav-link.cp-nav-active { background: var(--accent); color: #fff; }
.cp-nav-link.cp-nav-active svg { color: #fff; }

/* ══════════════════════════════════════════════════════════════
   PAID SOFTWARE ASSETS — dashboard panel
   ══════════════════════════════════════════════════════════════ */

/* Top 3-stat row */
.swa-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: .5rem;
    margin-bottom: .85rem;
}
.swa-stat {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .6rem .8rem;
    display: flex;
    flex-direction: column;
    gap: .06rem;
}
.swa-stat-num {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    color: var(--ink);
}
.swa-stat-label {
    font-size: .68rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.swa-stat-spend .swa-stat-num { color: var(--accent); }

/* Software list */
.swa-list {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-bottom: .75rem;
}
.swa-item {
    display: grid;
    grid-template-columns: minmax(0,1fr) 80px auto;
    align-items: center;
    gap: .6rem;
    padding: .42rem .5rem;
    border-radius: var(--radius-sm);
    transition: background 120ms;
}
.swa-item:hover { background: var(--line); }

.swa-item-meta {
    display: flex;
    flex-direction: column;
    gap: .05rem;
    min-width: 0;
}
.swa-item-name {
    font-size: .82rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.swa-item-pub {
    font-size: .7rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Horizontal cost bar */
.swa-item-bar-wrap {
    height: 5px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}
.swa-item-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    min-width: 4px;
    transition: width .5s ease;
    opacity: .7;
}

.swa-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .04rem;
    flex-shrink: 0;
}
.swa-item-cost {
    font-size: .82rem;
    font-weight: 700;
    color: var(--ink);
}
.swa-item-devices {
    font-size: .67rem;
    color: var(--muted);
}

/* Footer chips */
.swa-footer {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding-top: .5rem;
    border-top: 1px solid var(--line);
    margin-top: .2rem;
}
.swa-footer-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .28rem .65rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    transition: opacity 140ms;
}
.swa-footer-chip:hover { opacity: .8; }
.swa-chip-ok {
    background: rgba(4,120,87,.08);
    color: var(--ok);
    border-color: rgba(4,120,87,.18);
}
.swa-chip-warn {
    background: rgba(183,121,31,.1);
    color: var(--warning);
    border-color: rgba(183,121,31,.2);
}
.swa-chip-danger {
    background: rgba(180,35,24,.08);
    color: var(--danger);
    border-color: rgba(180,35,24,.2);
}
[data-theme="dark"] .swa-chip-ok     { background: rgba(4,120,87,.14); }
[data-theme="dark"] .swa-chip-warn   { background: rgba(183,121,31,.13); }
[data-theme="dark"] .swa-chip-danger { background: rgba(180,35,24,.13); }

/* ══════════════════════════════════════════════════════════════
   AGENT DOWNLOAD PAGE — connection details + config display     */
.agent-conn-grid {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1rem;
}
.agent-conn-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .6rem .85rem;
    flex-wrap: wrap;
}
.agent-conn-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    min-width: 72px;
    flex-shrink: 0;
}
.agent-conn-value {
    flex: 1;
    font-size: .82rem;
    word-break: break-all;
    color: var(--ink);
    background: transparent;
    border: none;
    padding: 0;
}
.agent-conn-key {
    letter-spacing: .06em;
    filter: blur(4px);
    transition: filter 200ms;
    cursor: pointer;
}
.agent-conn-key:hover,
.agent-conn-key:focus { filter: none; }
.agent-config-details {
    margin-top: .5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.agent-config-details summary {
    padding: .55rem .85rem;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg);
    list-style: none;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.agent-config-details summary::-webkit-details-marker { display: none; }
.agent-config-details[open] summary { border-bottom: 1px solid var(--line); }
.agent-config-pre {
    margin: 0;
    padding: .85rem 1rem;
    font-size: .8rem;
    line-height: 1.6;
    white-space: pre;
    overflow-x: auto;
    background: var(--surface);
    color: var(--ink);
}
[data-theme="dark"] .agent-config-pre { background: rgba(0,0,0,.25); }

/* ── Lifecycle Timeline ─────────────────────────────────────── */
.lifecycle-track {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 1.25rem 0 .75rem;
    position: relative;
}
.lifecycle-track::before {
    content: '';
    position: absolute;
    top: 2.45rem;
    left: .75rem;
    right: .75rem;
    height: 2px;
    background: var(--line);
    z-index: 0;
}
.lc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 90px;
    min-width: 80px;
    position: relative;
    z-index: 1;
    padding: 0 .2rem;
}
.lc-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--line);
    border: 2px solid var(--surface);
    flex-shrink: 0;
    transition: background 180ms, transform 180ms;
}
.lc-done .lc-dot {
    background: var(--brand);
}
.lc-active .lc-dot {
    background: var(--brand);
    transform: scale(1.45);
    box-shadow: 0 0 0 4px rgba(0,109,119,.18);
}
.lc-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .12rem;
    margin-top: .45rem;
    text-align: center;
}
.lc-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    white-space: nowrap;
}
.lc-active .lc-label {
    color: var(--brand);
}
.lc-done .lc-label {
    color: var(--ink);
}
.lc-date {
    font-size: .72rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
}
.lc-pending {
    color: var(--muted);
    font-weight: 400;
}
.lc-note {
    font-size: .68rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

/* ── Accessories Popover ────────────────────────────────────── */
.acc-popover-wrap {
    position: relative;
    display: block;
}
.acc-popover {
    display: none;
    position: fixed;
    min-width: 200px;
    background: var(--surface-hi);
    border: 1px solid var(--line);
    border-radius: .65rem;
    box-shadow: 0 12px 32px rgba(16,33,40,.14);
    padding: .5rem .25rem;
    z-index: 500;
}
.acc-popover.acc-popover-open {
    display: block;
}
.acc-popover a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .42rem .85rem;
    border-radius: .4rem;
    color: var(--ink);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 500;
    gap: 1rem;
    transition: background 120ms;
}
.acc-popover a:hover {
    background: var(--bg-deep);
}
.acc-popover a span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}
.acc-popover-divider {
    height: 1px;
    background: var(--line);
    margin: .3rem .5rem;
}
:root[data-theme="dark"] .acc-popover {
    background: rgba(20,34,40,.96);
    border-color: rgba(255,255,255,.1);
}
