/* =========================================================
   ROOT VARIABLES (HubSpot-like design system)
   ========================================================= */

:root {
    --hs-bg: #f5f8fa;
    --hs-surface: #ffffff;
    --hs-border: #dfe3eb;
    --hs-border-soft: #e6ecf1;
    --hs-text: #2e3f50;
    --hs-muted: #7c98b6;
    --hs-link: #007a8c;
    --hs-primary: #ff7a59;
    --hs-primary-hover: #e86546;
    --hs-danger: #dc2626;
    --hs-danger-hover: #b91c1c;
    --hs-btn-bg: #eaf0f6;
    --radius: 4px;
    --font: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* =========================================================
   PAGE
   ========================================================= */
.hs-page {
    min-height: 100%;
    background: var(--hs-bg);
    padding: 16px 24px;
    box-sizing: border-box;
    font-family: var(--font);
    color: var(--hs-text);
}

.hs-page:has(> .hs-table-wrap) {
    display: flex;
    flex-direction: column;
}

/* =========================================================
   TITLE BAR
   ========================================================= */

.hs-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.hs-title h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.hs-count {
    font-size: 13px;
    color: var(--hs-muted);
    margin-top: 2px;
}

.hs-actions {
    display: flex;
    gap: 8px;
}

/* =========================================================
   GENERIC BUTTONS (PAGE LEVEL)
   ========================================================= */

.hs-btn {
    height: 32px;
    padding: 0 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--hs-border);
    background: var(--hs-btn-bg);
    color: var(--hs-text);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

    .hs-btn:hover {
        background: #dde6ee;
    }

/* Primary action */
.hs-btn-primary {
    background: var(--hs-primary);
    border-color: var(--hs-primary);
    color: #fff;
}

    .hs-btn-primary:hover {
        background: var(--hs-primary-hover);
        border-color: var(--hs-primary-hover);
    }

/* Danger action */
.hs-btn-danger {
    background: var(--hs-danger);
    border-color: var(--hs-danger);
    color: #fff;
}

    .hs-btn-danger:hover {
        background: var(--hs-danger-hover);
        border-color: var(--hs-danger-hover);
    }

/* Ghost / secondary */
.hs-btn-ghost {
    background: transparent;
    border: 1px solid var(--hs-border);
}

/* =========================================================
   SEARCH
   ========================================================= */

.hs-searchbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
    border-radius: var(--radius);
    padding: 8px;
    margin: 12px 0;
    max-width:260px;
}

    .hs-searchbar input {
        border: none;
        outline: none;
        font-size: 13px;
        width: 260px;
        background: transparent;
    }

/* =========================================================
   FILTERS
   ========================================================= */

.hs-filters {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin: 10px 0 14px;
}

.hs-filter label {
    font-size: 12px;
    color: var(--hs-muted);
    margin-bottom: 4px;
    display: block;
}

.hs-filters select {
    height: 34px;
    padding: 0 10px;
    border-radius: var(--radius);
    border: 1px solid var(--hs-border);
    background: #fff;
    font-size: 13px;
}

/* =========================================================
   TABLE
   ========================================================= */

.hs-table-wrap {
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
}

.hs-page:has(> .hs-table-wrap) > .hs-table-wrap {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 420px;
}

.hs-page:has(> .hs-table-wrap) > .hs-table-wrap > .admin-users-table-scroll,
.hs-page:has(> .hs-table-wrap) > .hs-table-wrap > .manage-users-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    background: var(--hs-surface);
}

.hs-list-page {
    --hs-list-bg: #f4f5f7;
    --hs-list-surface: #ffffff;
    --hs-list-surface-alt: #f8f9fa;
    --hs-list-text: #0f1923;
    --hs-list-subtle: #4a5568;
    --hs-list-border: #e2e8f0;
    height: calc(100vh - var(--navbar-height, 50px));
    min-height: 0;
    max-height: calc(100vh - var(--navbar-height, 50px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 28px 10px;
    background: var(--hs-list-bg);
    color: var(--hs-list-text);
    box-sizing: border-box;
}

.hs-list-titlebar {
    flex-shrink: 0;
    align-items: flex-start;
}

.hs-list-titlebar .hs-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--hs-list-text);
}

.hs-list-actions {
    align-items: center;
}

.hs-list-actions .hs-btn {
    height: 42px;
    padding: 0 16px;
    border-radius: 8px;
}

.hs-list-filter-panel {
    flex-shrink: 0;
    background: var(--hs-list-surface);
    border: 1px solid var(--hs-list-border);
    border-radius: 14px;
    overflow: hidden;
}

.hs-list-filter-toggle {
    width: 100%;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 18px;
    color: var(--hs-list-subtle);
    border: 0;
    border-bottom: 1px solid var(--hs-list-border);
    background: var(--hs-list-surface);
    font-size: 13px;
    cursor: pointer;
}

.hs-list-filters {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 16px 18px 18px;
    flex-wrap: wrap;
}

.admin-companies-page .admin-users-titlebar {
    align-items: center;
    gap: 12px;
}

.admin-users-filter-panel {
    flex-shrink: 0;
    background: var(--hs-list-surface, #ffffff);
    border: 1px solid var(--hs-list-border, #e2e8f0);
    border-radius: 14px;
    overflow: hidden;
}

.admin-filter-toggle {
    width: 100%;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 18px;
    color: var(--hs-list-subtle, #4a5568);
    border: 0;
    border-bottom: 1px solid var(--hs-list-border, #e2e8f0);
    background: var(--hs-list-surface, #ffffff);
    font-size: 13px;
    cursor: pointer;
}

.admin-users-filters {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 16px 18px 18px;
    flex-wrap: wrap;
}

.admin-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
    flex: 0 1 190px;
}

.admin-filter-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--hs-list-subtle, #4a5568);
}

.admin-filter-field input,
.admin-filter-field select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--hs-list-border, #e2e8f0);
    background: var(--hs-list-surface, #ffffff);
    color: var(--hs-list-text, #0f1923);
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.admin-filter-field input:focus,
.admin-filter-field select:focus {
    border-color: var(--admin-brand, #2596be);
    box-shadow: 0 0 0 3px rgba(37, 150, 190, 0.14);
}

.admin-filter-search {
    flex: 1 1 260px;
    min-width: 220px;
}

.admin-filter-page-size {
    flex: 0 0 110px;
    min-width: 110px;
}

.admin-clear-btn {
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
}

/* Drawer tabs */
.co-tab {
    flex: 1;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-subtle, #4a5568);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .12s, border-color .12s;
}

.co-tab:hover { color: var(--admin-text, #0f1923); }

.co-tab-active {
    color: var(--admin-brand, #2596be);
    border-bottom-color: var(--admin-brand, #2596be);
}

/* Table cells inside drawer */
.co-th {
    padding: .5rem .75rem;
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    color: var(--admin-subtle, #4a5568);
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--admin-border, #e2e8f0);
}

.co-td {
    padding: .6rem .75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

/* Seat cards */
.co-seat-card {
    background: #f8fafc;
    border: 1px solid var(--admin-border, #e2e8f0);
    border-radius: 8px;
    padding: .75rem 1rem;
    min-width: 160px;
}

.co-seat-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--admin-subtle, #4a5568);
    margin-bottom: .35rem;
}

.co-seat-bar-wrap {
    background: #e2e8f0;
    border-radius: 99px;
    height: 5px;
    margin: .3rem 0;
}

.co-seat-bar {
    background: var(--admin-brand, #2596be);
    border-radius: 99px;
    height: 5px;
    transition: width .3s;
}

.co-seat-count {
    font-size: .8rem;
    font-weight: 600;
}

.admin-drawer-overlay {
    justify-content: flex-end;
    align-items: stretch;
    padding: 0;
    background: rgba(15, 25, 35, 0.22);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    top: var(--navbar-height, 50px);
}

.admin-user-drawer {
    width: min(50vw, 760px);
    max-width: none;
    height: calc(100vh - var(--navbar-height, 50px));
    max-height: calc(100vh - var(--navbar-height, 50px));
    border-radius: 0;
    box-shadow: -18px 0 48px rgba(15, 25, 35, 0.18);
    animation: adminDrawerIn 0.22s ease-out;
}

.admin-user-drawer-small {
    width: min(42vw, 560px);
}

.admin-user-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 640px) {
    .admin-user-form-row {
        grid-template-columns: 1fr;
    }
}

@keyframes adminDrawerIn {
    from {
        transform: translateX(28px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.hs-list-filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 116px;
}

.hs-list-filter-field--search {
    width: 260px;
}

.hs-list-filter-field label {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hs-list-subtle);
}

.hs-list-filter-field input,
.hs-list-filter-field select {
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--hs-list-border);
    padding: 0 14px;
    background: var(--hs-list-surface-alt);
    color: var(--hs-list-text);
    font-size: 13px;
    outline: none;
}

.hs-list-filter-field input:focus,
.hs-list-filter-field select:focus {
    border-color: var(--hs-link);
    box-shadow: 0 0 0 3px rgba(0, 122, 140, 0.12);
}

.hs-list-filter-panel .hs-searchbar {
    margin: 0;
    max-width: none;
    padding: 0;
    border: 0;
    background: transparent;
}

.hs-list-filter-panel .hs-searchbar input {
    width: 100%;
}

.hs-list-clear-btn {
    height: 40px;
    border-radius: 10px;
}

.hs-list-table-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    background: var(--hs-list-surface);
    border: 1px solid var(--hs-list-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 34px rgba(15, 25, 35, 0.04);
}

.hs-page.hs-list-page > .hs-table-wrap.hs-list-table-shell {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

.hs-list-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: var(--hs-list-surface);
}

.hs-list-table-shell .hs-table th {
    background: #f8fafc;
    color: var(--hs-list-subtle);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 12px 14px;
    border-bottom: 1px solid var(--hs-list-border);
}

.hs-list-table-shell .hs-table td {
    padding: 14px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

.hs-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.hs-icon-action {
    position: relative;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--hs-list-border);
    background: var(--hs-list-surface);
    color: var(--hs-list-text);
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease, color .15s ease;
}

.hs-icon-action:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: 0 8px 18px rgba(15, 25, 35, 0.10);
}

.hs-icon-action i {
    font-size: 13px;
}

.hs-icon-action-primary {
    background: #f2fbfb;
    color: var(--hs-link);
    border-color: rgba(0, 122, 140, 0.18);
}

.hs-icon-action-primary:hover {
    background: #e6f7f8;
    border-color: rgba(0, 122, 140, 0.30);
}

.hs-icon-action-danger {
    background: #fff5f5;
    color: #c53030;
    border-color: rgba(197, 48, 48, 0.18);
}

.hs-icon-action-danger:hover {
    background: #ffecec;
    border-color: rgba(197, 48, 48, 0.30);
}

.hs-icon-action__label {
    position: absolute;
    right: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(50%) translateY(4px);
    padding: 6px 9px;
    border-radius: 8px;
    background: #0f172a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.24);
}

.hs-icon-action__label::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%);
    border-width: 5px;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
}

.hs-icon-action:hover .hs-icon-action__label,
.hs-icon-action:focus-visible .hs-icon-action__label {
    opacity: 1;
    transform: translateX(50%) translateY(0);
}

.hs-list-table-shell .hs-table tr:hover {
    background: #fbfdff;
}

.hs-list-table-shell .hs-empty,
.hs-list-table-shell .hs-loading {
    padding: 18px 20px;
}

.hs-list-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-top: 1px solid var(--hs-list-border);
    background: #fbfcfd;
    color: var(--hs-list-subtle);
    font-size: 13px;
}

.hs-list-page-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 900px) {
    .hs-list-page {
        padding: 16px 16px 10px;
    }

    .hs-list-titlebar {
        gap: 12px;
        flex-direction: column;
    }

    .hs-list-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .hs-list-filter-field--search {
        width: 100%;
    }

    .hs-list-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .hs-list-page-controls {
        justify-content: space-between;
    }

    .hs-row-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}

.hs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .hs-table th {
        background: #f9fbfd;
        font-size: 11px;
        text-transform: uppercase;
        color: var(--hs-muted);
        font-weight: 600;
        padding: 10px;
        border-bottom: 1px solid var(--hs-border);
    }

    .hs-table td {
        padding: 10px;
        border-bottom: 1px solid var(--hs-border-soft);
    }

    .hs-table tr:hover {
        background: #f9fbfd;
    }

.hs-link {
    color: var(--hs-link);
    font-weight: 500;
    cursor: pointer;
}

/* =========================================================
   STATUS PILLS
   ========================================================= */

.hs-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 104px;
    border: 1px solid transparent;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 999px;
    font-weight: 500;
}

.hs-pill-active {
    background: #dcfce7;
    color: #166534;
}

.hs-pill-inactive {
    background: #e5e7eb;
    color: #374151;
}

/* =========================================================
   BANNERS / FEEDBACK
   ========================================================= */

.hs-banner {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--hs-border);
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hs-banner-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.hs-banner-x {
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
}

/* =========================================================
   MODALS
   ========================================================= */

.hs-modal-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hs-modal-success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================================================
   MODAL FOOTER BUTTONS (FIXED & WORKING)
   ========================================================= */

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--hs-border);
}

    .modal-footer button {
        height: 36px;
        padding: 0 16px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
    }

    /* Modal primary */
    .modal-footer .btn-primary {
        background: var(--hs-primary);
        border: 1px solid var(--hs-primary);
        color: #fff;
    }

        .modal-footer .btn-primary:hover {
            background: var(--hs-primary-hover);
            border-color: var(--hs-primary-hover);
        }

    /* Modal secondary */
    .modal-footer .btn-secondary {
        background: #fff;
        border: 1px solid var(--hs-border);
        color: var(--hs-text);
    }

        .modal-footer .btn-secondary:hover {
            background: #f9fafb;
        }

    /* Modal danger */
    .modal-footer .btn-danger {
        background: var(--hs-danger);
        border: 1px solid var(--hs-danger);
        color: #fff;
    }

        .modal-footer .btn-danger:hover {
            background: var(--hs-danger-hover);
            border-color: var(--hs-danger-hover);
        }

    /* Disabled */
    .modal-footer button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    /* Focus ring */
    .modal-footer button:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(255, 122, 89, 0.35);
    }
    /* =========================================================
   MODAL – FORCE HS BUTTON STYLES (FIX INVISIBLE DELETE)
   ========================================================= */

    .modal-footer .hs-btn {
        background: var(--hs-btn-bg);
        border: 1px solid var(--hs-border);
        color: var(--hs-text);
    }

    .modal-footer .hs-btn-primary {
        background: var(--hs-primary);
        border-color: var(--hs-primary);
        color: #fff;
    }

        .modal-footer .hs-btn-primary:hover {
            background: var(--hs-primary-hover);
            border-color: var(--hs-primary-hover);
        }

    .modal-footer .hs-btn-danger {
        background: var(--hs-danger);
        border-color: var(--hs-danger);
        color: #fff;
    }

        .modal-footer .hs-btn-danger:hover {
            background: var(--hs-danger-hover);
            border-color: var(--hs-danger-hover);
        }

    .modal-footer .hs-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }
/* =========================================================
   HUBSPOT – MANAGEMENT VIEW (FOR mgmt-page)
   ========================================================= */

.mgmt-page {
    background: var(--hs-bg);
    font-family: var(--font);
    color: var(--hs-text);
    padding: 20px 24px;
}

/* =========================================================
   HEADER
   ========================================================= */

.mgmt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

    .mgmt-header h1 {
        font-size: 20px;
        font-weight: 600;
        margin: 0;
    }

    .mgmt-header p {
        font-size: 13px;
        color: var(--hs-muted);
        margin: 4px 0 0;
    }

.mgmt-header-actions {
    display: flex;
    gap: 8px;
}

.mgmt-primary {
    height: 32px;
    padding: 0 12px;
    border-radius: 4px;
    border: none;
    background: var(--hs-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

    .mgmt-primary:hover {
        background: var(--hs-primary-hover);
    }

/* =========================================================
   VIEW SWITCH (Clients / Agents / Affiliates)
   ========================================================= */

.mgmt-views {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--hs-border);
    margin-bottom: 16px;
}

.mgmt-view {
    background: none;
    border: none;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--hs-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

    .mgmt-view.active {
        color: var(--hs-text);
        font-weight: 600;
        border-bottom-color: var(--hs-primary);
    }

/* =========================================================
   STATS BAR
   ========================================================= */

.mgmt-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

    .mgmt-stats .stat {
        background: var(--hs-surface);
        border: 1px solid var(--hs-border);
        border-radius: 6px;
        padding: 10px 14px;
        min-width: 140px;
    }

        .mgmt-stats .stat strong {
            font-size: 18px;
            font-weight: 600;
            display: block;
        }

        .mgmt-stats .stat span {
            font-size: 12px;
            color: var(--hs-muted);
        }

/* =========================================================
   CONTENT
   ========================================================= */

.mgmt-content {
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
    border-radius: 6px;
}

/* =========================================================
   GRID (LIST VIEW, NOT CARDS)
   ========================================================= */

.mgmt-grid {
    display: flex;
    flex-direction: column;
}

/* =========================================================
   ROW / CARD (HubSpot-style list row)
   ========================================================= */

.mgmt-card {
    display: grid;
    grid-template-columns: 40px 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--hs-border-soft);
}

    .mgmt-card:last-child {
        border-bottom: none;
    }

    .mgmt-card:hover {
        background: #f9fbfd;
    }

    /* =========================================================
   AVATAR
   ========================================================= */

    .mgmt-card .avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #eaf0f6;
        color: var(--hs-text);
        font-size: 12px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* =========================================================
   INFO
   ========================================================= */

    .mgmt-card .info h3 {
        font-size: 13px;
        font-weight: 600;
        margin: 0;
    }

    .mgmt-card .info span {
        display: block;
        font-size: 12px;
        color: var(--hs-muted);
        line-height: 1.4;
    }

    /* =========================================================
   STATUS
   ========================================================= */

    .mgmt-card .status {
        font-size: 11px;
        padding: 3px 8px;
        border-radius: 999px;
        font-weight: 500;
    }

        .mgmt-card .status.on {
            background: #dcfce7;
            color: #166534;
        }

        .mgmt-card .status.off {
            background: #e5e7eb;
            color: #374151;
        }

    /* =========================================================
   ACTIONS
   ========================================================= */

    .mgmt-card .actions {
        display: flex;
        gap: 8px;
    }

        .mgmt-card .actions button {
            height: 28px;
            padding: 0 10px;
            font-size: 12px;
            border-radius: 4px;
            border: 1px solid var(--hs-border);
            background: #fff;
            cursor: pointer;
            color: var(--hs-text);
        }

            .mgmt-card .actions button:hover {
                background: #f9fafb;
            }

        .mgmt-card .actions .danger {
            color: var(--hs-danger);
            border-color: #fecaca;
        }

            .mgmt-card .actions .danger:hover {
                background: #fee2e2;
            }

/* =========================================================
   HS SURFACE (GENERIC CONTAINER)
   ========================================================= */

.hs-surface {
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.hs-surface-header {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    background: #f9fbfd;
    border-bottom: 1px solid var(--hs-border);
}

.hs-surface-body {
    padding: 12px;
}

/* =========================================================
   GRID
   ========================================================= */

.hs-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.hs-span-2 {
    grid-column: span 2;
}

/* =========================================================
   FIELD
   ========================================================= */

.hs-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .hs-field label {
        font-size: 12px;
        color: var(--hs-muted);
    }

    .hs-field input,
    .hs-field select {
        height: 34px;
        padding: 0 10px;
        font-size: 13px;
        border-radius: var(--radius);
        border: 1px solid var(--hs-border);
        background: #fff;
    }

        .hs-field input:focus,
        .hs-field select:focus {
            outline: none;
            border-color: var(--hs-primary);
            box-shadow: 0 0 0 2px rgba(255, 122, 89, 0.15);
        }

/* Helper text */
.hs-helper {
    font-size: 12px;
    color: var(--hs-muted);
}

/* Inline buttons */
.hs-inline {
    display: flex;
    gap: 6px;
}

/* Align bottom actions */
.hs-align-end {
    justify-content: flex-end;
}
/* =========================================================
   LAYOUT
   ========================================================= */

.hs-layout {
    display: flex;
    gap: 16px;
}

/* =========================================================
   PANELS
   ========================================================= */

.hs-panel {
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
}

.hs-panel-left {
    width: 280px;
    flex-shrink: 0;
}

.hs-panel-main {
    flex: 1;
}

/* =========================================================
   PANEL HEADER
   ========================================================= */

.hs-panel-header {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    background: #f9fbfd;
    border-bottom: 1px solid var(--hs-border);
}

.hs-panel-header-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* =========================================================
   PANEL BODY
   ========================================================= */

.hs-panel-body {
    padding: 12px;
}

/* =========================================================
   LIST (LEFT RAIL)
   ========================================================= */

.hs-list-item {
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
}

    .hs-list-item:hover {
        background: #f5f8fa;
    }

    .hs-list-item.active {
        background: #eaf0f6;
        border-left: 3px solid var(--hs-primary);
    }

.hs-list-title {
    font-size: 13px;
    font-weight: 500;
}

.hs-list-sub {
    font-size: 12px;
    color: var(--hs-muted);
}

/* =========================================================
   INPUTS
   ========================================================= */

.hs-input-readonly {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    border-radius: var(--radius);
    border: 1px solid var(--hs-border);
    background: #f9fafb;
    color: var(--hs-text);
}

/* =========================================================
   EMPTY / MUTED
   ========================================================= */

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

.hs-empty {
    padding: 24px;
    color: var(--hs-muted);
    font-size: 14px;
}

.hs-banner-error {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.hs-pill-warn {
    background: #fef3c7;
    color: #92400e;
}
.cg-body {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.cg-graph {
    flex: 1;
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
    border-radius: 6px;
    overflow: hidden;
}

.cg-svg {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 620px;
}

.cg-panel {
    width: 360px;
    flex-shrink: 0;
}

.cg-topbar {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.cg-kpi .cg-k {
    font-weight: 700;
    font-size: 16px;
}

.cg-kpi .cg-v {
    font-size: 12px;
    color: var(--hs-muted);
}

.cg-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.cg-edge {
    fill: none;
    stroke: #cbd5e1;
    stroke-width: 2;
}

.cg-node {
    cursor: pointer;
}

.cg-node-bg {
    fill: #fff;
    stroke: var(--hs-border);
    filter: drop-shadow(0 8px 10px rgba(0,0,0,.06));
}

.cg-node-title {
    font-size: 13px;
    font-weight: 700;
    fill: var(--hs-text);
}

.cg-node-sub {
    font-size: 12px;
    fill: var(--hs-muted);
}

.cg-node-flag {
    font-size: 10px;
    font-weight: 800;
    fill: #b91c1c;
}

.cg-node.active .cg-node-bg {
    stroke: var(--hs-primary);
    stroke-width: 2.2;
}

.cg-node.blocked .cg-node-bg {
    stroke: #ef4444;
}
.hs-pill-warn {
    background: #fef3c7;
    color: #92400e;
}

.hs-banner-error {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}


/* ── Bulk selection bar (list pages) ─────────────────────── */
.hs-bulk-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
    padding: 10px 14px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    border-radius: 10px;
}

.hs-bulk-bar__count {
    font-size: .85rem;
    font-weight: 700;
    color: #3730a3;
    margin-right: auto;
}

.hs-table tbody tr.hs-row-selected {
    background: #eef2ff;
}
