/* --- Futuristic Professional System Styles --- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* 2026 UX refresh: unified light-shell SaaS design system */
/*
 * Canonical LHX theme tokens — single source of truth.
 * Consolidated 2026-07-07 from three stacked :root blocks left over from
 * earlier dark/light theme rewrites. These are the values that were already
 * live (they came from the last :root in the cascade); the other two blocks
 * were dead and have been removed.
 */
:root {
    --lhx-bg: #f5f6f8;
    --lhx-bg-soft: #eceef2;
    --lhx-panel: #ffffff;
    --lhx-panel-strong: #ffffff;
    --lhx-border: #e3e6ec;
    --lhx-border-strong: #c4cee0;
    --lhx-text: #12151d;
    --lhx-muted: #6b7280;
    --lhx-soft: #454b57;
    --lhx-accent: #2952e3;
    --lhx-accent-strong: #1c3bb8;
    --lhx-success: #0f9d58;
    --lhx-warning: #b45309;
    --lhx-danger: #c0293a;
    --lhx-radius: 14px;
    --lhx-radius-sm: 10px;
    --lhx-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

html,
body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(29, 116, 245, 0.09), transparent 24rem),
        linear-gradient(180deg, #f9fbfd 0%, #f2f6fb 42%, #edf3f8 100%);
    color: var(--lhx-text);
    font-family: 'Manrope', 'Segoe UI', Arial, sans-serif;
}

body {
    position: relative;
}

h1,
h2,
h3,
h4,
h5,
h6,
.btn,
.form-control,
.form-select,
textarea {
    font-family: inherit;
}

a {
    color: var(--lhx-accent);
}

a:hover,
a:focus {
    color: var(--lhx-accent-strong);
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(18, 29, 46, 0.98), rgba(11, 18, 29, 0.98)),
        #0e1724;
    border-right: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.08);
}

.sidebar-brand {
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.sidebar-brand-main {
    letter-spacing: -0.04em;
}

.sidebar-brand-sub,
.nav-group-label {
    color: rgba(219, 234, 254, 0.68);
}

.nav-link {
    color: rgba(234, 242, 250, 0.88);
}

.nav-link.active,
.nav-link:hover,
.nav-link:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(125, 176, 255, 0.2);
    color: #ffffff;
}

.nav-link.active i,
.nav-link:hover i,
.nav-link:focus i {
    color: #8bc2ff;
}

.app-topbar {
    background: rgba(250, 252, 254, 0.88);
    border-bottom: 1px solid rgba(216, 226, 236, 0.92);
    backdrop-filter: blur(16px);
}

.topbar-title strong,
.topbar-user small,
.topbar-search input,
.topbar-action,
.topbar-user {
    color: var(--lhx-text);
}

.topbar-title span,
.topbar-user em,
.topbar-search,
.topbar-search input::placeholder {
    color: var(--lhx-muted);
}

.topbar-search {
    background: rgba(243, 247, 251, 0.92);
    border-color: rgba(184, 198, 214, 0.9);
}

.topbar-search kbd {
    color: var(--lhx-soft);
    background: rgba(22, 34, 52, 0.08);
}

.topbar-action:hover,
.topbar-action:focus,
.topbar-user:hover,
.topbar-user:focus {
    background: rgba(29, 116, 245, 0.08);
    border-color: rgba(156, 198, 255, 0.9);
    color: var(--lhx-accent-strong);
}

.topbar-user {
    border-left-color: rgba(184, 198, 214, 0.72);
}

.topbar-user > span {
    background: linear-gradient(180deg, #1d74f5, #1658d3);
}

.topbar-menu-list,
.topbar-profile-menu,
.dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(216, 226, 236, 0.96);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

.topbar-menu-list a,
.topbar-profile-menu a,
.dropdown-item {
    color: var(--lhx-text);
}

.topbar-menu-list a:hover,
.topbar-menu-list a:focus,
.topbar-profile-menu a:hover,
.topbar-profile-menu a:focus,
.dropdown-item:hover {
    background: rgba(29, 116, 245, 0.08);
    color: var(--lhx-accent-strong);
}

.main {
    padding: 6.35rem 2rem 2rem;
}

.footer {
    width: calc(100% - 248px);
    margin-left: 248px;
    background: transparent;
    border-top: 1px solid rgba(216, 226, 236, 0.92);
    color: var(--lhx-muted);
}

.footer .text-muted {
    color: inherit !important;
}

.workspace-header,
.ops-overview,
.workflow-strip,
.section-block,
.panel-card,
.chart-card,
.table-card,
.empty-card,
.metric-card,
.overview-card,
.domain-card,
.service-tile,
.site-card,
.form-panel,
.card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 254, 0.98)),
        var(--lhx-panel);
    border: 1px solid rgba(216, 226, 236, 0.95);
    box-shadow: var(--lhx-shadow);
    backdrop-filter: none;
}

.workspace-header {
    min-height: auto;
    padding: 1.45rem 1.5rem;
    background:
        linear-gradient(135deg, rgba(29, 116, 245, 0.08), rgba(255, 255, 255, 0) 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 253, 0.98));
}

.workspace-header h1,
.ops-summary h2,
.section-heading h2,
.rail-heading h2,
.panel-card h3,
.chart-card h3,
.table-card h3,
.empty-card h3,
.form-panel h3,
.quick-card h4,
.domain-card h3,
.service-tile h3,
.site-card h3 {
    color: var(--lhx-text);
}

.workspace-header p,
.ops-summary p,
.section-heading p,
.panel-card p,
.table-card p,
.empty-card p,
.metric-note,
.stack-item small,
.stack-item p,
.site-card p,
.service-tile p,
.domain-description,
.domain-link small {
    color: var(--lhx-muted);
}

.workspace-kicker,
.eyebrow,
.metric-label {
    color: var(--lhx-accent-strong);
}

.metric-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 251, 0.96));
}

.metric-value,
.metric-value.text-value {
    color: var(--lhx-text);
}

.workflow-strip {
    background: rgba(255, 255, 255, 0.72);
}

.workflow-strip a,
.domain-link,
.service-tile,
.stack-item,
.quick-card,
.site-card,
.pin-button {
    background: rgba(247, 250, 253, 0.88);
    border: 1px solid rgba(221, 229, 238, 0.92);
    color: var(--lhx-text);
}

.workflow-strip a:hover,
.workflow-strip a:focus,
.domain-link:hover,
.domain-link:focus,
.pin-button:hover,
.pin-button:focus,
.stack-item:hover,
.cms-widget-jump:hover {
    border-color: rgba(156, 198, 255, 0.95);
    background: rgba(240, 246, 255, 0.98);
    color: var(--lhx-accent-strong);
}

.domain-link-icon,
.hub-icon,
.action-item > i {
    background: rgba(29, 116, 245, 0.1);
    color: var(--lhx-accent);
}

.btn {
    width: auto;
    min-height: 2.7rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #1d74f5, #1658d3);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    box-shadow: 0 10px 22px rgba(29, 116, 245, 0.18);
}

.btn:hover,
.btn:focus {
    background: linear-gradient(180deg, #1658d3, #1249b1);
    box-shadow: 0 14px 28px rgba(29, 116, 245, 0.18);
}

.btn-secondary,
.btn-warning,
.btn-info {
    background: #ffffff;
    border-color: rgba(204, 216, 228, 0.96);
    color: var(--lhx-text);
    box-shadow: none;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-warning:hover,
.btn-warning:focus,
.btn-info:hover,
.btn-info:focus {
    background: #f2f7ff;
    border-color: rgba(156, 198, 255, 0.95);
    color: var(--lhx-accent-strong);
}

.btn-success {
    background: linear-gradient(180deg, #1f9d6c, #15835f);
}

.btn-danger {
    background: linear-gradient(180deg, #da5560, #cb3f48);
}

.btn-compact,
.inline-actions .btn,
.toolbar-form .btn,
.site-actions .btn,
.btn-sm {
    min-height: 2.35rem;
    padding: 0.62rem 0.85rem;
}

.toolbar-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}

.toolbar-form > label {
    margin-bottom: 0.25rem;
    color: var(--lhx-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.toolbar-form .form-control,
.toolbar-form .form-select {
    flex: 1 1 220px;
}

.form-control,
.form-select,
textarea.form-control,
.form-group input,
.form-group textarea,
.form-group select {
    background: #ffffff !important;
    color: var(--lhx-text) !important;
    border: 1px solid rgba(204, 216, 228, 0.96) !important;
    border-radius: 14px;
    padding: 0.82rem 0.95rem;
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: #8a98ab !important;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: rgba(29, 116, 245, 0.7) !important;
    box-shadow: 0 0 0 0.22rem rgba(29, 116, 245, 0.12) !important;
}

.form-check-input {
    border-color: rgba(184, 198, 214, 0.92);
    background-color: #ffffff;
}

.form-check-input:checked {
    background-color: var(--lhx-accent);
    border-color: var(--lhx-accent);
}

.form-group label,
.form-check-label {
    color: var(--lhx-soft);
    font-weight: 700;
}

.table-responsive {
    border-radius: 16px;
    border: 1px solid rgba(221, 229, 238, 0.96);
    background: #ffffff;
}

.table {
    color: var(--lhx-text);
}

.table th {
    background: #f4f8fc;
    color: #5d6d81;
    border-color: #dbe4ee;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.table td {
    color: var(--lhx-text) !important;
    border-color: #e2eaf2;
    background: rgba(255, 255, 255, 0.92);
}

.table tbody tr:hover td {
    background: #f7fbff;
}

.status-pill {
    background: #eef4fb;
    color: var(--lhx-soft);
    border: 1px solid rgba(204, 216, 228, 0.96);
}

.status-pill.good {
    color: var(--lhx-success);
    background: rgba(21, 131, 95, 0.08);
}

.status-pill.warn {
    color: var(--lhx-warning);
    background: rgba(183, 121, 31, 0.1);
}

.alert {
    border-radius: 16px;
    border-width: 1px;
    box-shadow: none;
}

.alert-success {
    color: #0e5f43;
    background: rgba(21, 131, 95, 0.1);
    border-color: rgba(21, 131, 95, 0.18);
}

.alert-danger {
    color: #8c2630;
    background: rgba(203, 63, 72, 0.08);
    border-color: rgba(203, 63, 72, 0.18);
}

.alert-warning {
    color: #8a5c19;
    background: rgba(183, 121, 31, 0.08);
    border-color: rgba(183, 121, 31, 0.18);
}

.alert-info {
    color: #1558d3;
    background: rgba(29, 116, 245, 0.08);
    border-color: rgba(29, 116, 245, 0.18);
}

.empty-card {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.8);
}

.section-nav-shell {
    display: grid;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.section-nav-card {
    position: sticky;
    top: 6rem;
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(216, 226, 236, 0.96);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 253, 0.98));
    box-shadow: var(--lhx-shadow);
}

.section-nav-card-head h2 {
    margin: 0;
    font-size: 1.18rem;
    color: var(--lhx-text);
}

.section-nav-card-head p {
    margin: 0.45rem 0 0;
    color: var(--lhx-muted);
    line-height: 1.55;
}

.section-nav-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.section-nav-summary > div {
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    background: rgba(247, 250, 253, 0.96);
    border: 1px solid rgba(221, 229, 238, 0.96);
}

.section-nav-summary span {
    display: block;
    color: var(--lhx-muted);
    font-size: 0.78rem;
    margin-bottom: 0.22rem;
}

.section-nav-summary strong {
    color: var(--lhx-text);
    font-size: 0.98rem;
}

.section-nav {
    display: grid;
    gap: 0.55rem;
}

.section-nav-link {
    display: grid;
    gap: 0.25rem;
    padding: 0.9rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(221, 229, 238, 0.96);
    background: rgba(247, 250, 253, 0.94);
    text-decoration: none;
}

.section-nav-link span {
    color: var(--lhx-text);
    font-size: 0.92rem;
    font-weight: 700;
}

.section-nav-link small {
    color: var(--lhx-muted);
    line-height: 1.45;
}

.section-nav-link:hover,
.section-nav-link:focus {
    border-color: rgba(156, 198, 255, 0.96);
    background: rgba(240, 246, 255, 0.98);
    text-decoration: none;
}

.section-nav-link.is-active {
    border-color: rgba(29, 116, 245, 0.24);
    background:
        linear-gradient(180deg, rgba(29, 116, 245, 0.1), rgba(255, 255, 255, 0.96)),
        #ffffff;
}

.section-nav-link.is-active span,
.section-nav-link.is-active small {
    color: var(--lhx-accent-strong);
}

.section-stage {
    display: grid;
    gap: 1rem;
}

.section-panel {
    display: none;
    padding: 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(216, 226, 236, 0.96);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.98));
    box-shadow: var(--lhx-shadow);
}

.section-panel.is-active {
    display: block;
}

.section-panel .split-grid,
.section-panel .quick-grid,
.section-panel .metric-grid,
.section-panel .stack-list,
.section-panel .table-card,
.section-panel .panel-card,
.section-panel .form-panel {
    margin-bottom: 0;
}

.detail-shell .section-panel .form-panel,
.detail-shell .section-panel .stack-list,
.detail-shell .section-panel .metric-grid {
    margin-top: 1rem;
}

.detail-shell .section-panel .stack-item,
.admin-shell .section-panel .stack-item {
    padding: 0.95rem 1rem;
}

.detail-shell .section-panel .row + .metric-grid {
    margin-top: 1rem;
}

.section-panel .panel-card,
.section-panel .table-card,
.section-panel .form-panel {
    background: rgba(255, 255, 255, 0.92);
}

.topbar-action:focus-visible,
.topbar-user:focus-visible,
.nav-link:focus-visible,
.section-nav-link:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(29, 116, 245, 0.16);
    outline-offset: 2px;
}

@media (max-width: 1200px) {
    .section-nav-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .section-nav-card {
        position: static;
    }
}

@media (max-width: 991px) {
    .app-topbar {
        background: rgba(250, 252, 254, 0.96);
    }

    .main {
        padding: 1rem;
    }

    .footer {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 767px) {
    .workspace-header,
    .section-panel,
    .section-nav-card,
    .panel-card,
    .table-card,
    .form-panel,
    .empty-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .section-nav-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .toolbar-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .toolbar-form .form-control,
    .toolbar-form .form-select,
    .toolbar-form .btn {
        width: 100%;
    }

    .workflow-strip {
        margin-left: 0;
        margin-right: 0;
        border-radius: 16px;
    }
}

/* General Styles */
html,
body {
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    background: linear-gradient(120deg, #232526 0%, #414345 100%);
    color: #e0e6ed;
    margin: 0;
    min-height: 100vh;
    height: 100vh;
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

/* Glassmorphism Card Effect */
.card, .container#login, .tabcontent, .timeline-content {
    background: rgba(34, 36, 38, 0.85);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    margin-bottom: 2rem;
    color: #e0e6ed;
    transition: box-shadow 0.2s;
}
.card:hover, .tabcontent:hover {
    box-shadow: 0 12px 48px 0 rgba(31, 38, 135, 0.28);
}

/* Navbar and Sidebar Styles */
.sidebar {
    width: 250px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    background: linear-gradient(180deg, #232526 60%, #414345 100%);
    box-shadow: 2px 0 12px rgba(0,0,0,0.12);
    color: #e0e6ed;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar-sticky {
    position: relative;
    top: 0;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 110px;
}
.logo {
    width: 80%;
    padding: 18px 0 10px 0;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 2px 8px #0056b3);
}
.navbar-brand {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff !important;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    letter-spacing: 1px;
}
.nav.flex-column {
    margin-bottom: 20px;
}
.nav-link {
    color: #b0b8c1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    font-size: 1rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

.navbar-brand a {
    display: block;
    text-decoration: none;
}

.brand-title,
.brand-subtitle {
    display: block;
    text-align: center;
}

.brand-title {
    color: #f5fbff;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.brand-subtitle {
    color: #91a7bc;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 0.35rem;
    padding-bottom: 1rem;
}

/* Main Content Styles */
.main {
    margin-left: 250px;
    padding: 24px;
    min-height: calc(100vh - 80px);
    background: transparent;
    width: calc(100vw - 250px);
    max-width: calc(100vw - 250px);
    overflow-x: hidden;
}

.main > .row,
.main form.row,
.main .row.g-2 {
    margin-left: 0;
    margin-right: 0;
}

/* User Profile Styles */
.user-profile {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    background: rgba(34,36,38,0.95);
    border-top: 1px solid rgba(255,255,255,0.08);
    color: #e0e6ed;
}
.profile-picture {
    width: 50px;
    height: 50px;
    margin-right: 30px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    border: 2px solid #0056b3;
    box-shadow: 0 2px 8px rgba(0,86,179,0.12);
}
#username {
    font-size: 1rem;
    color: #e0e6ed;
}
.dropdown-menu {
    display: none;
    position: absolute;
    bottom: 5px;
    left: 100%;
    width: 98%;
    padding: 0.5rem 0;
    background-color: #232526;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
    z-index: 101;
    color: #e0e6ed !important;
    border-radius: 8px;
}
.dropdown-item {
    padding: 12px 16px;
    color: #e0e6ed !important;
    text-decoration: none;
    display: block;
    transition: background 0.2s;
}
.dropdown-item:hover {
    background: rgba(0,86,179,0.12);
}
.user-profile:hover .dropdown-menu, .user-profile:active .dropdown-menu {
    display: block;
}

/* Footer Styles */
.footer {
    position: relative;
    bottom: 0;
    background: rgba(34,36,38,0.95);
    color: #b0b8c1;
    padding: 20px 0;
    width: calc(100vw - 250px);
    margin-left: 250px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 1rem;
    border-radius: 0 0 16px 16px;
}

/* Login Form Styles */
.container#login {
    background: rgba(34,36,38,0.92);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(31,38,135,0.18);
    margin: 40px auto;
    max-width: 400px;
    color: #e0e6ed;
}
h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #e0e6ed;
    margin-bottom: 1.5rem;
}
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #b0b8c1;
}
.form-group input,
.form-group textarea,
.form-group select {
    border-radius: 8px;
    border: 1px solid #0056b3;
    background: rgba(43, 50, 62, 0.94);
    padding: 12px;
    font-size: 1rem;
    margin-bottom: 8px;
    color: #f3f8ff;
    transition: border 0.2s, background 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #00c6ff;
    background: rgba(33, 44, 58, 0.98);
    outline: none;
}

.form-control,
.form-select,
textarea.form-control {
    background: rgba(43, 50, 62, 0.94) !important;
    color: #f3f8ff !important;
    border: 1px solid #0e78d2 !important;
    box-shadow: none;
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: rgba(207, 222, 238, 0.62) !important;
    opacity: 1;
}

.form-select {
    background-color: rgba(43, 50, 62, 0.94) !important;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    background: rgba(33, 44, 58, 0.98) !important;
    color: #ffffff !important;
    border-color: #1cb7ff !important;
    box-shadow: 0 0 0 0.18rem rgba(28, 183, 255, 0.16) !important;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background: rgba(58, 64, 75, 0.92) !important;
    color: rgba(220, 230, 241, 0.72) !important;
}

/* Buttons */
.btn {
    color: #fff;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    background: linear-gradient(90deg, #0056b3 0%, #00c6ff 100%);
    font-weight: 600;
    font-size: 1.08rem;
    box-shadow: 0 2px 8px rgba(0,86,179,0.12);
    transition: background 0.2s, box-shadow 0.2s;
}
.btn-secondary {
    background: linear-gradient(90deg, #b98f04 0%, #d6a503 100%);
    color: #e0e6ed;
}
.btn-danger {
    background: linear-gradient(90deg, #c0392b 0%, #e74c3c 100%);
}
.btn-success {
    background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%);
}
.btn-info {
    background: linear-gradient(90deg, #2980b9 0%, #6dd5fa 100%);
}

/* Tab Styles */
.tab {
    overflow: hidden;
    border-bottom: 2px solid #0056b3;
    background: transparent;
    margin-bottom: 24px;
}
.tab button {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 16px 28px;
    font-size: 1.08rem;
    color: #b0b8c1;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
    margin-right: 2px;
    transition: background 0.2s, color 0.2s;
}
.tab button.active, .tab button:hover {
    background: rgba(0,86,179,0.12);
    color: #00c6ff;
    border-bottom: 2px solid #00c6ff;
}
.tabcontent {
    display: none;
    padding: 24px 18px;
    background: rgba(34,36,38,0.92);
    border-radius: 0 0 16px 16px;
    border: 1px solid rgba(255,255,255,0.08);
    border-top: none;
    color: #e0e6ed;
}

/* Section Title and Service Item Styles */
.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #00c6ff;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}
.service-item {
    margin-top: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,86,179,0.07);
}

/* Tree Structure Styles */
.tree {
    margin-left: 0px;
}
.tree-list {
    list-style: none;
    padding-left: 0;
}
.tree-item {
    position: relative;
    margin: 5px 0;
}
.tree-item > a {
    text-decoration: none;
    color: #00c6ff;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s;
}
.tree-item > a:hover {
    color: #0056b3;
    text-decoration: underline;
}
.tree li {
    list-style-type: none;
}
ul.tree-list {
    list-style-type: none;
}

/* Table Base */
.table {
    background: rgba(34,36,38,0.92);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,86,179,0.07);
    color: #e0e6ed !important;
    border-collapse: separate;
    border-spacing: 0;
}

/* Table Header */
.table th {
    background: rgba(0,86,179,0.22);
    font-weight: 700;
    color: #00c6ff;
    border-bottom: 2px solid #232526;
    padding: 14px 18px;
}

/* Table Cells */
.table td {
    color: #e0e6ed !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 14px 18px;
}

/* Striped Rows */
.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(0,86,179,0.10);
}
.table-striped tbody tr:nth-of-type(even) {
    background: rgba(34,36,38,0.92);
}

/* Hover Effect */
.table-hover tbody tr:hover {
    background: rgba(0,198,255,0.18);
    color: #fff !important;
}

/* Table Footer (if used) */
.table tfoot td {
    background: rgba(0,86,179,0.22);
    color: #00c6ff;
    font-weight: 600;
}

/* Remove border from last row */
.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    border-radius: 8px;
    font-size: 1rem;
    padding: 8px 16px;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.bg-success { background: #27ae60 !important; color: #fff; }
.bg-danger { background: #c0392b !important; color: #fff; }
.bg-warning { background: #f39c12 !important; color: #fff; }
.bg-info { background: #2980b9 !important; color: #fff; }
.bg-secondary { background: #232526 !important; color: #fff; }
.bg-primary { background: #0056b3 !important; color: #fff; }

/* Timeline */
.timeline-item {
    position: relative;
    margin-bottom: 32px;
}
.timeline-icon {
    position: absolute;
    left: -40px;
    top: 0;
    width: 32px;
    height: 32px;
    text-align: center;
}
.timeline-content {
    margin-left: 0;
    padding-left: 48px;
    background: rgba(34,36,38,0.92);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,86,179,0.07);
    padding: 16px 24px;
    border-left: 3px solid #00c6ff;
    color: #e0e6ed;
}
.timeline-item:last-child .timeline-content {
    border-left: none;
}

/* Misc */
.hidden {
    display: none;
}

.btn-sm {
    width: auto;
    display: inline-block;
    padding: 8px 12px;
    font-size: 0.95rem;
    margin-top: 0;
}

.hero-panel {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 2rem;
    padding: 28px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(0, 198, 255, 0.28), transparent 32%),
        linear-gradient(135deg, rgba(12, 18, 28, 0.96), rgba(33, 48, 69, 0.92));
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
}

.hero-copy {
    max-width: 650px;
}

.hero-copy h1 {
    margin-bottom: 0.75rem;
}

.hero-summary {
    max-width: 56rem;
    margin: 1rem 0 0;
    color: #c1d4e8;
}

.eyebrow {
    color: #79d7ff;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 16px;
    min-width: 420px;
}

.hero-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
}

.hero-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
}

.hero-stat-label {
    color: #b0b8c1;
    font-size: 0.92rem;
}

.section-title {
    margin: 2rem 0 1rem;
}

.overview-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 2.25rem;
}

.overview-card,
.domain-card {
    background: rgba(15, 21, 31, 0.86);
    border: 1px solid rgba(133, 183, 255, 0.12);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}

.overview-card strong,
.domain-card h4 {
    display: block;
    color: #f4f8fc;
    margin-bottom: 0.6rem;
}

.overview-card p,
.domain-description,
.domain-link small,
.site-type {
    color: #aab8c8;
}

.overview-label {
    display: inline-block;
    margin-bottom: 0.7rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(121, 215, 255, 0.12);
    color: #79d7ff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.domain-grid {
    row-gap: 1.5rem;
}

.domain-card {
    height: 100%;
}

.domain-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.domain-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: #d7e7f7;
    font-size: 0.84rem;
}

.domain-description {
    margin: 0.85rem 0 1.1rem;
}

.domain-links {
    display: grid;
    gap: 0.85rem;
}

.domain-link {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
    color: inherit;
    text-decoration: none;
}

.domain-link:hover,
.domain-link:focus {
    transform: translateY(-1px);
    background: rgba(121, 215, 255, 0.08);
    border-color: rgba(121, 215, 255, 0.18);
}

.domain-link strong {
    display: block;
    color: var(--lhx-text);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.domain-link small {
    display: block;
    font-size: 0.88rem;
    line-height: 1.5;
}

.domain-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.55), rgba(0, 198, 255, 0.35));
    color: #ffffff;
    font-size: 1rem;
}

.domain-link-accent {
    background: linear-gradient(135deg, rgba(185, 143, 4, 0.16), rgba(0, 198, 255, 0.08));
}

.hub-card,
.service-card,
.site-card {
    height: calc(100% - 1.5rem);
    min-width: 0;
}

.hub-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.55), rgba(0, 198, 255, 0.4));
    color: #ffffff;
    font-size: 1.2rem;
}

.service-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.site-card .card-img-top {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.site-type {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.88rem;
}

.site-actions {
    display: grid;
    gap: 0.75rem;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
    margin: 1.5rem 0 1.75rem;
    padding: 1.75rem;
    border-radius: 24px;
    border: 1px solid rgba(121, 215, 255, 0.14);
    background:
        radial-gradient(circle at top left, rgba(121, 215, 255, 0.18), transparent 30%),
        linear-gradient(135deg, rgba(10, 16, 24, 0.96), rgba(26, 38, 54, 0.92));
}

.workspace-copy {
    max-width: 52rem;
}

.workspace-copy h1,
.workspace-copy h2 {
    margin-bottom: 0.75rem;
    color: var(--lhx-text);
}

.workspace-copy p {
    color: #c5d5e6;
    margin-bottom: 0;
}

.workspace-actions {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.workspace-actions .btn {
    width: auto;
    min-width: 12rem;
    margin-top: 0;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.metric-card,
.panel-card,
.chart-card,
.table-card,
.empty-card {
    background: rgba(15, 21, 31, 0.86);
    border: 1px solid rgba(133, 183, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}

.metric-card {
    padding: 1.25rem;
}

.metric-label {
    display: block;
    color: #94a8bc;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.55rem;
}

.metric-value {
    display: block;
    color: #ffffff;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
}

.metric-note {
    display: block;
    color: #aab8c8;
    font-size: 0.9rem;
    margin-top: 0.55rem;
}

.panel-card,
.chart-card,
.table-card,
.empty-card {
    padding: 1.35rem;
    margin-bottom: 1.5rem;
}

.panel-card h3,
.chart-card h3,
.table-card h3,
.empty-card h3 {
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.panel-card p,
.chart-card p,
.table-card p,
.empty-card p {
    color: var(--lhx-muted);
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.inline-actions .btn {
    width: auto;
    margin-top: 0;
}

.toolbar-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.toolbar-form .form-control,
.toolbar-form .form-select,
.toolbar-form .btn {
    width: auto;
    margin-bottom: 0;
}

.toolbar-form .form-control,
.toolbar-form .form-select {
    min-width: 14rem;
}

.table-card .table {
    margin-bottom: 0;
}

.table-card .table td,
.table-card .table th {
    vertical-align: middle;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: #d6e4f2;
    font-size: 0.82rem;
    font-weight: 600;
}

.status-pill.good {
    background: rgba(46, 204, 113, 0.16);
    color: #8ff0bb;
}

.status-pill.warn {
    background: rgba(241, 196, 15, 0.16);
    color: #ffde78;
}

.status-pill.bad {
    background: rgba(231, 76, 60, 0.16);
    color: #ff9a91;
}

.split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 1.5rem;
    align-items: start;
}

.stack-list {
    display: grid;
    gap: 0.9rem;
}

.stack-item {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
}

.stack-item strong {
    display: block;
    color: var(--lhx-text);
    margin-bottom: 0.3rem;
}

.stack-item small,
.stack-item p {
    color: #aab8c8;
    margin: 0;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.quick-card {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
}

.quick-card h4 {
    color: #ffffff;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.quick-card p {
    color: var(--lhx-muted);
    margin-bottom: 0.75rem;
}

.quick-card .btn {
    width: auto;
    margin-top: 0;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.chart-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: start;
}

.chart-wrap {
    position: relative;
    height: 180px;
    min-height: 180px;
    margin-top: 0.85rem;
}

.chart-card {
    padding-bottom: 1rem;
}

.compact-chart-card {
    padding: 1rem 1rem 0.85rem;
}

.compact-chart-card h3 {
    font-size: 1.02rem;
    margin-bottom: 0.35rem;
}

.compact-chart-card p {
    font-size: 0.88rem;
    line-height: 1.45;
    margin-bottom: 0;
}

.compact-chart-card .chart-wrap {
    height: 120px;
    min-height: 120px;
    margin-top: 0.65rem;
}

.pihole-mini-widgets {
    margin: 1.25rem 0;
}

.pihole-mini-widget {
    min-height: 0;
    padding: 1rem 1.1rem 0.9rem;
}

.pihole-mini-widget h3 {
    color: var(--lhx-text);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.pihole-mini-widget p {
    color: var(--lhx-muted);
    font-size: 0.84rem;
    margin-bottom: 0;
}

.pihole-mini-widget .chart-wrap {
    height: 88px;
    min-height: 88px;
    margin-top: 0.55rem;
}

.compact-workspace-header {
    margin-bottom: 1rem;
    padding: 0;
}

.compact-workspace-header h2 {
    color: var(--lhx-text);
    font-size: 1.45rem;
    margin-bottom: 0.35rem;
}

.compact-stack-list {
    gap: 0.7rem;
}

.compact-stack-list .stack-item {
    padding: 0.8rem;
}

.pihole-troubleshoot-results {
    margin-top: 1.25rem;
}

.pihole-allow-toolbar {
    align-items: stretch;
    margin: 0.9rem 0 1rem;
}

.pihole-allow-toolbar .form-select,
.pihole-allow-toolbar .form-control {
    min-width: 150px;
}

.form-panel {
    padding: 1.35rem;
    border-radius: 20px;
    background: rgba(15, 21, 31, 0.86);
    border: 1px solid rgba(133, 183, 255, 0.12);
    margin-bottom: 1.5rem;
}

.form-panel h3 {
    color: #ffffff;
}

.section-stack {
    display: grid;
    gap: 1.5rem;
}

.muted {
    color: #94a8bc;
}

.tree ul {
    list-style: none;
    padding-left: 1rem;
}

.tree li {
    margin-bottom: 0.65rem;
}

.tree a {
    color: #d6e4f2;
    text-decoration: none;
}

.tree a:hover {
    color: #79d7ff;
}

.cms-editor-layout {
    display: grid;
    grid-template-columns: minmax(250px, 300px) minmax(0, 1.45fr) minmax(300px, 360px);
    gap: 1.5rem;
    align-items: start;
    margin-top: 1.5rem;
}

.cms-editor-layout--browse {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1.5fr) minmax(300px, 380px);
}

.cms-tree-card,
.cms-editor-panel {
    margin-bottom: 0;
}

.cms-tree-card {
    position: sticky;
    top: 1rem;
}

.cms-tree-head,
.cms-editor-head,
.cms-fieldset-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.cms-tree-shell {
    margin-top: 1rem;
}

.cms-tree-list,
.cms-tree-widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cms-tree-list {
    display: grid;
    gap: 0.75rem;
}

.cms-tree-item {
    display: grid;
    gap: 0.6rem;
}

.cms-tree-item > .cms-tree-list,
.cms-tree-item > .cms-tree-widget-list {
    padding-left: 1rem;
}

.cms-tree-link,
.cms-tree-widget-link,
.cms-widget-jump {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: var(--lhx-bg-soft);
    border: 1px solid var(--lhx-border);
    color: var(--lhx-text);
    text-decoration: none;
    transition: 0.2s ease;
}

.cms-tree-link span:first-child,
.cms-tree-widget-link span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.cms-tree-link:hover,
.cms-tree-widget-link:hover,
.cms-widget-jump:hover {
    border-color: var(--lhx-accent);
    background: rgba(41, 82, 227, 0.08);
    color: var(--lhx-text);
}

.cms-tree-link.is-active,
.cms-tree-widget-link.is-active {
    border-color: var(--lhx-accent);
    background: rgba(41, 82, 227, 0.12);
    color: var(--lhx-text);
}

.cms-quick-grid {
    margin-top: 1.25rem;
}

.cms-browse-hero {
    margin-bottom: 0;
}

.cms-browse-guide {
    margin-top: 1rem;
}

.cms-inline-form .form-group {
    margin-bottom: 0.9rem;
}

.cms-inline-form label {
    color: #dce7f3;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.cms-form-grid {
    display: grid;
    gap: 1rem;
}

.cms-widget-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.cms-fieldset {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 1rem;
}

.cms-fieldset h4 {
    margin-bottom: 0.85rem;
    color: var(--lhx-text);
    font-size: 1.05rem;
}

.cms-fieldset p {
    margin-bottom: 0;
    color: var(--lhx-muted);
}

.cms-content-fieldset {
    margin-top: 0.5rem;
}

.cms-mini-textarea {
    min-height: 110px;
}

.cms-create-page-textarea {
    min-height: 180px;
}

.cms-rich-editor,
.cms-code-editor {
    min-height: 320px;
}

.cms-editor-panel .form-group {
    margin-bottom: 1rem;
}

.cms-editor-panel label {
    color: #dce7f3;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.cms-widget-jump {
    display: block;
}

.cms-widget-jump strong,
.cms-widget-jump small {
    display: block;
}

.cms-widget-jump small {
    margin-top: 0.25rem;
}

.cms-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.cms-utility-panel {
    margin-bottom: 0;
}

.cms-preset-card {
    height: 100%;
}

.cms-preset-head,
.cms-preview-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.cms-preview-tabs {
    margin: 1rem 0 0.85rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.cms-preview-tabs .btn.is-active {
    background: linear-gradient(135deg, #1d6bd1, #24b0e7);
    color: #ffffff;
    border-color: transparent;
}

.cms-preview-frame-shell {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
}

.cms-preview-frame {
    width: 100%;
    min-height: 620px;
    border: 0;
    background: #ffffff;
}

.cms-preview-panel {
    position: sticky;
    top: 1rem;
}

.CodeMirror {
    border-radius: 16px;
    border: 1px solid rgba(133, 183, 255, 0.12);
    min-height: 360px;
}

.tox.tox-tinymce {
    border-radius: 16px !important;
    overflow: hidden;
    border: 1px solid rgba(133, 183, 255, 0.12) !important;
}

.service-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.service-status.online {
    background: rgba(46, 204, 113, 0.18);
    color: #6ef0a4;
}

.service-status.offline {
    background: rgba(241, 196, 15, 0.18);
    color: #ffd36e;
}

.hub-actions-cell {
    white-space: nowrap;
}

.hub-inline-form {
    display: inline-block;
    margin-left: 8px;
}

.smart-home-layout {
    align-items: start;
}

.smart-home-toolbar-card {
    position: sticky;
    top: 1rem;
    z-index: 20;
}

.smart-home-toolbar-top,
.smart-home-section-head,
.smart-device-top,
.smart-scene-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.smart-home-filter-form {
    margin: 1rem 0 1.15rem;
}

.smart-home-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.smart-home-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(247, 250, 253, 0.92);
    border: 1px solid var(--lhx-border);
    color: var(--lhx-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.smart-home-chip:hover,
.smart-home-chip:focus {
    background: rgba(240, 246, 255, 0.98);
    border-color: var(--lhx-border-strong);
    color: var(--lhx-accent-strong);
}

.smart-home-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: rgba(29, 116, 245, 0.1);
    color: var(--lhx-accent);
    font-size: 0.76rem;
}

.smart-home-compact-grid,
.smart-scene-grid {
    display: grid;
    gap: 1rem;
}

.smart-home-compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 1rem;
}

.smart-scene-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-top: 1rem;
}

.smart-device-card,
.smart-scene-card {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
}

.smart-device-card.active {
    background: linear-gradient(180deg, rgba(46, 204, 113, 0.08), rgba(255,255,255,0.04));
    border-color: rgba(143, 240, 187, 0.18);
}

.smart-device-card.is-loading,
.smart-scene-card.is-loading {
    opacity: 0.72;
    pointer-events: none;
}

.smart-device-card h4 {
    color: var(--lhx-text);
    margin: 0.9rem 0 0.35rem;
    font-size: 1rem;
    line-height: 1.35;
}

.smart-device-card p,
.smart-scene-card small {
    color: #d0dbe7;
    margin: 0;
}

.smart-device-meta,
.smart-device-room {
    font-size: 0.82rem;
    line-height: 1.45;
}

.smart-device-room {
    margin-top: 0.4rem;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.75rem;
    color: #b9cadb;
    overflow-wrap: anywhere;
}

.smart-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.smart-feature-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: rgba(29, 116, 245, 0.1);
    border: 1px solid rgba(29, 116, 245, 0.18);
    color: var(--lhx-accent-strong);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.smart-device-related {
    margin-top: 0.65rem !important;
    color: var(--lhx-muted) !important;
    font-size: 0.76rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.smart-device-form {
    margin-top: 0.9rem;
}

.smart-device-form .btn,
.smart-scene-card .btn {
    width: auto;
    margin-top: 0;
}

.smart-device-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    margin-top: 0.9rem;
}

.smart-device-actions .smart-device-form {
    margin-top: 0;
}

.smart-light-controls {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.smart-light-controls label {
    display: grid;
    gap: 0.35rem;
    color: #c7d5e4;
    font-size: 0.78rem;
    font-weight: 700;
}

.smart-light-controls input[type="range"] {
    width: 100%;
    accent-color: var(--lhx-accent, #39c8ff);
}

.smart-light-controls .btn {
    justify-self: start;
}

.smart-light-swatches,
.smart-card-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.smart-light-swatches form,
.smart-card-secondary-actions form {
    margin: 0;
}

.smart-color-swatch {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.28);
    background: var(--swatch);
    cursor: pointer;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.18);
}

.smart-color-swatch:focus {
    outline: 2px solid rgba(57, 200, 255, 0.55);
    outline-offset: 2px;
}

.smart-scene-card {
    align-items: center;
}

.smart-scene-card strong {
    display: block;
    color: #ffffff;
    margin-bottom: 0.3rem;
}

.smart-home-empty {
    margin-top: 1rem;
}

.smart-room-panel {
    padding-bottom: 1rem;
}

.smart-room-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 1.1rem;
}

.smart-room-summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 0;
}

.smart-room-summary-card h4 {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
}

.smart-room-summary-card p {
    margin: 0;
    color: var(--lhx-muted);
    font-size: 0.86rem;
}

.smart-room-mini-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.smart-home-compact-grid.room-first {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.smart-home-list-grid {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.smart-device-card.list-mode {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.85rem 1rem;
    align-items: center;
}

.smart-device-card.list-mode .smart-device-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.smart-device-card.list-mode h4 {
    margin: 0 0 0.2rem;
}

.smart-device-card.list-mode .smart-device-room {
    margin-top: 0.2rem;
}

.smart-device-card.list-mode .smart-device-form {
    margin-top: 0;
    justify-self: end;
}

.smart-device-card.list-mode .smart-device-actions {
    margin-top: 0;
    justify-self: end;
    justify-content: flex-end;
}

.smart-device-card.list-mode .smart-device-form .btn {
    min-width: 108px;
}

.smart-device-card.list-mode .smart-feature-list,
.smart-device-card.list-mode .smart-device-related,
.smart-device-card.list-mode .smart-light-controls,
.smart-device-card.list-mode .smart-light-swatches,
.smart-device-card.list-mode .smart-card-secondary-actions {
    grid-column: 2 / -1;
    margin-top: 0;
}

.smart-home-layout .section-stack:first-child {
    min-width: 0;
}

.smart-home-layout .section-stack:last-child {
    position: sticky;
    top: 1rem;
}

.smart-device-card {
    min-width: 0;
}

.smart-device-card h4,
.smart-device-meta {
    overflow-wrap: anywhere;
}

/* LHX command-centre refresh — dead dark-theme token block removed 2026-07-07;
   superseded by the canonical :root at the top of this file. The component
   rules below are left untouched. */

html,
body {
    min-height: 100vh;
    height: auto;
    background:
        linear-gradient(180deg, rgba(57, 200, 255, 0.08), transparent 18rem),
        var(--lhx-bg);
    color: var(--lhx-text);
    letter-spacing: 0;
}

.sidebar {
    width: 268px;
    background: linear-gradient(180deg, #0d141e 0%, #111a26 100%);
    border-right: 1px solid var(--lhx-border);
    box-shadow: none;
}

.sidebar-sticky {
    padding: 0.75rem 0.75rem 120px;
}

.logo {
    width: 132px;
    max-width: 72%;
    padding: 1rem 0 0.35rem;
    filter: drop-shadow(0 8px 18px rgba(57, 200, 255, 0.18));
}

.navbar-brand {
    border-bottom: 1px solid var(--lhx-border);
    margin-bottom: 0.75rem;
}

.brand-title {
    font-size: 0.82rem;
    letter-spacing: 0.18em;
}

.brand-subtitle {
    max-width: 11.5rem;
    margin-left: auto;
    margin-right: auto;
    color: var(--lhx-muted);
    font-size: 0.72rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.nav-link {
    gap: 0.75rem;
    padding: 0.72rem 0.85rem;
    border-radius: var(--lhx-radius-sm);
    margin-bottom: 0.25rem;
    color: #b6c5d4;
    font-size: 0.94rem;
    line-height: 1.25;
}

.nav-link i {
    width: 1.1rem;
    color: #6fcfff;
    text-align: center;
}

.nav-link:hover,
.nav-link:focus {
    background: rgba(57, 200, 255, 0.1);
    color: #ffffff;
}

.user-profile {
    background: #101824;
    border-top: 1px solid var(--lhx-border);
}

.main {
    width: calc(100% - 268px);
    max-width: none;
    margin-left: 268px;
    padding: 2rem;
    overflow: visible;
}

.dashboard-main {
    display: grid;
    gap: 1.5rem;
}

.footer {
    width: calc(100% - 268px);
    margin-left: 268px;
    border-radius: 0;
    background: #0f1722;
    border-top: 1px solid var(--lhx-border);
}

.btn {
    border-radius: var(--lhx-radius-sm);
    background: linear-gradient(180deg, #119fe4, #0777bb);
    box-shadow: none;
    font-size: 0.95rem;
    line-height: 1.2;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn:hover,
.btn:focus {
    transform: translateY(-1px);
}

.btn-secondary,
.btn-warning {
    background: rgba(255, 255, 255, 0.06);
    color: #dce7f1;
    border: 1px solid var(--lhx-border);
}

.btn-compact {
    display: inline-flex;
    width: auto;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 0;
    padding: 0.68rem 0.9rem;
    white-space: nowrap;
}

.workspace-header,
.ops-overview,
.workflow-strip,
.section-block,
.panel-card,
.chart-card,
.table-card,
.empty-card,
.metric-card,
.overview-card,
.domain-card,
.service-tile,
.site-card {
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius);
    background: var(--lhx-panel);
    box-shadow: none;
    backdrop-filter: none;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.35rem 1.5rem;
}

.workspace-header h1,
.ops-summary h2,
.section-heading h2,
.rail-heading h2 {
    color: var(--lhx-text);
    margin: 0;
    line-height: 1.08;
}

.workspace-header h1 {
    font-size: clamp(1.85rem, 3vw, 3rem);
    letter-spacing: 0;
}

.workspace-header p,
.ops-summary p,
.section-heading p {
    color: var(--lhx-muted);
    margin: 0.55rem 0 0;
    max-width: 48rem;
}

.workspace-kicker,
.eyebrow,
.metric-label {
    display: block;
    color: var(--lhx-accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.workspace-actions,
.site-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
}

.ops-overview {
    display: block;
}

.ops-summary {
    align-self: center;
}

.ops-summary h2 {
    font-size: clamp(1.55rem, 2.4vw, 2.45rem);
}

.ops-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.metric-card.compact {
    padding: 1rem;
    min-width: 0;
}

.metric-value {
    color: var(--lhx-text);
    font-size: clamp(1.55rem, 2vw, 2rem);
}

.metric-value.text-value {
    font-size: clamp(0.95rem, 1.25vw, 1.2rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.metric-note,
.domain-description,
.domain-link small,
.site-type,
.stack-item small,
.stack-item p,
.panel-card p,
.service-tile p,
.site-card p {
    color: var(--lhx-muted);
}

.workflow-strip {
    display: flex;
    gap: 0.65rem;
    padding: 0.7rem;
    overflow-x: auto;
    background: rgba(17, 25, 36, 0.78);
}

.workflow-strip a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
    padding: 0.66rem 0.85rem;
    border-radius: var(--lhx-radius-sm);
    color: var(--lhx-soft);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    font-size: 0.92rem;
}

.workflow-strip a:hover,
.workflow-strip a:focus {
    border-color: var(--lhx-border-strong);
    color: #ffffff;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 1.5rem;
    align-items: start;
}

.dashboard-primary,
.dashboard-rail {
    display: grid;
    gap: 1.5rem;
}

.dashboard-rail {
    position: sticky;
    top: 1rem;
}

.section-block {
    padding: 1.25rem;
}

.section-heading,
.rail-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading h2,
.rail-heading h2 {
    font-size: 1.2rem;
}

.section-heading p {
    max-width: 34rem;
    font-size: 0.95rem;
}

.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1rem;
    row-gap: 1rem;
}

.section-block .overview-strip {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 0;
}

.domain-card {
    height: auto;
    padding: 1rem;
    background: rgba(13, 20, 30, 0.76);
}

.domain-card h3 {
    margin: 0;
    color: var(--lhx-text);
    font-size: 1.12rem;
}

.domain-header {
    align-items: center;
}

.domain-count,
.service-status,
.site-type {
    border: 1px solid var(--lhx-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--lhx-soft);
    white-space: nowrap;
}

.domain-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: stretch;
}

.domain-link {
    grid-template-columns: 2.45rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.78rem;
    border-radius: var(--lhx-radius-sm);
    background: rgba(255, 255, 255, 0.035);
}

.domain-link > span:last-child,
.domain-link strong,
.domain-link small,
.site-card p,
.site-card h3,
.card-title,
.card-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.domain-link:hover,
.domain-link:focus {
    transform: none;
    border-color: var(--lhx-border-strong);
}

.domain-link-icon,
.hub-icon {
    width: 2.45rem;
    height: 2.45rem;
    border-radius: var(--lhx-radius-sm);
    margin-bottom: 0;
    background: rgba(57, 200, 255, 0.12);
    color: #7bdcff;
}

.pin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 5.3rem;
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius-sm);
    background: rgba(255, 255, 255, 0.045);
    color: var(--lhx-soft);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0 0.75rem;
}

.pin-button:hover,
.pin-button:focus {
    border-color: var(--lhx-border-strong);
    color: #ffffff;
}

.service-grid,
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.service-tile,
.site-card {
    min-width: 0;
    overflow: hidden;
}

.service-tile {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.035);
}

.service-tile h3,
.site-card h3 {
    margin: 0;
    color: var(--lhx-text);
    font-size: 1.05rem;
}

.service-tile p,
.site-card p {
    margin: 0;
    line-height: 1.45;
}

.service-status.online {
    color: var(--lhx-success);
    background: rgba(107, 227, 154, 0.12);
}

.service-status.offline {
    color: var(--lhx-warning);
    background: rgba(255, 211, 110, 0.12);
}

.service-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.35rem;
    color: var(--lhx-muted);
    font-size: 0.86rem;
}

.service-meta a {
    color: var(--lhx-accent);
    font-weight: 700;
    text-decoration: none;
}

.site-card {
    background: rgba(255, 255, 255, 0.035);
}

.site-card .card-img-top {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.site-card .card-body {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
}

.panel-card,
.chart-card,
.table-card,
.empty-card {
    padding: 1rem;
    margin-bottom: 0;
}

.stack-list {
    gap: 0.65rem;
}

.stack-item {
    border-radius: var(--lhx-radius-sm);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.055);
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.action-item {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    align-items: start;
    gap: 0.7rem;
}

.action-item > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--lhx-radius-sm);
    color: var(--lhx-accent);
    background: rgba(57, 200, 255, 0.1);
}

.cms-widget-jump {
    align-items: flex-start;
}

@media (max-width: 1280px) {
    .ops-overview,
    .dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-rail {
        position: static;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }

    .domain-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

@media (max-width: 1100px) {
    .ops-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .sidebar {
        position: relative;
        width: 100%;
    }

    .sidebar-sticky {
        height: auto;
        padding-bottom: 0;
    }

    .user-profile {
        position: relative;
    }

    .main,
    .footer {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }

    .main {
        padding: 1rem;
    }

    .workspace-header,
    .ops-overview,
    .section-heading {
        grid-template-columns: minmax(0, 1fr);
        flex-direction: column;
    }

    .hero-panel {
        flex-direction: column;
    }

    .hero-stats {
        min-width: 0;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .overview-strip {
        grid-template-columns: minmax(0, 1fr);
    }

    .workspace-header {
        flex-direction: column;
    }

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

    .split-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .smart-home-toolbar-card {
        position: static;
    }

    .smart-home-layout .section-stack:last-child {
        position: static;
    }

    .cms-editor-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .cms-editor-layout--browse {
        grid-template-columns: minmax(0, 1fr);
    }

    .cms-tree-card {
        position: static;
    }

    .cms-preview-panel {
        position: static;
    }

    .smart-device-card.list-mode {
        grid-template-columns: minmax(0, 1fr);
    }

    .smart-device-card.list-mode .smart-device-form {
        justify-self: start;
    }

    .smart-device-card.list-mode .smart-device-actions {
        justify-self: start;
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .workspace-header,
    .ops-overview,
    .section-block {
        padding: 1rem;
    }

    .ops-metrics,
    .domain-link-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .pin-button {
        min-height: 2.35rem;
        width: 100%;
    }

    .workflow-strip {
        margin-left: -1rem;
        margin-right: -1rem;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    .hero-panel,
    .overview-card,
    .domain-card {
        padding: 18px;
    }

    .smart-home-toolbar-top,
    .smart-home-section-head,
    .smart-scene-card {
        flex-direction: column;
        align-items: stretch;
    }

    .smart-home-compact-grid,
    .smart-room-summary-grid,
    .smart-home-list-grid,
    .smart-scene-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Render-matched app shell and global module polish */
.sidebar {
    width: 248px;
    background:
        linear-gradient(180deg, rgba(17, 27, 40, 0.98), rgba(10, 16, 24, 0.98)),
        #0b1017;
    border-right: 1px solid rgba(128, 160, 192, 0.2);
}

.sidebar-sticky {
    height: 100vh;
    padding: 0;
    overflow-y: auto;
}

/* Slim, dark sidebar scrollbar: a faint thumb that brightens on hover, no track. */
.sidebar-sticky::-webkit-scrollbar {
    width: 6px;
}
.sidebar-sticky::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-sticky::-webkit-scrollbar-thumb {
    background: rgba(160, 185, 215, 0.12);
    border-radius: 3px;
}
.sidebar-sticky:hover::-webkit-scrollbar-thumb {
    background: rgba(160, 185, 215, 0.28);
}
.sidebar-sticky::-webkit-scrollbar-thumb:hover {
    background: rgba(160, 185, 215, 0.45);
}
/* Firefox (Chrome ignores the ::-webkit rules above once these are set, so scope them). */
@supports (-moz-appearance: none) {
    .sidebar-sticky {
        scrollbar-width: thin;
        scrollbar-color: rgba(160, 185, 215, 0.2) transparent;
    }
}

.sidebar-brand {
    display: grid;
    gap: 0.3rem;
    padding: 1.5rem 1.35rem 1.2rem;
    color: #ffffff;
    text-decoration: none;
    border-bottom: 1px solid rgba(128, 160, 192, 0.18);
}

.sidebar-brand > a {
    display: grid;
    gap: 0.3rem;
    color: inherit;
    text-decoration: none;
}

.sidebar-brand > a:hover,
.sidebar-brand > a:focus-visible,
.sidebar-brand .sidebar-brand-sub[href]:hover,
.sidebar-brand .sidebar-brand-sub[href]:focus-visible {
    color: #ffffff;
    text-decoration: none;
}

.sidebar-brand-main {
    font-size: 1.72rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.sidebar-brand-main strong {
    color: var(--lhx-accent);
    font-size: 0.58em;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.sidebar-brand-sub {
    color: #8da0b5;
    font-size: 0.78rem;
}

.nav-group {
    padding: 1rem 0.75rem 0;
}

.nav-group-label {
    display: block;
    padding: 0 0.55rem 0.55rem;
    color: #93a5b7;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.nav.flex-column {
    gap: 0.18rem;
    margin-bottom: 0;
}

.nav-link {
    color: #d7e2ec;
    border: 1px solid transparent;
    padding: 0.72rem 0.76rem;
    border-radius: 8px;
}

.nav-link.active,
.nav-link:hover,
.nav-link:focus {
    background: rgba(72, 198, 255, 0.1);
    border-color: rgba(109, 207, 255, 0.14);
    color: #58d8ff;
}

.nav-link.active i,
.nav-link:hover i,
.nav-link:focus i {
    color: #58d8ff;
}

.user-profile {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 248px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.35rem 0.75rem;
    align-items: center;
    padding: 0.85rem 1rem;
    color: #e7eef6;
    text-decoration: none;
    background: #0e1621;
    border-top: 1px solid rgba(128, 160, 192, 0.18);
}

.user-profile small {
    grid-column: 2;
    color: #8da0b5;
    font-size: 0.72rem;
}

.login-profile {
    display: flex;
    gap: 0.6rem;
}

.profile-picture {
    width: 38px;
    height: 38px;
    margin: 0;
    border: 1px solid rgba(88, 216, 255, 0.6);
}

#username {
    color: #ffffff;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-menu {
    left: 1rem;
    bottom: calc(100% + 0.5rem);
    width: calc(100% - 2rem);
    border: 1px solid rgba(128, 160, 192, 0.22);
    background: #121d2a;
}

.app-topbar {
    position: fixed;
    top: 0;
    left: 248px;
    right: 0;
    z-index: 90;
    height: 76px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 360px) auto;
    align-items: center;
    gap: 1.1rem;
    padding: 0 1.4rem 0 1.8rem;
    background: rgba(10, 16, 24, 0.94);
    border-bottom: 1px solid rgba(128, 160, 192, 0.2);
    backdrop-filter: blur(14px);
}

.topbar-title {
    display: grid;
    gap: 0.2rem;
}

.topbar-title strong {
    color: #ffffff;
    font-size: 1.45rem;
    line-height: 1;
}

.topbar-title span {
    color: #93a5b7;
    font-size: 0.84rem;
}

.topbar-search {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(128, 160, 192, 0.25);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: #8da0b5;
}

.topbar-search input {
    min-width: 0;
    border: 0;
    outline: 0;
    color: #e7eef6;
    background: transparent;
    font-size: 0.9rem;
}

.topbar-search input::placeholder {
    color: #8da0b5;
}

.topbar-search kbd {
    padding: 0.12rem 0.35rem;
    border-radius: 5px;
    color: #b7c5d3;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    min-width: 0;
}

.topbar-action,
.topbar-user {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.35rem;
    padding: 0.52rem 0.68rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #d7e2ec;
    background: transparent;
    text-decoration: none;
    font-size: 0.88rem;
    white-space: nowrap;
}

.topbar-action:hover,
.topbar-action:focus,
.topbar-user:hover,
.topbar-user:focus {
    color: #ffffff;
    border-color: rgba(128, 160, 192, 0.18);
    background: rgba(255, 255, 255, 0.045);
}

.topbar-action b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.12rem;
    height: 1.12rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    color: #ffffff;
    background: #e54848;
    font-size: 0.68rem;
    line-height: 1;
}

.topbar-user {
    margin-left: 0.5rem;
    padding-right: 0.85rem;
    border-left: 1px solid rgba(128, 160, 192, 0.16);
    border-radius: 0;
}

.topbar-user > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    color: #ffffff;
    background: #26364a;
    font-weight: 800;
}

.topbar-user small {
    display: grid;
    color: #ffffff;
    font-size: 0.8rem;
    text-align: left;
}

.topbar-user em {
    color: #93a5b7;
    font-style: normal;
    font-weight: 500;
}

.topbar-menu {
    position: relative;
}

.topbar-menu-list {
    display: none;
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    min-width: 210px;
    padding: 0.4rem;
    border: 1px solid rgba(128, 160, 192, 0.24);
    border-radius: 10px;
    background: #101a26;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

.topbar-menu.is-open .topbar-menu-list {
    display: grid;
    gap: 0.25rem;
}

.topbar-menu-list a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.7rem;
    border-radius: 8px;
    color: #d7e2ec;
    text-decoration: none;
}

.topbar-menu-list a:hover,
.topbar-menu-list a:focus {
    color: #ffffff;
    background: rgba(88, 216, 255, 0.1);
}

.main {
    width: calc(100% - 248px);
    margin-left: 248px;
    padding: 6.25rem 1.8rem 2rem;
}

.main.container {
    max-width: none;
}

.main > .container {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.workspace-header {
    min-height: 7rem;
    margin-bottom: 1.35rem;
    padding: 1.05rem 1.2rem;
    background:
        linear-gradient(135deg, rgba(88, 216, 255, 0.055), transparent 48%),
        rgba(15, 24, 35, 0.92);
}

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

.workspace-header h1 {
    font-size: clamp(1.45rem, 2.2vw, 2.1rem);
}

.workspace-header p:not(.eyebrow) {
    max-width: 58rem;
    line-height: 1.45;
}

.workspace-actions .btn {
    min-height: 2.35rem;
}

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.85rem;
}

.metric-card {
    min-height: 7.2rem;
    padding: 1rem;
    background: rgba(15, 24, 35, 0.82);
}

.metric-card:hover,
.card:hover,
.tabcontent:hover {
    box-shadow: none;
}

.metric-label {
    color: #58d8ff;
}

.metric-value {
    font-size: clamp(1.45rem, 2vw, 1.9rem);
}

.quick-grid,
.chart-grid,
.cms-quick-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.85rem;
}

.quick-card,
.stack-item,
.service-item,
.form-panel,
.cms-fieldset,
.smart-device-card,
.smart-scene-card,
.smart-room-summary-card {
    border: 1px solid rgba(128, 160, 192, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: none;
}

.quick-card {
    padding: 0.9rem 1rem;
}

.quick-card h4,
.panel-card h3,
.chart-card h3,
.table-card h3,
.empty-card h3,
.form-panel h3 {
    color: #ffffff;
    text-align: left;
    font-size: 1rem;
    line-height: 1.25;
}

.panel-card,
.chart-card,
.table-card,
.empty-card,
.form-panel,
.card {
    border: 1px solid rgba(128, 160, 192, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
        rgba(15, 24, 35, 0.88);
    box-shadow: none;
}

.card {
    color: #e7eef6;
}

.table-card {
    overflow: hidden;
}

.table-responsive {
    border: 1px solid rgba(128, 160, 192, 0.16);
    border-radius: 8px;
}

.table {
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.table th {
    padding: 0.82rem 0.9rem;
    color: #d7e4ef;
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(128, 160, 192, 0.16);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.table td {
    padding: 0.82rem 0.9rem;
    color: #dce7f1 !important;
    border-color: rgba(128, 160, 192, 0.12);
    background: rgba(255, 255, 255, 0.012);
}

.table-striped tbody tr:nth-of-type(odd),
.table-striped tbody tr:nth-of-type(even) {
    background: transparent;
}

.table-hover tbody tr:hover,
.table tbody tr:hover td {
    background: rgba(88, 216, 255, 0.055);
}

.table small,
.card-text,
.muted {
    color: var(--lhx-muted);
}

.inline-actions {
    gap: 0.45rem;
}

.inline-actions .btn,
.toolbar-form .btn,
.site-actions .btn,
.btn-sm {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    margin: 0;
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
}

.toolbar-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto auto;
    gap: 0.65rem;
    align-items: center;
}

.toolbar-form .form-control,
.toolbar-form .form-select {
    width: 100%;
    min-width: 0;
}

.form-control,
.form-select,
textarea.form-control,
.form-group input,
.form-group textarea,
.form-group select {
    border-color: rgba(128, 160, 192, 0.24) !important;
    border-radius: 8px;
    background: rgba(5, 10, 16, 0.45) !important;
}

.form-check-input {
    background-color: rgba(5, 10, 16, 0.55);
    border-color: rgba(128, 160, 192, 0.35);
}

.form-check-label,
.form-group label {
    color: #cbd8e4;
}

.nav-tabs {
    gap: 0.35rem;
    border-bottom: 1px solid rgba(128, 160, 192, 0.16);
}

.nav-tabs .nav-link {
    width: auto;
    margin: 0;
    color: #b9c8d8;
    border: 1px solid transparent;
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: #58d8ff;
    background: rgba(88, 216, 255, 0.1);
    border-color: rgba(88, 216, 255, 0.18);
}

.pagination {
    gap: 0.35rem;
    margin: 1rem 0 0;
}

.page-link {
    border-radius: 8px;
    border-color: rgba(128, 160, 192, 0.2);
    color: #d7e2ec;
    background: rgba(255, 255, 255, 0.035);
}

.page-item.active .page-link {
    color: #06121d;
    background: #58d8ff;
    border-color: #58d8ff;
}

.status-pill {
    border: 1px solid rgba(128, 160, 192, 0.16);
}

.split-grid,
.cms-editor-layout,
.cms-editor-layout--browse,
.smart-home-layout {
    gap: 1rem;
}

.section-stack {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.site-grid,
.service-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.alert {
    border-radius: 8px;
    border: 1px solid rgba(128, 160, 192, 0.22);
}

@media (max-width: 1500px) {
    .app-topbar {
        grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 340px) auto;
    }

    .topbar-actions > .topbar-action span,
    .topbar-search kbd {
        display: none;
    }
}

@media (max-width: 991px) {
    .sidebar {
        position: relative;
        width: 100%;
        min-height: 0;
    }

    .sidebar-sticky {
        height: auto;
        padding-bottom: 0.75rem;
    }

    .sidebar-brand {
        padding: 1.1rem;
    }

    .nav-group {
        padding-top: 0.75rem;
    }

    .user-profile {
        position: relative;
        width: 100%;
    }

    .app-topbar {
        position: sticky;
        left: 0;
        height: auto;
        grid-template-columns: minmax(0, 1fr);
        padding: 0.9rem 1rem;
    }

    .topbar-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .topbar-search {
        order: 3;
    }

    .main {
        width: 100%;
        margin-left: 0;
        padding: 1rem;
    }

    .toolbar-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .toolbar-form .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .topbar-user small,
    .topbar-title span {
        display: none;
    }

    .workspace-actions,
    .inline-actions,
    .site-actions {
        width: 100%;
    }

    .workspace-actions .btn,
    .inline-actions .btn,
    .site-actions .btn {
        width: 100%;
    }
}

/* Mobile off-canvas navigation and topbar-owned profile menu */
.mobile-nav-toggle,
.mobile-nav-backdrop {
    display: none;
}

.topbar-profile {
    position: relative;
}

.topbar-profile-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    min-width: 190px;
    padding: 0.4rem;
    border: 1px solid rgba(128, 160, 192, 0.24);
    border-radius: 10px;
    background: #101a26;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

.topbar-profile-menu.is-open {
    display: grid;
    gap: 0.25rem;
}

.topbar-profile-menu a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.7rem;
    border-radius: 8px;
    color: #d7e2ec;
    text-decoration: none;
}

.topbar-profile-menu a:hover,
.topbar-profile-menu a:focus {
    color: #ffffff;
    background: rgba(88, 216, 255, 0.1);
}

.topbar-user[aria-expanded="true"] {
    color: #ffffff;
    border-color: rgba(88, 216, 255, 0.2);
    background: rgba(88, 216, 255, 0.08);
}

@media (max-width: 991px) {
    body.mobile-nav-open {
        overflow: hidden;
    }

    .mobile-nav-toggle {
        position: fixed;
        top: 0.85rem;
        left: 0.85rem;
        z-index: 130;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.55rem;
        height: 2.55rem;
        border: 1px solid rgba(128, 160, 192, 0.24);
        border-radius: 8px;
        color: #ffffff;
        background: rgba(15, 24, 35, 0.96);
        transition: left 0.22s ease, background 0.18s ease;
    }

    .mobile-nav-open .mobile-nav-toggle {
        left: calc(min(82vw, 320px) - 3.35rem);
        background: rgba(8, 14, 22, 0.98);
    }

    .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 118;
        background: rgba(0, 0, 0, 0.54);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
    }

    .mobile-nav-open .mobile-nav-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 125;
        width: min(82vw, 320px);
        min-height: 100vh;
        transform: translateX(-105%);
        transition: transform 0.22s ease, box-shadow 0.22s ease, visibility 0s linear 0.22s;
        box-shadow: none;
        visibility: hidden;
    }

    .mobile-nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 18px 0 55px rgba(0, 0, 0, 0.38);
        visibility: visible;
        transition-delay: 0s;
    }

    .sidebar-sticky {
        height: 100vh;
        padding: 0 0 1rem;
        overflow-y: auto;
    }

    .app-topbar {
        position: sticky;
        top: 0;
        left: 0;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 0.75rem 0.85rem 0.75rem 4rem;
    }

    .topbar-title {
        min-width: 0;
    }

    .topbar-title strong,
    .topbar-title span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-search {
        grid-column: 1 / -1;
        order: 3;
    }

    .topbar-actions {
        justify-content: flex-end;
    }

    .topbar-action span,
    .topbar-search kbd,
    .topbar-user small,
    .topbar-user > i {
        display: none;
    }

    .topbar-user {
        margin-left: 0;
        padding: 0.25rem;
        border-left: 0;
        border-radius: 8px;
    }

    .topbar-profile-menu {
        position: fixed;
        top: 4.15rem;
        right: 0.85rem;
    }

    .main,
    .footer {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
}

/* Final override layer for the redesigned shell and section navigation.
   Its token values are now the canonical :root at the top of this file. */

html,
body {
    background: var(--lhx-bg);
    color: var(--lhx-text);
    font-family: 'Manrope', 'Segoe UI', Arial, sans-serif;
    letter-spacing: -0.01em;
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(18, 29, 46, 0.98), rgba(11, 18, 29, 0.98)),
        #0e1724;
    border-right: 1px solid rgba(148, 163, 184, 0.14);
}

.sidebar-brand,
.user-profile {
    border-color: rgba(148, 163, 184, 0.14);
}

.sidebar-brand-sub,
.nav-group-label {
    color: rgba(219, 234, 254, 0.68);
}

.nav-link {
    color: rgba(234, 242, 250, 0.88);
}

.nav-link.active,
.nav-link:hover,
.nav-link:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(125, 176, 255, 0.2);
    color: #ffffff;
}

.app-topbar {
    background: rgba(250, 252, 254, 0.9);
    border-bottom: 1px solid rgba(216, 226, 236, 0.92);
    backdrop-filter: blur(16px);
}

.topbar-title strong,
.topbar-user small,
.topbar-search input,
.topbar-action,
.topbar-user {
    color: var(--lhx-text);
}

.topbar-title span,
.topbar-user em,
.topbar-search,
.topbar-search input::placeholder {
    color: var(--lhx-muted);
}

.topbar-search {
    background: rgba(243, 247, 251, 0.92);
    border-color: rgba(184, 198, 214, 0.9);
}

.topbar-user {
    border-left-color: rgba(184, 198, 214, 0.72);
}

.topbar-user > span {
    background: linear-gradient(180deg, #1d74f5, #1658d3);
}

.topbar-menu-list,
.topbar-profile-menu,
.dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(216, 226, 236, 0.96);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

.topbar-menu-list a,
.topbar-profile-menu a,
.dropdown-item {
    color: var(--lhx-text);
}

.main {
    padding: 6.35rem 2rem 2rem;
}

.footer {
    background: transparent;
    border-top: 1px solid rgba(216, 226, 236, 0.92);
    color: var(--lhx-muted);
}

.workspace-header,
.ops-overview,
.workflow-strip,
.section-block,
.panel-card,
.chart-card,
.table-card,
.empty-card,
.metric-card,
.overview-card,
.service-tile,
.site-card,
.form-panel,
.card,
.section-nav-card,
.section-panel {
    background: var(--lhx-panel);
    border: 1px solid var(--lhx-border);
    box-shadow: var(--lhx-shadow);
}

.metric-card {
    box-shadow: none;
    border-color: var(--lhx-border);
}

.metric-value {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Flattened: a labeled group, not another nested card - its own .domain-link
   children already carry the card treatment, so this avoids box-in-a-box. */
.domain-card {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.workspace-header {
    min-height: auto;
    padding: 1.35rem 1.5rem;
    background: var(--lhx-panel);
    border: 1px solid var(--lhx-border);
}

.workspace-header h1 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.workspace-header h1,
.ops-summary h2,
.section-heading h2,
.rail-heading h2,
.panel-card h3,
.chart-card h3,
.table-card h3,
.empty-card h3,
.form-panel h3,
.quick-card h4,
.domain-card h3,
.service-tile h3,
.site-card h3 {
    color: var(--lhx-text);
}

.workspace-header p,
.ops-summary p,
.section-heading p,
.panel-card p,
.table-card p,
.empty-card p,
.metric-note,
.stack-item small,
.stack-item p,
.domain-description,
.domain-link small,
.service-tile p,
.site-card p {
    color: var(--lhx-muted);
}

.workspace-kicker,
.eyebrow,
.metric-label {
    color: var(--lhx-accent-strong);
}

.workflow-strip,
.domain-link,
.service-tile,
.stack-item,
.quick-card,
.site-card,
.pin-button,
.section-nav-link {
    background: rgba(247, 250, 253, 0.92);
    border: 1px solid rgba(221, 229, 238, 0.94);
    color: var(--lhx-text);
}

.domain-link:hover,
.domain-link:focus,
.pin-button:hover,
.pin-button:focus,
.section-nav-link:hover,
.section-nav-link:focus,
.stack-item:hover,
.cms-widget-jump:hover {
    border-color: rgba(156, 198, 255, 0.95);
    background: rgba(240, 246, 255, 0.98);
    color: var(--lhx-accent-strong);
}

.domain-link-icon,
.hub-icon,
.action-item > i {
    background: rgba(29, 116, 245, 0.1);
    color: var(--lhx-accent);
}

.btn {
    width: auto;
    min-height: 2.7rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #1d74f5, #1658d3);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(29, 116, 245, 0.18);
}

.btn-secondary,
.btn-warning,
.btn-info {
    background: #ffffff;
    border-color: rgba(204, 216, 228, 0.96);
    color: var(--lhx-text);
    box-shadow: none;
}

.btn-success {
    background: linear-gradient(180deg, #1f9d6c, #15835f);
}

.btn-danger {
    background: linear-gradient(180deg, #da5560, #cb3f48);
}

.toolbar-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}

.toolbar-form .form-control,
.toolbar-form .form-select {
    flex: 1 1 220px;
}

.form-control,
.form-select,
textarea.form-control,
.form-group input,
.form-group textarea,
.form-group select {
    background: #ffffff !important;
    color: var(--lhx-text) !important;
    border: 1px solid rgba(204, 216, 228, 0.96) !important;
    border-radius: 14px;
    padding: 0.82rem 0.95rem;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: rgba(29, 116, 245, 0.7) !important;
    box-shadow: 0 0 0 0.22rem rgba(29, 116, 245, 0.12) !important;
}

.form-check-input:checked {
    background-color: var(--lhx-accent);
    border-color: var(--lhx-accent);
}

.form-group label,
.form-check-label {
    color: var(--lhx-soft);
    font-weight: 700;
}

.table-responsive {
    border-radius: 16px;
    border: 1px solid rgba(221, 229, 238, 0.96);
    background: #ffffff;
}

.table th {
    background: #f4f8fc;
    color: #5d6d81;
    border-color: #dbe4ee;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.table td {
    color: var(--lhx-text) !important;
    border-color: #e2eaf2;
    background: rgba(255, 255, 255, 0.92);
}

.status-pill {
    background: #eef4fb;
    color: var(--lhx-soft);
    border: 1px solid rgba(204, 216, 228, 0.96);
}

.status-pill.good {
    color: var(--lhx-success);
    background: rgba(21, 131, 95, 0.08);
}

.status-pill.warn {
    color: var(--lhx-warning);
    background: rgba(183, 121, 31, 0.1);
}

.status-pill.bad {
    color: var(--lhx-danger);
    background: rgba(192, 41, 58, 0.1);
}

.section-nav-shell {
    display: grid;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.section-nav-card {
    position: sticky;
    top: 6rem;
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 20px;
}

.section-nav-card-head h2 {
    margin: 0;
    font-size: 1.18rem;
}

.section-nav-card-head p {
    margin: 0.45rem 0 0;
    line-height: 1.55;
}

.section-nav-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.section-nav-summary > div {
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    background: rgba(247, 250, 253, 0.96);
    border: 1px solid rgba(221, 229, 238, 0.94);
}

.section-nav-summary span {
    display: block;
    color: var(--lhx-muted);
    font-size: 0.78rem;
    margin-bottom: 0.22rem;
}

.section-nav-summary strong {
    color: var(--lhx-text);
    font-size: 0.98rem;
}

.section-nav {
    display: grid;
    gap: 0.55rem;
}

.section-nav-link {
    display: grid;
    gap: 0.25rem;
    padding: 0.9rem 0.95rem;
    border-radius: 14px;
    text-decoration: none;
}

.section-nav-link span {
    color: var(--lhx-text);
    font-size: 0.92rem;
    font-weight: 700;
}

.section-nav-link small {
    color: var(--lhx-muted);
    line-height: 1.45;
}

.section-nav-link.is-active {
    border-color: rgba(29, 116, 245, 0.24);
    background:
        linear-gradient(180deg, rgba(29, 116, 245, 0.1), rgba(255, 255, 255, 0.96)),
        #ffffff;
}

.section-nav-link.is-active span,
.section-nav-link.is-active small {
    color: var(--lhx-accent-strong);
}

.section-stage {
    display: grid;
    gap: 1rem;
}

.section-panel {
    display: none;
    padding: 1.2rem;
    border-radius: 20px;
}

.section-panel.is-active {
    display: block;
}

.detail-shell .section-panel .form-panel,
.detail-shell .section-panel .stack-list,
.detail-shell .section-panel .metric-grid {
    margin-top: 1rem;
}

@media (max-width: 1200px) {
    .section-nav-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .section-nav-card {
        position: static;
    }
}

@media (max-width: 991px) {
    .app-topbar {
        background: rgba(250, 252, 254, 0.96);
    }

    .main {
        padding: 1rem;
    }

    .footer {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 767px) {
    .toolbar-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .toolbar-form .form-control,
    .toolbar-form .form-select,
    .toolbar-form .btn {
        width: 100%;
    }

    .section-nav-summary {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* LHX F1 race control dashboard */
.f1-control-header {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(255, 89, 103, 0.16), transparent 22rem),
        linear-gradient(135deg, rgba(255, 211, 71, 0.12), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 252, 0.98));
}

.f1-control-header::after {
    content: "";
    position: absolute;
    right: -3rem;
    top: -4rem;
    width: 15rem;
    height: 15rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 219, 122, 0.22), transparent 65%);
    pointer-events: none;
}

.f1-workspace-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.f1-primary-grid {
    align-items: start;
}

.f1-primary-grid > .section-stack:first-child {
    min-width: 0;
}

.f1-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.f1-panel-head p {
    margin-bottom: 0;
}

.f1-auto-refresh {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(12, 23, 36, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--lhx-text);
    font-size: 0.86rem;
    white-space: nowrap;
}

.f1-auto-refresh input {
    margin: 0;
}

.f1-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.f1-telemetry-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(226, 232, 240, 0.96);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.96));
    min-height: 9.5rem;
}

.f1-telemetry-card.tone-attack {
    box-shadow: inset 0 0 0 1px rgba(255, 89, 103, 0.08);
}

.f1-telemetry-card.tone-good {
    box-shadow: inset 0 0 0 1px rgba(15, 219, 122, 0.1);
}

.f1-telemetry-card.tone-warn {
    box-shadow: inset 0 0 0 1px rgba(255, 211, 71, 0.14);
}

.f1-telemetry-label,
.f1-telemetry-source {
    font-size: 0.82rem;
    color: var(--lhx-muted);
}

.f1-telemetry-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.f1-telemetry-value {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
}

.f1-telemetry-value strong {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1;
    color: #09111c;
    letter-spacing: -0.05em;
}

.f1-telemetry-value small {
    font-size: 0.9rem;
    color: var(--lhx-soft);
}

.f1-track-card {
    overflow: hidden;
}

.f1-track-map {
    padding: 1rem;
    border-radius: 1.25rem;
    background:
        radial-gradient(circle at 50% 20%, rgba(255, 89, 103, 0.12), transparent 28rem),
        linear-gradient(180deg, #111a27, #0b1320);
}

.f1-track-map svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 16rem;
}

.f1-track-outline {
    fill: none;
    stroke: url(#f1TrackStroke);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.f1-track-marker {
    fill: #f8fafc;
    stroke: #0b1320;
    stroke-width: 1.2;
}

.f1-track-map text {
    fill: #f8fafc;
    font-size: 4px;
    text-anchor: middle;
    font-weight: 700;
}

.f1-track-driver-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.f1-track-driver-chip {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    color: #d8e2ee;
    background: rgba(11, 19, 32, 0.84);
}

.f1-table {
    margin-bottom: 0;
}

.f1-table th {
    color: var(--lhx-soft);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-bottom-color: rgba(226, 232, 240, 0.96);
}

.f1-table td {
    vertical-align: middle;
    border-bottom-color: rgba(226, 232, 240, 0.82);
}

.f1-tyre-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.f1-tyre-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(247, 250, 253, 0.92);
    border: 1px solid rgba(221, 229, 238, 0.92);
}

.f1-tyre-card span {
    font-size: 1rem;
    color: #09111c;
}

.f1-tyre-card small {
    color: var(--lhx-muted);
}

.f1-message-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    max-height: 31rem;
    overflow: auto;
    padding-right: 0.2rem;
}

.f1-message-card {
    padding: 1rem 1.05rem;
    border-radius: 1rem;
    border: 1px solid rgba(221, 229, 238, 0.92);
    background: rgba(248, 251, 254, 0.94);
}

.f1-message-card.is-red {
    border-color: rgba(255, 89, 103, 0.28);
    background: rgba(255, 89, 103, 0.08);
}

.f1-message-card.is-yellow {
    border-color: rgba(255, 211, 71, 0.3);
    background: rgba(255, 211, 71, 0.1);
}

.f1-message-card.is-green {
    border-color: rgba(15, 219, 122, 0.26);
    background: rgba(15, 219, 122, 0.08);
}

.f1-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: baseline;
    margin-bottom: 0.45rem;
}

.f1-message-meta span {
    color: var(--lhx-soft);
    font-size: 0.82rem;
    white-space: nowrap;
}

.f1-message-card p {
    margin: 0;
    color: var(--lhx-text);
}

.f1-light-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.f1-light-config-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.f1-light-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.f1-light-settings label {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    color: var(--lhx-text);
    font-weight: 600;
}

.f1-light-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.f1-light-option {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(221, 229, 238, 0.92);
    background: rgba(247, 250, 253, 0.9);
    color: var(--lhx-text);
}

.f1-light-option input {
    margin-top: 0.15rem;
}

.f1-light-option span {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.f1-light-option small {
    color: var(--lhx-muted);
}

.f1-empty-card {
    padding: 1.15rem;
    min-height: auto;
}

@media (max-width: 1200px) {
    .f1-telemetry-grid,
    .f1-light-picker,
    .f1-light-settings,
    .f1-tyre-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .f1-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .f1-telemetry-grid,
    .f1-light-picker,
    .f1-light-settings,
    .f1-tyre-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .f1-workspace-actions,
    .f1-light-actions {
        width: 100%;
    }

    .f1-workspace-actions .btn,
    .f1-light-actions .btn {
        width: 100%;
    }

    .f1-track-map svg {
        min-height: 13rem;
    }
}

/* LHX Manufacturing */
.manufacturing-header {
    background:
        radial-gradient(circle at top right, rgba(255, 138, 43, 0.18), transparent 20rem),
        linear-gradient(135deg, rgba(18, 29, 46, 0.04), rgba(255, 255, 255, 0) 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 253, 0.99));
}

.manufacturing-command-header {
    border-color: rgba(255, 138, 43, 0.2);
}

.manufacturing-link-grid,
.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.manufacturing-link-card,
.marketplace-card {
    display: grid;
    gap: 0.45rem;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(221, 229, 238, 0.94);
    background: rgba(247, 250, 253, 0.96);
    color: var(--lhx-text);
    text-decoration: none;
}

.manufacturing-link-card:hover,
.manufacturing-link-card:focus {
    text-decoration: none;
    border-color: rgba(255, 138, 43, 0.32);
    background: rgba(255, 248, 242, 0.98);
}

.manufacturing-form,
.manufacturing-form-grid,
.manufacturing-form-block {
    display: grid;
    gap: 1rem;
}

body.drawer-open {
    overflow: hidden;
}

.workspace-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(4px);
    z-index: 1040;
}

.workspace-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(880px, calc(100vw - 1.5rem));
    max-width: 100%;
    z-index: 1045;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
}

.workspace-drawer-panel {
    width: 100%;
    height: 100vh;
    pointer-events: auto;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.98));
    border-left: 1px solid rgba(216, 226, 236, 0.96);
    box-shadow: -24px 0 56px rgba(15, 23, 42, 0.16);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.workspace-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.3rem 1.4rem 1.1rem;
    border-bottom: 1px solid rgba(216, 226, 236, 0.96);
    background:
        linear-gradient(135deg, rgba(29, 116, 245, 0.1), rgba(255, 255, 255, 0) 52%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.98));
}

.workspace-drawer-header h2 {
    margin: 0.2rem 0 0;
    font-size: 1.55rem;
    color: var(--lhx-text);
}

.workspace-drawer-header p:not(.eyebrow) {
    margin: 0.45rem 0 0;
    max-width: 34rem;
    color: var(--lhx-muted);
}

.workspace-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(204, 216, 228, 0.96);
    background: #ffffff;
    color: var(--lhx-text);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.workspace-drawer-close:hover,
.workspace-drawer-close:focus {
    background: #f2f7ff;
    border-color: rgba(156, 198, 255, 0.95);
    color: var(--lhx-accent-strong);
}

.workspace-drawer-body {
    overflow-y: auto;
    padding: 1.2rem 1.4rem 1.5rem;
}

.product-editor-shell {
    display: grid;
    gap: 1rem;
}

.product-editor-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.product-editor-stat {
    display: grid;
    gap: 0.25rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(221, 229, 238, 0.94);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.product-editor-stat-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lhx-muted);
}

.product-editor-stat strong {
    color: var(--lhx-text);
    font-size: 1rem;
}

.product-editor-stat small {
    color: var(--lhx-muted);
}

.product-editor-lead {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.05rem;
    border-radius: 1rem;
    border: 1px solid rgba(221, 229, 238, 0.94);
    background: rgba(247, 250, 253, 0.96);
}

.product-editor-lead strong {
    color: var(--lhx-text);
    font-size: 1rem;
}

.product-editor-lead p {
    margin: 0;
    color: var(--lhx-muted);
}

.product-editor-inline-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.summary-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(29, 116, 245, 0.08);
    border: 1px solid rgba(173, 205, 246, 0.86);
    color: var(--lhx-accent-strong);
    font-size: 0.88rem;
    font-weight: 600;
}

.product-editor-section {
    border: 1px solid rgba(221, 229, 238, 0.94);
    border-radius: 1rem;
    background: rgba(247, 250, 253, 0.96);
}

.product-editor-section summary {
    cursor: pointer;
    list-style: none;
    padding: 1rem 1.05rem;
    font-weight: 700;
    color: var(--lhx-text);
}

.product-editor-section summary::-webkit-details-marker {
    display: none;
}

.product-editor-section[open] summary {
    border-bottom: 1px solid rgba(221, 229, 238, 0.94);
}

.product-editor-section-body {
    padding: 1rem 1.05rem 1.05rem;
}

.product-editor-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    padding-top: 0.25rem;
    background: linear-gradient(180deg, rgba(244, 248, 252, 0), rgba(244, 248, 252, 0.96) 25%, rgba(244, 248, 252, 0.98));
}

.manufacturing-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.manufacturing-form-grid .form-group-wide {
    grid-column: 1 / -1;
}

.manufacturing-form-block {
    margin-top: 1rem;
}

.manufacturing-form-block h4 {
    margin: 0;
    color: var(--lhx-text);
}

.manufacturing-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.manufacturing-check {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(221, 229, 238, 0.94);
    background: rgba(247, 250, 253, 0.96);
    color: var(--lhx-text);
}

.manufacturing-job-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.manufacturing-job-head h3 {
    margin-bottom: 0.2rem;
}

.manufacturing-job-head p {
    margin-bottom: 0;
}

.manufacturing-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.8rem;
    color: var(--lhx-muted);
    font-size: 0.9rem;
}

.shopfront-body {
    background:
        radial-gradient(circle at top right, rgba(255, 138, 43, 0.16), transparent 24rem),
        radial-gradient(circle at top left, rgba(29, 116, 245, 0.08), transparent 20rem),
        linear-gradient(180deg, #f7fafc 0%, #eef3f8 100%);
    color: #0f1724;
}

.shop-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.25rem 0 3rem;
}

.shop-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(221, 229, 238, 0.94);
    box-shadow: var(--lhx-shadow);
    backdrop-filter: blur(16px);
}

.shop-brand {
    color: #0f1724;
    font-family: 'Orbitron', 'Manrope', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-decoration: none;
}

.shop-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.shop-nav a {
    color: var(--lhx-text);
    text-decoration: none;
    font-weight: 700;
}

.shop-hero,
.shop-product-layout {
    margin-top: 1.5rem;
    padding: 1.8rem;
    border-radius: 1.6rem;
    background:
        radial-gradient(circle at top right, rgba(255, 138, 43, 0.14), transparent 18rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 253, 0.98));
    border: 1px solid rgba(221, 229, 238, 0.94);
    box-shadow: var(--lhx-shadow);
}

.shop-hero-compact {
    padding: 1.4rem 1.6rem;
}

.shop-kicker {
    margin: 0 0 0.6rem;
    color: #b75a15;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.shop-hero h1,
.shop-product-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1.02;
    color: #0f1724;
}

.shop-hero p:last-child,
.shop-product-copy p {
    margin-top: 0.8rem;
    color: var(--lhx-muted);
    max-width: 48rem;
    font-size: 1.02rem;
}

.shop-category-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.2rem;
}

.shop-category-strip a {
    display: grid;
    gap: 0.2rem;
    min-width: 11rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(221, 229, 238, 0.94);
    background: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.shop-category-strip strong {
    color: var(--lhx-text);
}

.shop-category-strip small {
    color: var(--lhx-muted);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.shop-card {
    display: grid;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(221, 229, 238, 0.94);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--lhx-shadow);
}

.shop-card-media,
.shop-product-image {
    min-height: 15rem;
    background:
        radial-gradient(circle at top right, rgba(255, 138, 43, 0.18), transparent 12rem),
        linear-gradient(135deg, #dbe6f1, #f5f8fb);
}

.shop-card-media img,
.shop-product-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 15rem;
    color: #0f1724;
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.shop-card-copy {
    display: grid;
    gap: 0.7rem;
    padding: 1.2rem;
}

.shop-card-copy small {
    color: #b75a15;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.shop-card-copy h2 {
    margin: 0;
    text-align: left;
    font-size: 1.25rem;
    color: #0f1724;
}

.shop-card-copy p {
    margin: 0;
    color: var(--lhx-muted);
}

.shop-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.shop-card-meta span {
    color: #0f1724;
    font-size: 1.25rem;
    font-weight: 800;
}

.shop-card-meta a {
    color: #b75a15;
    font-weight: 700;
    text-decoration: none;
}

.shop-product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 1.3rem;
}

.shop-product-media {
    display: grid;
    gap: 1rem;
}

.shop-product-copy {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.shop-product-price {
    font-size: 2rem;
    font-weight: 800;
    color: #0f1724;
}

.shop-spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.shop-spec-grid div {
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: rgba(248, 251, 254, 0.96);
    border: 1px solid rgba(221, 229, 238, 0.94);
}

.shop-spec-grid span {
    display: block;
    color: var(--lhx-muted);
    font-size: 0.82rem;
    margin-bottom: 0.18rem;
}

.shop-spec-grid strong {
    color: #0f1724;
}

.shop-product-notes {
    display: grid;
    gap: 0.5rem;
}

.shop-product-notes p {
    margin: 0;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: rgba(248, 251, 254, 0.96);
    border: 1px solid rgba(221, 229, 238, 0.94);
}

@media (max-width: 1100px) {
    .shop-grid,
    .manufacturing-link-grid,
    .marketplace-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-product-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 767px) {
    .workspace-drawer {
        width: 100vw;
    }

    .workspace-drawer-header,
    .workspace-drawer-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .workspace-drawer-header {
        flex-direction: column;
    }

    .workspace-drawer-close {
        align-self: stretch;
        text-align: center;
    }

    .manufacturing-form-grid,
    .manufacturing-check-grid,
    .shop-grid,
    .shop-spec-grid,
    .manufacturing-link-grid,
    .marketplace-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .shop-shell {
        width: min(100%, calc(100% - 1rem));
        padding-top: 0.75rem;
    }

    .shop-topbar {
        border-radius: 1.1rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .shop-hero,
    .shop-product-layout {
        padding: 1.2rem;
        border-radius: 1.2rem;
    }
}

/* ---- Visual page builder (page_builder.php) ---- */
.lhx-builder-body {
    margin: 0;
    background: var(--lhx-bg);
    overflow: hidden;
}

.lhx-builder-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.lhx-builder-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--lhx-panel);
    border-bottom: 1px solid var(--lhx-border);
    flex: 0 0 auto;
}

.lhx-builder-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.lhx-builder-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: var(--lhx-bg-soft);
    color: var(--lhx-text);
}

.lhx-builder-topbar-left strong {
    display: block;
    font-size: 0.95rem;
}

.lhx-builder-topbar-left small {
    color: var(--lhx-muted);
}

.lhx-builder-title-edit {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    padding: 0.15rem 0.4rem;
    margin: -0.15rem -0.4rem;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}

.lhx-builder-title-edit:hover {
    background: var(--lhx-bg-soft);
}

.lhx-builder-title-edit i {
    font-size: 0.7rem;
    color: var(--lhx-muted);
    opacity: 0;
    transition: opacity 0.12s;
}

.lhx-builder-title-edit:hover i {
    opacity: 1;
}

.lhx-builder-topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lhx-builder-save-state {
    font-size: 0.82rem;
    color: var(--lhx-muted);
}

.lhx-builder-save-state.is-error {
    color: var(--lhx-danger);
}

/* Toast: prominent bottom-right feedback for builder actions (add/delete/etc.)
   so the user always sees something is happening during the network lag. */
.lhx-toast-stack {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.lhx-toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 220px;
    max-width: 360px;
    padding: 0.7rem 0.95rem;
    border-radius: 12px;
    background: var(--lhx-surface, #fff);
    color: var(--lhx-text, #1f2733);
    font-size: 0.86rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-left: 4px solid var(--lhx-primary, #3563e9);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: auto;
}

.lhx-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.lhx-toast .lhx-toast-icon {
    flex: 0 0 auto;
    font-size: 1rem;
    color: var(--lhx-primary, #3563e9);
}

.lhx-toast.is-loading {
    border-left-color: var(--lhx-primary, #3563e9);
}

.lhx-toast.is-success {
    border-left-color: #0f9d58;
}
.lhx-toast.is-success .lhx-toast-icon {
    color: #0f9d58;
}

.lhx-toast.is-error {
    border-left-color: var(--lhx-danger, #d93636);
}
.lhx-toast.is-error .lhx-toast-icon {
    color: var(--lhx-danger, #d93636);
}

.lhx-builder-publish-state {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 157, 88, 0.12);
    color: #0f9d58;
}
.lhx-builder-publish-state.is-dirty {
    background: rgba(217, 163, 64, 0.16);
    color: #b3792a;
}

.lhx-builder-main {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: 1fr;
    min-height: 0;
}

/* When editing a widget, a docked panel opens on the RIGHT so it never covers
   the part of the page you're editing. */
.lhx-builder-main.lhx-editor-open {
    grid-template-columns: 280px 1fr minmax(340px, 400px);
}

.lhx-builder-sidebar {
    grid-column: 1;
    grid-row: 1 / 3;
    border-right: 1px solid var(--lhx-border);
    background: var(--lhx-panel);
    overflow-y: auto;
    padding: 1rem;
}

.lhx-builder-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.lhx-builder-tab {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--lhx-border);
    background: var(--lhx-bg);
    border-radius: var(--lhx-radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.lhx-builder-tab.is-active {
    background: var(--lhx-accent);
    color: #fff;
    border-color: var(--lhx-accent);
}

.lhx-widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lhx-widget-order-hint {
    color: var(--lhx-muted);
    font-size: 0.78rem;
    margin: 0 0 0.85rem;
}

.lhx-widget-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.6rem;
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius-sm);
    margin-bottom: 0.5rem;
    background: var(--lhx-bg);
    cursor: pointer;
    font-size: 0.85rem;
}

.lhx-widget-list-item.is-selected {
    border-color: var(--lhx-accent);
    background: rgba(41, 82, 227, 0.06);
}

.lhx-widget-list-item.is-dragging {
    opacity: 0.4;
}

.lhx-widget-list-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lhx-widget-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: auto;
}

.lhx-drag-handle {
    color: var(--lhx-muted);
    cursor: grab;
}

.lhx-widget-action {
    border: none;
    background: none;
    color: var(--lhx-muted);
    padding: 0.25rem;
    border-radius: 6px;
}

.lhx-widget-action:hover {
    background: var(--lhx-bg-soft);
    color: var(--lhx-text);
}

.lhx-widget-delete:hover {
    color: var(--lhx-danger);
}

.lhx-builder-empty-hint {
    color: var(--lhx-muted);
    font-size: 0.85rem;
}

.lhx-widget-insert-row {
    display: flex;
    justify-content: center;
    height: 0.6rem;
    margin: -0.2rem 0;
}

.lhx-widget-insert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    border: none;
    background: var(--lhx-bg-soft);
    color: var(--lhx-muted);
    font-size: 0.65rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s, background 0.12s, color 0.12s;
}

.lhx-widget-insert-row:hover .lhx-widget-insert-btn,
.lhx-widget-list:hover .lhx-widget-insert-btn {
    opacity: 1;
}

.lhx-widget-insert-btn:hover {
    background: var(--lhx-accent);
    color: #fff;
}

.lhx-widget-search {
    position: relative;
    margin-bottom: 0.75rem;
}

.lhx-widget-search i {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--lhx-muted);
    font-size: 0.8rem;
}

.lhx-widget-search input {
    width: 100%;
    padding: 0.5rem 0.6rem 0.5rem 2rem;
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius-sm);
    font-size: 0.85rem;
    background: var(--lhx-bg);
    color: var(--lhx-text);
}

.lhx-widget-search-empty {
    color: var(--lhx-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem 0;
}

.lhx-widget-category h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--lhx-muted);
    margin: 1rem 0 0.5rem;
}

.lhx-widget-palette {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.lhx-palette-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius-sm);
    background: var(--lhx-surface, #fff);
    text-align: left;
    cursor: pointer;
    width: 100%;
    transition: border-color .12s, box-shadow .12s, transform .12s;
}

.lhx-palette-item:hover {
    border-color: var(--lhx-accent);
    box-shadow: 0 8px 20px -14px rgba(0,0,0,.35);
    transform: translateY(-1px);
}

.lhx-palette-icon {
    flex: none;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 9px;
    background: var(--lhx-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lhx-accent-strong);
}
.lhx-palette-icon i { font-size: 1.05rem; }

.lhx-palette-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.lhx-palette-label { font-weight: 700; font-size: 0.85rem; }
.lhx-palette-desc {
    font-size: 0.72rem;
    color: var(--lhx-muted);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.lhx-palette-add {
    flex: none;
    color: var(--lhx-muted);
    opacity: 0;
    transition: opacity .12s;
}
.lhx-palette-item:hover .lhx-palette-add { opacity: 1; color: var(--lhx-accent-strong); }

.lhx-builder-canvas-wrap {
    grid-column: 2;
    grid-row: 1;
    background: #eceef2;
    overflow: auto;
    /* Always reserve the vertical scrollbar gutter so it appearing/disappearing
       never changes the measured width — otherwise the JS canvas-fit below would
       ping-pong the zoom and make the whole editor jump. */
    scrollbar-gutter: stable;
    padding: 1.5rem;
    min-height: 0;
    display: flex;
    justify-content: center;
}

/* The preview renders at a real desktop width and is scaled to fit the canvas
   column (via JS `zoom`), so responsive widgets (galleries, product/news grids)
   show the SAME number of columns as the live site instead of collapsing to
   fewer columns just because the builder pane is narrower. */
.lhx-builder-canvas {
    width: 1280px;
    max-width: 1280px;
    flex: none;
    min-height: calc(100vh - 4.5rem);
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius);
    background: #fff;
    transform-origin: top center;
}

/* Right-docked editor panel: full-height column on the right of the canvas. */
.lhx-builder-editor {
    grid-column: 3;
    grid-row: 1;
    position: relative;
    border-left: 1px solid var(--lhx-border);
    background: var(--lhx-panel);
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: -4px 0 18px rgba(0, 0, 0, 0.06);
}

.lhx-builder-editor-resize { display: none; }

.lhx-builder-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--lhx-border);
    flex: 0 0 auto;
}

.lhx-builder-editor-close {
    border: none;
    background: none;
    color: var(--lhx-muted);
    font-size: 1rem;
}

.lhx-builder-editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.35rem;
    display: block;
}

.lhx-builder-editor-foot {
    padding: 0.85rem 1.5rem;
    border-top: 1px solid var(--lhx-border);
    flex: 0 0 auto;
}

.lhx-widget-editor-desc {
    color: var(--lhx-muted);
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

/* Appearance & styling panel at the bottom of the widget editor */
.lhx-appearance-panel {
    margin-top: 1.25rem;
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius-sm);
    background: var(--lhx-bg);
}
.lhx-appearance-panel summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.7rem 0.9rem;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--lhx-accent-strong);
}
.lhx-appearance-panel summary::-webkit-details-marker { display: none; }
.lhx-appearance-grid { padding: 0.25rem 0.9rem 0.9rem; }

.lhx-repeater {
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius-sm);
    padding: 0.75rem;
    background: var(--lhx-bg);
}

.lhx-repeater-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    border-bottom: 1px dashed var(--lhx-border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.lhx-repeater-row-fields {
    flex: 1;
}

.lhx-repeater-remove {
    border: none;
    background: none;
    color: var(--lhx-muted);
    padding: 0.3rem;
}

.lhx-repeater-remove:hover {
    color: var(--lhx-danger);
}

.lhx-repeater-add {
    margin-top: 0.25rem;
}

.lhx-field-image-preview {
    display: block;
    max-width: 100%;
    max-height: 120px;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

@media (max-width: 980px) {
    .lhx-builder-body {
        overflow: auto;
    }

    .lhx-builder-shell {
        min-height: 100vh;
        height: auto;
    }

    .lhx-builder-topbar {
        flex-wrap: wrap;
        gap: 0.85rem;
        align-items: flex-start;
    }

    .lhx-builder-topbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .lhx-builder-main {
        display: flex;
        flex-direction: column;
    }

    .lhx-builder-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--lhx-border);
        overflow: visible;
    }

    .lhx-builder-panel[data-panel="widgets"] {
        max-height: 18rem;
        overflow-y: auto;
        padding-right: 0.2rem;
    }

    .lhx-builder-canvas-wrap,
    .lhx-builder-editor {
        grid-column: auto;
        grid-row: auto;
        width: 100%;
    }

    .lhx-builder-canvas-wrap {
        padding: 1rem;
    }

    .lhx-builder-canvas {
        min-height: 32rem;
    }

    .lhx-builder-main.lhx-editor-open .lhx-builder-canvas {
        min-height: 22rem;
    }

    .lhx-builder-editor {
        height: auto;
        max-height: 44vh;
    }
}

@media (max-width: 640px) {
    .lhx-builder-topbar {
        padding: 0.75rem 0.9rem;
    }

    .lhx-builder-sidebar,
    .lhx-builder-canvas-wrap {
        padding: 0.85rem;
    }

    .lhx-builder-topbar-right {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .lhx-builder-tabs {
        flex-direction: column;
    }

    .lhx-widget-list-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .lhx-widget-list-item span {
        min-width: 0;
        white-space: normal;
    }

    .lhx-widget-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .lhx-builder-editor-head,
    .lhx-builder-editor-body,
    .lhx-builder-editor-foot {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .lhx-builder-editor-body,
    .lhx-builder-editor-body > .lhx-widget-editor-desc,
    .lhx-builder-editor-body > form {
        grid-template-columns: minmax(0, 1fr);
    }
}

.cms-tree-builder-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--lhx-accent);
    text-decoration: none;
    margin: 0.25rem 0 0.5rem;
    padding-left: 0.1rem;
}

.cms-tree-builder-link:hover {
    color: var(--lhx-accent-strong);
    text-decoration: underline;
}

/* ============================================================
   User Management & Security Groups (rebuilt 2026-08)
   ============================================================ */
.back-link {
    color: var(--lhx-muted);
    text-decoration: none;
    font-weight: 600;
}
.back-link:hover { color: var(--lhx-accent); }

.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid var(--lhx-border-strong);
    background: var(--lhx-bg-soft);
    color: var(--lhx-soft);
    vertical-align: middle;
}
.role-badge.role-admin { background: #eef2ff; border-color: #c7d2fe; color: #1c3bb8; }
.role-badge.role-super_admin { background: #fef3c7; border-color: #fcd34d; color: #92400e; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 8px;
    background: var(--lhx-bg-soft);
    border: 1px solid var(--lhx-border);
    font-size: 0.78rem;
    color: var(--lhx-soft);
    white-space: nowrap;
}

.user-directory-table td { vertical-align: middle; }
.user-directory-table small.muted { font-size: 0.76rem; }

/* Single-user editor layout */
.user-editor-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.group-manager-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); align-items: start; }
@media (max-width: 960px) {
    .user-editor-grid, .group-manager-grid { grid-template-columns: minmax(0, 1fr); }
}

.group-assign-list { display: flex; flex-direction: column; gap: 8px; }
.group-assign {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius-sm);
    background: var(--lhx-panel);
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
}
.group-assign:hover { border-color: var(--lhx-border-strong); }
.group-assign.is-checked { border-color: var(--lhx-accent); background: #f4f7ff; }
.group-assign input { margin-top: 3px; }
.group-assign-body { display: flex; flex-direction: column; gap: 2px; }
.group-assign-name { font-weight: 650; color: var(--lhx-text); }
.group-assign-body small { color: var(--lhx-muted); line-height: 1.35; }

/* Effective (inherited) permissions summary */
.sticky-summary { position: sticky; top: 90px; }
.effective-perms { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.perm-area h4 {
    margin: 0 0 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lhx-muted);
}
.perm-area ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.perm-area li { display: flex; flex-direction: column; gap: 1px; padding-left: 16px; position: relative; }
.perm-area li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.7rem;
    color: var(--lhx-success);
}
.perm-name { font-size: 0.9rem; color: var(--lhx-text); }
.perm-via { font-size: 0.74rem; color: var(--lhx-muted); }

.empty-inline {
    padding: 14px;
    border: 1px dashed var(--lhx-border-strong);
    border-radius: var(--lhx-radius-sm);
    color: var(--lhx-muted);
    background: var(--lhx-bg-soft);
    font-size: 0.9rem;
}
.empty-inline i { margin-right: 6px; }

.inline-hint {
    font-size: 0.82rem;
    color: var(--lhx-muted);
    margin-top: 10px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

/* Save bar */
.user-editor-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 18px;
    padding: 16px 18px;
    background: var(--lhx-panel);
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius);
    box-shadow: var(--lhx-shadow);
    position: sticky;
    bottom: 12px;
    z-index: 5;
}
.btn-lg { padding: 11px 22px; font-size: 1rem; }

/* Danger zone */
.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding: 16px 18px;
    border: 1px solid #f0c8ce;
    background: #fdf3f4;
    border-radius: var(--lhx-radius);
}
.danger-zone strong { display: block; color: var(--lhx-danger); }
.danger-zone small { color: var(--lhx-soft); }

/* Security group manager */
.panel-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.group-list-item { display: flex; flex-direction: column; gap: 3px; }
.group-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.group-tag {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.group-tag-system { background: #eef2ff; color: #1c3bb8; border: 1px solid #c7d2fe; }
.group-tag-custom { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

.perm-area-fieldset { padding: 10px 0; border-top: 1px solid var(--lhx-border); }
.perm-area-fieldset:first-of-type { border-top: 0; }
.perm-area-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lhx-muted);
    margin-bottom: 8px;
    font-weight: 700;
}
.perm-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 6px;
}
.perm-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--lhx-border);
    border-radius: 8px;
    background: var(--lhx-panel);
    cursor: pointer;
    font-size: 0.85rem;
    transition: border-color .12s ease, background .12s ease;
}
.perm-check:hover { border-color: var(--lhx-border-strong); }
.perm-check.is-checked { border-color: var(--lhx-accent); background: #f4f7ff; }
.perm-check.is-locked { cursor: default; opacity: 0.85; }
.perm-check.is-locked:hover { border-color: var(--lhx-border); }
.perm-check input { margin: 0; }

/* ============================================================================
   Deployments hub — content promotion cards (dev -> live)
   ========================================================================== */
.deploy-sites {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.deploy-site-card {
    background: var(--lhx-panel);
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius);
    box-shadow: var(--lhx-shadow);
    padding: 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}
.deploy-site-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}
.deploy-site-card__head h3 { margin: 0; font-size: 1.05rem; color: var(--lhx-text); }
.deploy-site-card__domain { margin: .15rem 0 0; color: var(--lhx-muted); font-size: .85rem; }
.deploy-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .28rem .6rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}
.deploy-pill.is-live { color: var(--lhx-success); background: rgba(15, 157, 88, 0.1); }
.deploy-pill.is-pending { color: var(--lhx-warning); background: rgba(180, 83, 9, 0.1); }
.deploy-site-card__links {
    display: flex;
    gap: 1rem;
    font-size: .85rem;
}
.deploy-site-card__links a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--lhx-accent);
    text-decoration: none;
}
.deploy-site-card__links a:hover { text-decoration: underline; }
.deploy-pending-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--lhx-border);
    display: flex;
    flex-direction: column;
}
.deploy-pending-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--lhx-border);
    font-size: .9rem;
    color: var(--lhx-text);
}
.deploy-pending-list li span { display: inline-flex; align-items: center; gap: .5rem; }
.deploy-pending-list form { margin: 0; }
.deploy-site-card__promote { margin: 0; }
.deploy-site-card__promote .btn { width: 100%; }
.deploy-site-card__ok { margin: 0; color: var(--lhx-success); font-size: .88rem; display: inline-flex; align-items: center; gap: .45rem; }

.deploy-advanced {
    margin-top: 1.25rem;
    background: var(--lhx-panel);
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius);
}
.deploy-advanced > summary {
    cursor: pointer;
    padding: .9rem 1.1rem;
    font-weight: 600;
    color: var(--lhx-text);
    list-style: none;
}
.deploy-advanced > summary::-webkit-details-marker { display: none; }
.deploy-advanced > summary::before { content: "\203A"; display: inline-block; margin-right: .6rem; transition: transform .15s ease; color: var(--lhx-muted); }
.deploy-advanced[open] > summary::before { transform: rotate(90deg); }
.deploy-advanced__body { padding: 0 1.1rem 1.1rem; }

/* ============================================================================
   Deployments hub — LHX platform release panel + live log
   ========================================================================== */
.release-panel {
    margin-top: 1.5rem;
    background: var(--lhx-panel);
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius);
    box-shadow: var(--lhx-shadow);
    padding: 1.25rem 1.35rem;
}
.release-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.release-panel__head h2 { margin: 0 0 .2rem; font-size: 1.15rem; }
.release-panel__head p { margin: 0; }
.release-panel__meta { display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; color: var(--lhx-muted); text-align: right; }
.release-panel__meta strong { color: var(--lhx-text); }
.release-panel__controls {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.release-panel__controls label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; font-weight: 600; color: var(--lhx-muted); }
.release-panel__controls select { min-width: 240px; }
.release-log {
    margin-top: 1rem;
    border: 1px solid var(--lhx-border);
    border-radius: var(--lhx-radius-sm);
    background: var(--lhx-bg-soft);
    overflow: hidden;
}
.release-log__status {
    padding: .6rem .85rem;
    font-weight: 600;
    font-size: .9rem;
    border-bottom: 1px solid var(--lhx-border);
    color: var(--lhx-text);
}
.release-log__status.is-ok { color: var(--lhx-success); }
.release-log__status.is-error { color: var(--lhx-danger); }
.release-log__lines {
    list-style: none;
    margin: 0;
    padding: .5rem .85rem;
    max-height: 260px;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82rem;
    line-height: 1.5;
    color: var(--lhx-soft);
}
.release-log__lines li { padding: .1rem 0; }
.release-log__lines li.is-ok { color: var(--lhx-success); }
.release-log__lines li.is-ok::before { content: "\2713  "; }
.release-log__lines li.is-error { color: var(--lhx-danger); }
.release-log__lines li.is-error::before { content: "\2717  "; }

/* ==========================================================================
   Storefront ecommerce refresh
   ========================================================================== */
.shopfront-body {
    --shop-accent: #f2731d;
    --shop-accent-strong: #d85c0e;
    --shop-ink: #0f1724;
    --shop-muted: #5c6672;
    --shop-line: rgba(20, 40, 70, 0.10);
    --shop-card-bg: #ffffff;
    --shop-radius: 1.15rem;
    --shop-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
    --shop-shadow-hover: 0 28px 60px rgba(15, 23, 42, 0.16);
}

.shop-shell {
    width: min(1220px, calc(100% - 2rem));
}

/* Sticky, cleaner top bar */
.shop-topbar {
    position: sticky;
    top: 0.75rem;
    z-index: 20;
}

.shop-nav a {
    position: relative;
    padding: 0.25rem 0;
    color: var(--shop-muted);
    transition: color 0.15s ease;
}
.shop-nav a:hover { color: var(--shop-ink); }
.shop-nav a::after {
    content: "";
    position: absolute;
    left: 0; bottom: -2px;
    width: 0; height: 2px;
    background: var(--shop-accent);
    transition: width 0.18s ease;
}
.shop-nav a:hover::after { width: 100%; }

/* Hero */
.shop-hero,
.shop-product-layout {
    border-radius: 1.6rem;
}

/* Category strip → pill filters */
.shop-category-strip a {
    min-width: auto;
    grid-auto-flow: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.shop-category-strip a:hover {
    transform: translateY(-2px);
    border-color: rgba(242, 115, 29, 0.5);
    box-shadow: 0 16px 30px rgba(242, 115, 29, 0.12);
}
.shop-category-strip strong { font-size: 0.95rem; }
.shop-category-strip small {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(242, 115, 29, 0.12);
    color: var(--shop-accent-strong);
    font-weight: 700;
    font-size: 0.75rem;
}

/* Grid header */
.shop-grid-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.6rem 0.25rem 0;
}
.shop-result-count {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--shop-ink);
    font-size: 1.05rem;
}
.shop-grid-note {
    color: var(--shop-muted);
    font-size: 0.9rem;
    text-decoration: none;
}
a.shop-grid-note:hover { color: var(--shop-accent-strong); }

/* Product grid */
.shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.35rem;
    margin-top: 1rem;
}

/* Product card */
.shop-card {
    grid-template-rows: auto 1fr;
    border-radius: var(--shop-radius);
    border: 1px solid var(--shop-line);
    background: var(--shop-card-bg);
    box-shadow: var(--shop-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.shop-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shop-shadow-hover);
}

.shop-card-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    min-height: 0;
    overflow: hidden;
}
.shop-card-media img,
.shop-card-media .shop-illustration {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.shop-card:hover .shop-card-media img,
.shop-card:hover .shop-card-media .shop-illustration {
    transform: scale(1.05);
}

.shop-card-badge {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    z-index: 2;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 36, 0.82);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}

.shop-card-copy {
    gap: 0.55rem;
    padding: 1.05rem 1.1rem 1.15rem;
}
.shop-card-cat {
    color: var(--shop-accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    font-size: 0.72rem;
}
.shop-card-copy h2 {
    font-size: 1.12rem;
    line-height: 1.25;
}
.shop-card-copy h2 a {
    color: var(--shop-ink);
    text-decoration: none;
}
.shop-card-copy h2 a:hover { color: var(--shop-accent-strong); }
.shop-card-copy p {
    font-size: 0.9rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop-card-tags {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.1rem;
}
.shop-tag {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(20, 40, 70, 0.06);
    color: var(--shop-muted);
    font-size: 0.74rem;
    font-weight: 600;
}
.shop-swatches {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}
.shop-swatches i {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}
.shop-swatches em {
    font-style: normal;
    font-size: 0.72rem;
    color: var(--shop-muted);
    font-weight: 600;
}

.shop-card-meta {
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--shop-line);
}
.shop-price {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--shop-ink);
}
.shop-price-from {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--shop-muted);
}
.shop-buy-btn,
.shop-card-meta a.shop-buy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1.05rem;
    border-radius: 999px;
    background: var(--shop-accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(242, 115, 29, 0.28);
    transition: background 0.15s ease, transform 0.15s ease;
}
.shop-buy-btn:hover {
    background: var(--shop-accent-strong);
    transform: translateY(-1px);
}

/* Product detail media */
.shop-product-media { gap: 0.85rem; }
.shop-product-image {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    min-height: 0;
    aspect-ratio: 4 / 3;
}
.shop-product-image .shop-illustration,
.shop-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.shop-product-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}
.shop-product-thumb {
    border-radius: 0.8rem;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--shop-line);
    cursor: pointer;
}
.shop-product-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Product detail copy */
.shop-product-pricerow {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}
.shop-product-price { margin: 0; }
.shop-stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(47, 174, 90, 0.12);
    color: #1c7a41;
    font-size: 0.8rem;
    font-weight: 700;
}
.shop-stock-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #2fae5a;
    box-shadow: 0 0 0 4px rgba(47, 174, 90, 0.18);
}

.shop-product-colours { display: grid; gap: 0.5rem; }
.shop-product-colours-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--shop-muted);
}
.shop-product-swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.shop-swatch-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.7rem 0.35rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--shop-line);
    background: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--shop-ink);
}
.shop-swatch-chip i {
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.shop-product-variant-label {
    margin: -0.4rem 0 0;
    font-size: 0.9rem;
    color: var(--shop-muted);
}
.shop-product-variants { display: grid; gap: 0.5rem; margin: 0.2rem 0; }
.shop-product-variant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.6rem;
}
.shop-variant-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem;
    border-radius: 0.9rem;
    border: 2px solid var(--shop-line);
    background: #fff;
    text-decoration: none;
    color: var(--shop-ink);
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.shop-variant-option:hover { border-color: var(--shop-accent); }
.shop-variant-option-active {
    border-color: var(--shop-accent);
    box-shadow: 0 0 0 3px rgba(242, 115, 29, 0.15);
}
.shop-variant-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0.6rem;
    overflow: hidden;
    background: var(--shop-panel, #f5f5f5);
}
.shop-variant-thumb img,
.shop-variant-thumb .shop-illustration { width: 100%; height: 100%; object-fit: cover; }
.shop-variant-name { font-size: 0.76rem; font-weight: 600; line-height: 1.25; }
.shop-variant-price { font-size: 0.76rem; font-weight: 700; color: var(--shop-accent-strong, var(--shop-accent)); }

/* Buy box (request form styled as a purchase panel) */
.shop-request-form {
    border-radius: 1.25rem;
    border: 1px solid var(--shop-line);
    box-shadow: var(--shop-shadow);
}
.shop-request-form .btn-primary {
    background: var(--shop-accent);
    border-color: var(--shop-accent);
    box-shadow: 0 12px 24px rgba(242, 115, 29, 0.28);
}
.shop-request-form .btn-primary:hover {
    background: var(--shop-accent-strong);
    border-color: var(--shop-accent-strong);
}

@media (max-width: 560px) {
    .shop-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.9rem; }
    .shop-card-copy { padding: 0.85rem 0.85rem 0.95rem; }
    .shop-card-copy h2 { font-size: 1rem; }
    .shop-product-thumbs { grid-template-columns: repeat(4, 1fr); }
}

/* ==========================================================================
   Storefront hero redesign — balanced split layout with print visual
   ========================================================================== */
.shopfront-body .shop-hero:not(.shop-hero-compact) {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    align-items: center;
    gap: clamp(1.5rem, 3vw, 3rem);
    padding: clamp(1.6rem, 3.2vw, 3rem);
    overflow: hidden;
    background:
        radial-gradient(120% 140% at 88% -12%, rgba(242, 115, 29, 0.13), transparent 42%),
        radial-gradient(100% 120% at -6% 112%, rgba(29, 116, 245, 0.09), transparent 46%),
        linear-gradient(180deg, #ffffff, #f6f9fc);
    border: 1px solid var(--shop-line);
}

.shop-hero-copy { position: relative; z-index: 2; }

.shopfront-body .shop-hero .shop-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.95rem;
    padding: 0.34rem 0.8rem;
    border-radius: 999px;
    background: rgba(242, 115, 29, 0.12);
    color: var(--shop-accent-strong);
    border: 1px solid rgba(242, 115, 29, 0.22);
}
.shopfront-body .shop-hero .shop-kicker::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--shop-accent);
    box-shadow: 0 0 0 3px rgba(242, 115, 29, 0.2);
}

.shopfront-body .shop-hero h1 {
    margin: 0;
    font-size: clamp(1.9rem, 1.4vw + 1.35rem, 2.95rem);
    line-height: 1.07;
    letter-spacing: -0.015em;
    color: var(--shop-ink);
}

.shop-hero-lede {
    margin: 0.9rem 0 0;
    max-width: 34rem;
    color: var(--shop-muted);
    font-size: 1.02rem;
    line-height: 1.55;
}

.shop-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.45rem;
}
.shop-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.72rem 1.3rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.shop-hero-btn svg { transition: transform 0.15s ease; }
.shop-hero-btn--primary {
    background: var(--shop-accent);
    color: #fff;
    box-shadow: 0 14px 28px rgba(242, 115, 29, 0.30);
}
.shop-hero-btn--primary:hover {
    background: var(--shop-accent-strong);
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(242, 115, 29, 0.36);
}
.shop-hero-btn--primary:hover svg { transform: translateX(3px); }
.shop-hero-btn--ghost {
    background: #fff;
    color: var(--shop-ink);
    border: 1px solid var(--shop-line);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}
.shop-hero-btn--ghost:hover {
    border-color: rgba(242, 115, 29, 0.5);
    color: var(--shop-accent-strong);
    transform: translateY(-2px);
}

.shop-hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.4rem;
    margin: 1.55rem 0 0;
    padding: 0;
    list-style: none;
}
.shop-hero-points li {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--shop-muted);
    font-size: 0.9rem;
    font-weight: 600;
}
.shop-hero-points svg {
    flex: none;
    color: #1c7a41;
    background: rgba(47, 174, 90, 0.14);
    border-radius: 50%;
    padding: 4px;
    box-sizing: content-box;
}

.shop-hero-visual {
    position: relative;
    z-index: 1;
    align-self: stretch;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shop-hero-art {
    width: 100%;
    max-width: 430px;
    height: auto;
    filter: drop-shadow(0 24px 40px rgba(15, 23, 42, 0.13));
}
.shop-hero-tag {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--shop-line);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(6px);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--shop-ink);
    white-space: nowrap;
}
.shop-hero-tag::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--shop-accent);
}
.shop-hero-tag--top { top: 6%; right: 1%; }
.shop-hero-tag--bed { bottom: 9%; left: 0; }
.shop-hero-tag--bed::before { background: #2fae5a; }

.shop-grid-head { scroll-margin-top: 5rem; }

@media (max-width: 900px) {
    .shopfront-body .shop-hero:not(.shop-hero-compact) {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.6rem;
    }
    .shop-hero-copy { order: 1; }
    .shop-hero-visual {
        order: 2;
        min-height: 0;
        width: 100%;
        max-width: 460px;
        margin: 0 auto;
    }
    .shop-hero-lede { max-width: none; }
}
@media (max-width: 520px) {
    .shop-hero-tag { display: none; }
    .shop-hero-actions .shop-hero-btn { flex: 1 1 auto; justify-content: center; }
}

/* ==========================================================================
   Storefront retail header + search + category tiles + hero product showcase
   ========================================================================== */

/* Full-width retail header (replaces the floating pill topbar) */
.shopfront-body .shop-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--shop-line);
}
.shop-header-inner {
    width: min(1220px, calc(100% - 2rem));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0.7rem 0;
}
.shopfront-body .shop-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex: none;
    text-decoration: none;
}
.shop-brand-mark { width: 2rem; height: 2rem; display: inline-flex; }
.shop-brand-mark svg { width: 100%; height: 100%; display: block; }
.shop-brand-text {
    font-family: 'Orbitron', 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 0.16em;
    color: var(--shop-ink);
}

.shop-search {
    flex: 1 1 auto;
    max-width: 520px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.15rem 0.15rem 0.15rem 0.9rem;
    background: #fff;
    border: 1px solid var(--shop-line);
    border-radius: 999px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.shop-search:focus-within {
    border-color: rgba(242, 115, 29, 0.55);
    box-shadow: 0 0 0 3px rgba(242, 115, 29, 0.12);
}
.shop-search-ico { color: var(--shop-muted); flex: none; }
.shop-search input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 0.95rem;
    color: var(--shop-ink);
    padding: 0.5rem 0;
}
.shop-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.shop-search button {
    flex: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    background: var(--shop-accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    transition: background 0.15s ease;
}
.shop-search button:hover { background: var(--shop-accent-strong); }

.shopfront-body .shop-header .shop-nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex: none;
    margin-left: auto;
}
.shopfront-body .shop-header .shop-nav a {
    color: var(--shop-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: color 0.15s ease;
}
.shopfront-body .shop-header .shop-nav a:hover,
.shopfront-body .shop-header .shop-nav a.is-active { color: var(--shop-ink); }
.shopfront-body .shop-header .shop-nav a.shop-nav-cta {
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    background: rgba(242, 115, 29, 0.12);
    color: var(--shop-accent-strong);
    border: 1px solid rgba(242, 115, 29, 0.25);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.shopfront-body .shop-header .shop-nav a.shop-nav-cta:hover {
    background: var(--shop-accent);
    color: #fff;
    border-color: var(--shop-accent);
}
.shop-header-toggle { display: none; }

@media (max-width: 760px) {
    .shop-header-inner { flex-wrap: wrap; gap: 0.7rem; }
    .shop-brand { order: 1; }
    .shop-header-toggle {
        order: 2;
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--shop-ink);
        cursor: pointer;
        padding: 0.3rem;
    }
    .shop-search { order: 3; flex: 1 1 100%; max-width: none; }
    .shopfront-body .shop-header .shop-nav {
        order: 4;
        flex: 1 1 100%;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
        display: none;
        padding-top: 0.5rem;
        margin-top: 0.2rem;
        border-top: 1px solid var(--shop-line);
    }
    .shopfront-body .shop-header.is-open .shop-nav { display: flex; }
    .shopfront-body .shop-header .shop-nav a { padding: 0.6rem 0.25rem; }
    .shopfront-body .shop-header .shop-nav a.shop-nav-cta { text-align: center; margin-top: 0.3rem; }
}

/* Hero product showcase (replaces the abstract printer illustration) */
.shop-hero-gallery {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.12fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0.85rem;
    aspect-ratio: 1 / 0.92;
}
.shop-hero-shot {
    margin: 0;
    border-radius: 1.15rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 22%, rgba(255, 138, 43, 0.16), transparent 60%),
        linear-gradient(150deg, #eef3f9, #dae5f0);
    border: 1px solid var(--shop-line);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.shop-hero-shot:hover { transform: translateY(-3px); }
.shop-hero-shot img { width: 100%; height: 100%; object-fit: contain; padding: 9%; }
.shop-hero-shot--a { grid-row: 1 / span 2; }

/* "Shop by category" tiles (replaces the pill filter strip) */
.shop-cats { margin-top: 1.9rem; }
.shop-cats-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0 0.25rem 1rem;
}
.shop-cats-head h2 { margin: 0; font-size: 1.3rem; color: var(--shop-ink); }
.shop-cats-all { color: var(--shop-accent-strong); font-weight: 700; font-size: 0.9rem; text-decoration: none; }
.shop-cats-all:hover { text-decoration: underline; }
.shop-cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 0.85rem;
}
.shop-cat-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 1rem;
    background: var(--shop-card-bg);
    border: 1px solid var(--shop-line);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.shop-cat-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
    border-color: hsl(var(--cat-hue, 220), 70%, 72%);
}
.shop-cat-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 0.8rem;
    background: hsl(var(--cat-hue, 220), 70%, 94%);
    color: hsl(var(--cat-hue, 220), 46%, 40%);
}
.shop-cat-name { font-weight: 700; color: var(--shop-ink); font-size: 0.98rem; }
.shop-cat-count { color: var(--shop-muted); font-size: 0.82rem; font-weight: 600; }

/* Search results view */
.shop-search-results { margin-top: 1.5rem; }
.shop-search-summary {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.3rem;
}
.shop-search-summary h1 { margin: 0.2rem 0 0; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--shop-ink); }
.shop-search-clear { color: var(--shop-accent-strong); font-weight: 700; text-decoration: none; white-space: nowrap; }
.shop-search-clear:hover { text-decoration: underline; }
.shop-search-results .shop-grid { margin-top: 0; }

/* =====================================================================
   Manufacturing surface refinement — scoped design pass (2026-08-31).
   Targets only the manufacturing pages (dashboard, order & booking
   control, print queue, inventory, products), which all carry a
   .manufacturing-header, via :has() so the rest of the app is untouched.
   Goal: clearer hierarchy and a more considered, less "templated" feel,
   plus first-class styling for the new printer-dispatch controls.
   ===================================================================== */
main:has(.manufacturing-header) {
    --mfg-accent: #d9662a;
    --mfg-accent-strong: #b8501d;
    --mfg-accent-soft: rgba(217, 102, 42, 0.12);
}

/* Header: editorial hierarchy, constrained line length, quieter blurb */
main:has(.manufacturing-header) .workspace-header {
    padding: 1.85rem 2rem;
}
main:has(.manufacturing-header) .workspace-header .eyebrow {
    color: var(--mfg-accent-strong);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}
main:has(.manufacturing-header) .workspace-header h1 {
    font-size: clamp(1.65rem, 2.4vw, 2.15rem);
    letter-spacing: -0.02em;
    line-height: 1.08;
}
main:has(.manufacturing-header) .workspace-header p:not(.eyebrow) {
    max-width: 64ch;
    color: var(--lhx-soft);
    line-height: 1.55;
}

/* Metric cards: stronger number, quieter label, thin channel accent */
main:has(.manufacturing-header) .metric-card {
    position: relative;
    overflow: hidden;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
main:has(.manufacturing-header) .metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--mfg-accent), transparent);
    opacity: 0.85;
}
main:has(.manufacturing-header) .metric-card:hover {
    border-color: var(--lhx-border-strong);
    transform: translateY(-1px);
}
main:has(.manufacturing-header) .metric-label {
    font-size: 0.7rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--lhx-muted);
    font-weight: 600;
}
main:has(.manufacturing-header) .metric-value {
    font-size: clamp(1.8rem, 2.6vw, 2.15rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin: 0.15rem 0 0.2rem;
}
main:has(.manufacturing-header) .metric-note {
    color: var(--lhx-muted);
    font-size: 0.82rem;
}

/* Panel + form cards: crisper edge, refined heading rhythm */
main:has(.manufacturing-header) .panel-card,
main:has(.manufacturing-header) .table-card,
main:has(.manufacturing-header) .form-panel {
    border: 1px solid var(--lhx-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
main:has(.manufacturing-header) .panel-card > h3,
main:has(.manufacturing-header) .form-panel > h3 {
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    margin-bottom: 0.9rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--lhx-border);
}

/* Print-queue job cards */
main:has(.manufacturing-header) .manufacturing-job-head h3 {
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}
main:has(.manufacturing-header) .manufacturing-job-meta {
    gap: 0.4rem 0.5rem;
    margin-top: 0.75rem;
}
main:has(.manufacturing-header) .manufacturing-job-meta span {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--lhx-bg-soft);
    border: 1px solid var(--lhx-border);
    color: var(--lhx-soft);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* ---- Printer dispatch controls (new) ---- */
.dispatch-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    margin-top: 1rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--lhx-radius-sm, 10px);
    background: var(--lhx-bg-soft);
    border: 1px solid var(--lhx-border);
    font-size: 0.86rem;
}
.dispatch-row .dispatch-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--lhx-muted);
}
.dispatch-row .dispatch-state {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--lhx-soft);
}
.dispatch-row .dispatch-state::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lhx-border-strong);
}
.dispatch-row .dispatch-file {
    color: var(--lhx-muted);
    font-size: 0.8rem;
}
.dispatch-row.is-dispatching {
    background: rgba(41, 82, 227, 0.07);
    border-color: rgba(41, 82, 227, 0.28);
}
.dispatch-row.is-dispatching .dispatch-state { color: var(--lhx-accent-strong); }
.dispatch-row.is-dispatching .dispatch-state::before {
    background: var(--lhx-accent);
    animation: dispatchPulse 1.3s ease-in-out infinite;
}
.dispatch-row.is-good {
    background: rgba(15, 157, 88, 0.08);
    border-color: rgba(15, 157, 88, 0.3);
}
.dispatch-row.is-good .dispatch-state { color: #0b7a45; }
.dispatch-row.is-good .dispatch-state::before { background: var(--lhx-success); }
.dispatch-row.is-warn {
    background: rgba(192, 41, 58, 0.07);
    border-color: rgba(192, 41, 58, 0.28);
}
.dispatch-row.is-warn .dispatch-state { color: var(--lhx-danger); }
.dispatch-row.is-warn .dispatch-state::before { background: var(--lhx-danger); }
@keyframes dispatchPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.7); }
}
.dispatch-note {
    margin: 0.5rem 0 0;
    padding: 0.55rem 0.75rem;
    border-left: 3px solid var(--lhx-danger);
    background: rgba(192, 41, 58, 0.05);
    border-radius: 0 8px 8px 0;
    color: var(--lhx-danger);
    font-size: 0.85rem;
}
.job-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    align-items: flex-start;
}
.job-actions .toolbar-form {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.job-actions .toolbar-form:last-child:not(:only-child) {
    margin-left: auto;
}

/* Mobile fit: keep grid/flex layouts inside the viewport.
   Grid tracks default to min-content minimums, so one wide child (a table,
   a nowrap row) used to stretch the whole page past the screen edge. */
@media (max-width: 991px) {
    .dashboard-main {
        grid-template-columns: minmax(0, 1fr);
    }

    .main > * {
        min-width: 0;
        max-width: 100%;
    }

    .shop-card {
        grid-template-columns: minmax(0, 1fr);
        min-width: 0;
    }

    .shop-card-copy,
    .shop-card-media {
        min-width: 0;
    }

    .shop-card-copy {
        grid-template-columns: minmax(0, 1fr);
    }

    .shop-card-copy h2,
    .shop-card-copy p,
    .shop-card-copy small {
        overflow-wrap: anywhere;
    }

    .shop-card-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .shop-card-meta .shop-buy-btn {
        flex: 1 1 auto;
        justify-content: center;
        min-width: 0;
    }
}

/* Deployments: "How publishing works" guide */
.deploy-howto { margin: 0; padding-left: 1.25rem; display: grid; gap: .5rem; line-height: 1.5; }
.deploy-howto__local { margin: 1rem 0 0; padding: .75rem 1rem; border-radius: 10px; background: rgba(245, 158, 11, .12); color: inherit; }
.deploy-howto__local i { color: #d97706; margin-right: .35rem; }
