/* =========================
   Wheelhouse - site.css
   ========================= */

/* Page shell */
html,
body {
    height: 100%;
}

body {
    background: radial-gradient(circle at top center, rgba(93, 173, 226, 0.08) 0%, rgba(93, 173, 226, 0.025) 20%, rgba(240, 248, 255, 0) 46%), linear-gradient(180deg, #F4FAFE 0%, #EEF6FC 100%);
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    color: #1C1C1C;
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

/* App shell */
.app-shell {
    flex: 1 0 auto;
    padding: 1.5rem 0 2.25rem;
}

@media (min-width: 992px) {
    .navbar-robotic .container,
    .tenant-session-banner .container,
    .app-shell > .container {
        width: 90vw;
        max-width: none;
    }

    .dashboard-page,
    .workspace-inner {
        max-width: none;
    }
}

.app-page-shell {
    width: 100%;
}

.tenant-page-shell {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.tenant-page-shell.tenant-page-narrow {
    max-width: 1240px;
}

.tenant-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tenant-page-header-copy {
    min-width: 0;
}

.tenant-page-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.tenant-page-subtitle {
    margin-top: 0.35rem;
    color: #5E6C79;
    font-size: 0.95rem;
}

.tenant-page-section-title {
    margin-bottom: 0.85rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.tenant-page-card {
    border-radius: 1rem;
}

.tenant-page-card .card-body {
    padding: 1.25rem;
}

.schedule-billing-builder-column,
.schedule-billing-builder-card,
.schedule-billing-builder-card .card-body,
.schedule-billing-builder-card form,
.schedule-billing-builder-card fieldset {
    min-width: 0;
}

.schedule-billing-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.schedule-billing-table {
    min-width: 68rem;
}

.schedule-billing-actions {
    max-width: 100%;
}

.schedule-billing-package-state {
    padding: 0.85rem 1rem;
    border: 1px solid #9CCDF0;
    border-left: 0.3rem solid #1976D2;
    border-radius: 0.75rem;
    background: #F2F9FE;
    color: #24445E;
}

.schedule-draw-header {
    width: min(100%, 42rem);
}

.schedule-draw-selector {
    width: 100%;
    padding: 0.9rem 1rem 1rem;
    border: 1px solid #9CCDF0;
    border-left: 0.3rem solid #1976D2;
    border-radius: 0.75rem;
    background: #F2F9FE;
}

.schedule-draw-selector .form-select {
    border-color: #78B8E5;
    background-color: #FFFFFF;
    font-weight: 600;
}

.schedule-draw-selector .form-select:focus {
    border-color: #1976D2;
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.16);
}

@media (max-width: 575.98px) {
    .schedule-billing-actions {
        width: 100%;
    }

    .schedule-billing-actions .btn {
        flex: 1 1 100%;
    }
}

.tenant-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.tenant-page-actions.tenant-page-actions-end {
    justify-content: flex-end;
}

.tenant-required {
    color: #c94848;
    font-weight: 700;
}

.tenant-required-note,
.workspace-required-note {
    margin-bottom: 0.9rem;
    color: #5E6C79;
    font-size: 0.88rem;
}

.tenant-validation-summary,
.workspace-validation-summary {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(201, 72, 72, 0.22);
    border-radius: 0.85rem;
    background: #fff6f6;
    color: #8b2f2f;
    font-size: 0.92rem;
}

.tenant-validation-summary:empty,
.workspace-validation-summary:empty {
    display: none;
}

.tenant-validation-summary ul,
.workspace-validation-summary ul {
    margin-bottom: 0;
    padding-left: 1.1rem;
}

.field-validation-error {
    display: block;
    margin-top: 0.35rem;
    color: #c94848;
    font-size: 0.875rem;
}

.input-validation-error,
.form-control.input-validation-error,
.form-select.input-validation-error,
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #c94848;
}

.input-validation-error:focus,
.form-control.input-validation-error:focus,
.form-select.input-validation-error:focus,
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #c94848;
    box-shadow: 0 0 0 0.2rem rgba(201, 72, 72, 0.14);
}

@media (max-width: 767.98px) {
    .tenant-page-shell {
        padding: 0 0.75rem;
    }

    .tenant-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Safe-area & comfy page padding */
.page-safe {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* =========================
   Navbar
   ========================= */
.navbar-robotic {
    background: linear-gradient(180deg, #5DADE2 0%, #57A6DB 100%);
    color: #FFFFFF;
    border-bottom: 1px solid rgba(192, 223, 240, 0.7);
    box-shadow: 0 6px 18px rgba(17, 63, 96, 0.14);
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.tenant-top-chrome {
    position: sticky;
    top: 0;
    z-index: 1030;
}

    .navbar-robotic .nav-link,
    .navbar-robotic .navbar-brand {
        color: #FFFFFF;
        font-weight: 600;
    }

    .navbar-robotic .nav-link {
        border-radius: 0.5rem;
        padding: 0.5rem 0.8rem;
        transition: color 0.2s ease, background-color 0.2s ease;
    }

        .navbar-robotic .nav-link:hover,
        .navbar-robotic .nav-link:focus {
            color: #FFFFFF;
            background-color: rgba(255,255,255,0.12);
            text-decoration: none;
        }

/* Navbar brand stack */
.navbar-brand-wheelhouse {
    display: inline-flex;
    align-items: center;
    line-height: 1.1;
    text-decoration: none;
    min-width: 0;
    padding: 0.15rem 0;
}

    .navbar-brand-wheelhouse:hover {
        text-decoration: none;
    }

.navbar-brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

    .navbar-brand-text .platform-name {
        display: block;
        margin: 0;
        font-size: 1.25rem;
        font-weight: 700;
        line-height: 1.05;
        color: #FFFFFF;
    }

    .navbar-brand-text .company-name {
        display: block;
        margin-top: 0.1rem;
        max-width: 220px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1.3;
        padding-bottom: 0.08em;
        color: #66F2C8;
        opacity: 0.92;
    }

/* Navbar toggler */
.navbar-robotic .navbar-toggler {
    border: 1px solid rgba(22, 78, 122, 0.4);
    border-radius: 0.75rem;
    padding: 0.5rem 0.7rem;
    box-shadow: none;
}

    .navbar-robotic .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(255,255,255,0.25);
    }

.navbar-robotic .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2828, 48, 65, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Navbar utility text/badges */
.navbar-welcome {
    color: #FFFFFF;
    font-size: 0.9rem;
    margin-right: 0.75rem;
}

.navbar-count-badge {
    margin-left: 0.4rem;
    vertical-align: middle;
}

.navbar-mobile-count-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.35rem;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    border: 2px solid #5DADE2;
}

.navbar-link-with-badges {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.navbar-badge-cluster {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.tenant-ops-return-link {
    border-radius: 999px;
    border-color: rgba(255, 255, 255, 0.7);
    color: #FFFFFF;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.06) 100%);
    box-shadow: 0 6px 16px rgba(16, 54, 86, 0.18);
}

.tenant-ops-return-link:hover,
.tenant-ops-return-link:focus {
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.10) 100%);
    text-decoration: none;
}

.tenant-session-banner {
    background: linear-gradient(90deg, #0f5f7a 0%, #147da0 100%);
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255,255,255,0.18);
}

.tenant-session-banner-inactive {
    background: linear-gradient(90deg, #51606f 0%, #6c7b88 100%);
    border-bottom-color: rgba(255,255,255,0.14);
}

.tenant-session-banner-conflict {
    background: linear-gradient(90deg, #6a3848 0%, #8b5163 100%);
    border-bottom-color: rgba(255,255,255,0.14);
}

.tenant-session-banner-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.tenant-session-banner-copy {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
}

.tenant-session-banner-tenant {
    font-weight: 700;
}

.tenant-session-banner-meta {
    color: rgba(255,255,255,0.92);
    font-size: 0.95rem;
}

.tenant-session-banner-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.tenant-session-banner-action {
    margin: 0;
}

.tenant-session-banner-action.btn,
.tenant-session-banner-action .btn {
    border-color: rgba(255,255,255,0.7);
    color: #fff;
}

.tenant-session-banner-action.btn:hover,
.tenant-session-banner-action.btn:focus,
.tenant-session-banner-action .btn:hover,
.tenant-session-banner-action .btn:focus {
    background-color: rgba(255,255,255,0.12);
    color: #fff;
}

.session-prompt-modal {
    border-radius: 1rem;
    border: 1px solid #d1e7f7;
}

.session-prompt-modal .modal-header,
.session-prompt-modal .modal-body,
.session-prompt-modal .modal-footer {
    text-align: left;
}

.session-prompt-modal .modal-body dl dt {
    color: #5E6C79;
}

.upgrade-prompt-description {
    white-space: pre-line;
}

/* =========================
   Buttons
   ========================= */
.btn-robotic {
    background-color: #5DADE2;
    color: #FFFFFF;
    border: 1px solid #4A90C1;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
}

    .btn-robotic:hover {
        background-color: #48A9E6;
        border-color: #3E89C2;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        color: #FFFFFF;
    }

.btn-dashboard {
    background-color: #48C9B0;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    transition: background-color 0.2s;
}

    .btn-dashboard:hover {
        background-color: #1ABC9C;
    }

/* Drag handle button */
.btn-handle {
    background-color: #FFFFFF;
    color: #21618C;
    border: 1px solid #D1E7F7;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow .2s, transform .2s, background-color .2s;
}

    .btn-handle:hover {
        background-color: #F8FBFF;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }

/* Drag handle */
.drag-handle {
    cursor: grab;
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    user-select: none;
}

    .drag-handle:hover {
        background: rgba(0,0,0,0.05);
    }

    .drag-handle:active {
        cursor: grabbing;
    }

/* =========================
   Cards
   ========================= */
.card {
    border-radius: 0.85rem;
    border: 1px solid #D1E7F7;
    background-color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* =========================
   Dashboard
   ========================= */
.dashboard-page {
    max-width: 1040px;
    margin: 0 auto;
}

.dashboard-hero {
    margin-bottom: 1.1rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(176, 214, 235, 0.9) !important;
    background: #FFFFFF;
    box-shadow: 0 14px 34px rgba(31, 41, 55, 0.08), 0 1px 0 rgba(255,255,255,0.92) inset;
    position: relative;
    overflow: hidden;
}

    .dashboard-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: radial-gradient(700px 260px at 76% 52%, rgba(93, 173, 226, 0.10) 0%, rgba(93, 173, 226, 0.045) 16%, rgba(93, 173, 226, 0.00) 38%), radial-gradient(420px 220px at 82% 46%, rgba(102, 242, 200, 0.10) 0%, rgba(102, 242, 200, 0.035) 18%, rgba(102, 242, 200, 0.00) 40%);
        z-index: 0;
    }

    .dashboard-hero::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 44%;
        right: 0;
        pointer-events: none;
        background: radial-gradient(420px 210px at 0% 50%, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.82) 24%, rgba(255,255,255,0.00) 56%);
        z-index: 0;
    }

    .dashboard-hero .card-body {
        position: relative;
        z-index: 1;
        padding: 1.15rem 1.7rem;
    }

.dashboard-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 124px;
}

.dashboard-hero-left {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
    position: relative;
}

    .dashboard-hero-left::before {
        content: "";
        position: absolute;
        top: -1.15rem;
        bottom: -1.15rem;
        left: -1.7rem;
        width: clamp(420px, 44vw, 560px);
        background: linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 78%, rgba(255,255,255,0) 100%);
        pointer-events: none;
        z-index: 0;
    }

.dashboard-hero-logo {
    position: relative;
    z-index: 1;
    width: clamp(220px, 24vw, 290px);
    height: auto;
    max-width: none;
    display: block;
}

.dashboard-hero-right {
    flex: 0 0 auto;
    min-width: 0;
    text-align: right;
    padding-left: 1rem;
    position: relative;
    z-index: 1;
}

.dashboard-hero-label {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(28, 28, 28, 0.52);
    margin-bottom: 0.35rem;
}

.dashboard-hero-company {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    padding-bottom: 0.08em;
    color: #66F2C8;
    opacity: 0.92;
    letter-spacing: 0;
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    margin-bottom: 1.2rem;
}

.dashboard-header-main {
    min-width: 0;
}

.dashboard-title {
    font-size: clamp(2rem, 2vw, 2.35rem);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: #1C1C1C;
}

.dashboard-subtitle {
    margin-top: 0.35rem;
    color: #5E6C79;
    font-size: 0.98rem;
    line-height: 1.4;
    max-width: 36rem;
}

.dashboard-header-actions {
    flex: 0 0 auto;
    padding-top: 0.15rem;
}

.dashboard-manage-btn {
    min-height: 38px;
    border-radius: 0.55rem;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
}

.dashboard-sections {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.dashboard-section {
    margin: 0;
}

.dashboard-section-title {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: rgba(28, 28, 28, 0.62);
    margin-bottom: 0.7rem;
}

.dashboard-grid {
    margin-top: 0 !important;
}

.dashboard-card {
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(251,253,255,1) 100%);
    color: #1C1C1C;
    border: 1px solid rgba(176, 214, 235, 0.88);
    box-shadow: 0 4px 14px rgba(31, 41, 55, 0.05), 0 1px 0 rgba(255,255,255,0.9) inset;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
}

    .dashboard-card .card-body {
        padding: 1.15rem 1rem 1.08rem;
    }

    .dashboard-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 30px rgba(31, 41, 55, 0.10), 0 1px 0 rgba(255,255,255,0.9) inset;
        border-color: rgba(93, 173, 226, 0.72);
    }

.dashboard-card-title {
    font-size: 1.02rem;
    line-height: 1.3;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.dashboard-card-description {
    color: #5F6670;
    line-height: 1.52;
}

.dashboard-card-metrics {
    border-top: 1px solid #E5E9EF;
    padding-top: 0.5rem;
}

.dashboard-card-metric {
    color: #3F4954;
    font-size: 0.9rem;
    line-height: 1.35;
}

.dashboard-card-actions .btn {
    font-weight: 600;
}

.dashboard-card-financial-brain {
    border: 1px solid rgba(17, 111, 164, 0.34) !important;
    background: linear-gradient(180deg, #f7fcff 0%, #f2f9ff 100%);
    box-shadow: 0 12px 28px rgba(17, 111, 164, 0.14), 0 1px 0 rgba(255,255,255,0.95) inset;
}

.dashboard-card-link {
    color: #175C8C;
    text-decoration: none;
}

    .dashboard-card-link:hover {
        text-decoration: none;
        color: #124B71;
    }

.dashboard-card:focus-within {
    border-color: rgba(72, 169, 230, 0.85);
    box-shadow: 0 0 0 0.22rem rgba(93, 173, 226, 0.18), 0 10px 22px rgba(31, 41, 55, 0.08);
}

.dashboard-card-link:focus-visible {
    outline: none;
    text-decoration: underline;
}

.dashboard-risk-hero {
    margin-bottom: 1.35rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(183, 208, 225, 0.92) !important;
    background: linear-gradient(180deg, #ffffff 0%, #f9fcfe 100%);
    color: #1f2d3a;
    box-shadow: 0 8px 22px rgba(25, 45, 70, 0.06);
    overflow: hidden;
    position: relative;
}

    .dashboard-risk-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(800px 180px at 100% 0%, rgba(15, 92, 153, 0.05) 0%, rgba(15, 92, 153, 0.01) 35%, rgba(15, 92, 153, 0) 60%);
        pointer-events: none;
    }

    .dashboard-risk-hero .card-body {
        position: relative;
        z-index: 1;
        padding: 1.15rem 1.2rem 1rem;
    }

.dashboard-risk-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.dashboard-risk-hero-kicker {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #5d768a;
    margin-bottom: 0.3rem;
}

.dashboard-risk-hero-title {
    font-size: clamp(1.35rem, 1.5vw, 1.7rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: #1f2d3a;
}

.dashboard-risk-hero-link {
    color: #1f2d3a;
    text-decoration: none;
}

    .dashboard-risk-hero-link:hover,
    .dashboard-risk-hero-link:focus {
        color: #1f2d3a;
        text-decoration: none;
    }

.dashboard-risk-hero-purpose {
    color: #667788;
    font-size: 0.92rem;
    line-height: 1.4;
    max-width: 36rem;
}

.dashboard-risk-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.dashboard-risk-hero-btn {
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    font-weight: 700;
}

.dashboard-risk-hero-btn-primary {
    background: #0f5c99;
    color: #ffffff;
    border: 1px solid #0f5c99;
}

.dashboard-risk-hero-btn-secondary {
    background: #ffffff;
    color: #0f5c99;
    border: 1px solid #b7cddd;
}

    .dashboard-risk-hero-btn:hover,
    .dashboard-risk-hero-btn:focus {
        text-decoration: none;
    }

    .dashboard-risk-hero-btn-primary:hover,
    .dashboard-risk-hero-btn-primary:focus {
        color: #ffffff;
        background: #0c4f85;
        border-color: #0c4f85;
    }

    .dashboard-risk-hero-btn-secondary:hover,
    .dashboard-risk-hero-btn-secondary:focus {
        color: #0f5c99;
        background-color: #f7fbff;
        border-color: #a7bfd1;
        text-decoration: none;
    }

.dashboard-risk-hero-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}

.dashboard-risk-hero-kpi {
    min-width: 0;
    padding: 0.8rem 0.9rem;
    border-radius: 0.95rem;
    background: #edf6fd;
    border: 1px solid #d9e8f3;
}

    .dashboard-risk-hero-kpi.positive {
        background: #eef9f1;
        border-color: #cfe8d7;
    }

    .dashboard-risk-hero-kpi.negative {
        background: #fdf1f1;
        border-color: #f1d2d2;
    }

.dashboard-risk-hero-kpi-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5d768a;
    margin-bottom: 0.35rem;
}

.dashboard-risk-hero-kpi-value {
    font-size: clamp(1.1rem, 1.35vw, 1.3rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #1f2d3a;
}

.dashboard-risk-hero-kpi-subtle {
    margin-top: 0.22rem;
    font-size: 0.8rem;
    color: #667788;
}

.dashboard-risk-hero-value-negative {
    color: #c94848;
}

.dashboard-risk-hero-value-positive {
    color: #2e8b57;
}

.dashboard-risk-hero-lower {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 0.85rem;
}

.dashboard-risk-hero-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    color: #334554;
    font-size: 0.98rem;
}

.dashboard-risk-hero-count {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
}

.dashboard-risk-hero-count-number {
    font-weight: 800;
}

.dashboard-risk-hero-count-number-green {
    color: #2e8b57;
}

.dashboard-risk-hero-count-number-yellow {
    color: #b57900;
}

.dashboard-risk-hero-count-number-red {
    color: #c94848;
}

.dashboard-risk-hero-count-number-gray {
    color: #6f7f8d;
}

.dashboard-risk-hero-inline-link {
    font-size: 0.85rem;
    color: #0f5c99;
    font-weight: 700;
    text-decoration: none;
}

    .dashboard-risk-hero-inline-link:hover,
    .dashboard-risk-hero-inline-link:focus {
        color: #0f5c99;
        text-decoration: underline;
    }

.risk-board-shell {
    border-radius: 1.25rem;
    border: 1px solid rgba(176, 214, 235, 0.9);
    background:
        radial-gradient(900px 260px at 100% 0%, rgba(93, 173, 226, 0.08) 0%, rgba(93, 173, 226, 0.02) 35%, rgba(93, 173, 226, 0) 60%),
        linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.risk-board-kicker {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(28, 28, 28, 0.52);
    margin-bottom: 0.35rem;
}

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

.risk-kpi-card {
    padding: 1rem 1rem 1.05rem;
    border-radius: 1rem;
    border: 1px solid rgba(176, 214, 235, 0.82);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    box-shadow: 0 6px 18px rgba(24, 68, 99, 0.05);
}

.risk-kpi-card-positive {
    background: #eef9f1;
    border-color: #cfe8d7;
}

.risk-kpi-card-negative {
    background: #fdf1f1;
    border-color: #f1d2d2;
}

.risk-kpi-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: rgba(28, 28, 28, 0.52);
    margin-bottom: 0.45rem;
}

.risk-kpi-value {
    font-size: clamp(1.35rem, 1.7vw, 1.85rem);
    line-height: 1.04;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #13212b;
}

.risk-kpi-subtle {
    margin-top: 0.28rem;
    font-size: 0.9rem;
    color: #5F6670;
}

.risk-kpi-value-negative {
    color: #b64646;
}

.risk-kpi-value-positive {
    color: #16724c;
}

.risk-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #334554;
    font-size: 1rem;
}

.risk-status-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
}

.risk-status-number {
    font-weight: 800;
}

.risk-status-number-green {
    color: #2e8b57;
}

.risk-status-number-yellow {
    color: #b57900;
}

.risk-status-number-red {
    color: #c94848;
}

.risk-status-number-gray {
    color: #6f7f8d;
}

.risk-items-card {
    border-radius: 1.1rem;
}

.risk-badge-unknown {
    background: #eef2f5;
    color: #697887;
}

.risk-row-container {
    background: linear-gradient(180deg, #fbfdff 0%, #f4f9fd 100%);
}

    .risk-row-container td {
        border-top-color: #d7e7f2;
    }

.risk-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.22rem;
}

.risk-row-entity-label {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: #e9f3fb;
    color: #1f5d88;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.risk-row-scope {
    color: #617182;
    font-size: 0.84rem;
    font-weight: 700;
}

@media (max-width: 1199.98px) {
    .dashboard-risk-hero-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-risk-hero-lower {
        flex-direction: column;
        align-items: flex-start;
    }

    .risk-kpi-band {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 767.98px) {
    .dashboard-risk-hero .card-body {
        padding: 1rem 0.95rem;
    }

    .dashboard-risk-hero-top {
        flex-direction: column;
    }

    .dashboard-risk-hero-actions {
        justify-content: flex-start;
    }

    .dashboard-risk-hero-kpis {
        grid-template-columns: 1fr;
    }

    .risk-kpi-band {
        grid-template-columns: 1fr;
    }

}

/* =========================
   Footer
   ========================= */
.footer-robotic {
    flex-shrink: 0;
    background: linear-gradient(180deg, #ECF8F5 0%, #E5F3F0 100%);
    padding: 1rem 0;
    border-top: 1px solid #C0E4E0;
    color: #1C1C1C;
    font-size: 0.9rem;
    text-align: center;
}

/* =========================
   Forms / Inputs
   ========================= */
input.form-control {
    border-radius: 0.3rem;
    border: 1px solid #B0D6EB;
    background-color: #FFFFFF;
}

/* Read-only inputs */
input[readonly],
textarea[readonly],
select[readonly] {
    background-color: #E9ECEF;
    color: #495057;
    cursor: not-allowed;
    border: 1px solid #B0BFC7;
}

    input[readonly]:focus,
    textarea[readonly]:focus,
    select[readonly]:focus {
        box-shadow: none;
        outline: none;
    }

/* Class-based read-only */
.readonly-field {
    background-color: #E9ECEF;
    color: #495057;
    cursor: not-allowed;
    border: 1px solid #B0BFC7;
}

/* =========================
   Typography / Links / Alerts
   ========================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #1C1C1C;
}

a {
    color: #5DADE2;
    text-decoration: none;
}

    a:hover {
        color: #48A9E6;
        text-decoration: underline;
    }

.alert-success {
    background-color: #48C9B0;
    color: #FFFFFF;
}

.alert-warning {
    background-color: #F5B041;
    color: #FFFFFF;
}

/* =========================
   Login / Auth branding
   ========================= */
.auth-page-shell {
    min-height: calc(100vh - 8rem);
    min-height: calc(100svh - 8rem);
    display: flex;
    align-items: center;
}

.auth-page-shell .row {
    width: 100%;
}

.auth-card {
    border: 0;
    border-radius: 1rem;
    overflow: hidden;
}

.login-card .card-header {
    background-color: #5DADE2;
    color: #FFFFFF;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    font-weight: 600;
    text-align: center;
}

.login-brand-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.login-brand-title {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: #FFFFFF;
}

.login-brand-tenant {
    margin-top: 0.2rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    padding-bottom: 0.08em;
    color: #66F2C8;
}

.auth-support-copy {
    color: #5f6b7a;
    font-size: 0.95rem;
}

.auth-card .card-footer {
    background: #f8fbff;
    border-top: 1px solid rgba(93, 173, 226, 0.12);
}

/* =========================
   Utility
   ========================= */
.min-w-0 {
    min-width: 0;
}

/* =========================
   My Work
   ========================= */
.mywork-page .card-body {
    overflow-wrap: anywhere;
}

.mywork-page {
    position: relative;
}

.mywork-page::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    background:
        radial-gradient(circle at top left, rgba(93, 173, 226, 0.10), transparent 32rem),
        radial-gradient(circle at top right, rgba(25, 135, 84, 0.08), transparent 24rem),
        linear-gradient(180deg, rgba(248, 251, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
    pointer-events: none;
}

.mywork-shell-card {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(93, 173, 226, 0.14);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(6px);
}

.mywork-page .tenant-page-header {
    gap: 1rem;
    align-items: flex-start;
}

.mywork-page .tenant-page-title {
    font-size: clamp(1.7rem, 2vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.mywork-page .tenant-page-subtitle {
    max-width: 44rem;
    color: #5F6B7A;
}

.mywork-page-actions {
    display: grid;
    gap: 0.5rem;
    width: 100%;
}

.mywork-utility-action {
    min-height: 48px;
    border: 1px solid #9db4c7;
    border-radius: 1rem;
    background: linear-gradient(180deg, #f8fbfe 0%, #edf5fb 100%);
    color: #476277;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 18px rgba(80, 128, 170, 0.08);
}

.mywork-utility-action:hover,
.mywork-utility-action:focus {
    color: #31516b;
    border-color: #7da5c6;
    background: linear-gradient(180deg, #f2f8fd 0%, #e3eff9 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 8px 20px rgba(80, 128, 170, 0.12);
}

.mywork-search-row {
    display: grid;
    gap: 0.5rem;
}

.mywork-search-row .form-control {
    min-height: 48px;
    border-color: #C9DDF0;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.mywork-search-row .btn {
    min-height: 48px;
}

.mywork-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.mywork-section-heading-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #35516B;
    min-width: 0;
}

.mywork-section-heading-label::before {
    content: "";
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #5DADE2 0%, #2C7FB8 100%);
    box-shadow: 0 0 0 0.2rem rgba(93, 173, 226, 0.14);
}

.mywork-section-heading-count {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 1.85rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(93, 173, 226, 0.12);
    color: #245577;
    font-size: 0.8rem;
    font-weight: 700;
}

.mywork-card {
    border: 1px solid rgba(93, 173, 226, 0.12);
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

    .mywork-card:hover {
        border-color: rgba(93, 173, 226, 0.2);
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.09);
        transform: translateY(-1px);
    }

.mywork-card-active {
    border-color: rgba(25, 135, 84, 0.35);
    box-shadow:
        0 0 0 .18rem rgba(25, 135, 84, 0.12),
        0 16px 34px rgba(25, 135, 84, 0.12);
}

.mywork-card-topline {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mywork-card-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.mywork-card-badges .badge,
.workspace-header-badges .badge {
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.mywork-card-title {
    font-size: 1rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.mywork-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .35rem .9rem;
}

.mywork-meta-grid > div {
    padding: 0.35rem 0.55rem;
    border-radius: 0.7rem;
    background: rgba(93, 173, 226, 0.06);
}

.mywork-actions {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    width: 100%;
}

.mywork-actions .btn {
    min-height: 42px;
    font-weight: 700;
    border-radius: 0.85rem;
}

.mywork-card-ready {
    border-color: rgba(25, 135, 84, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 255, 250, 0.98) 100%);
}

/* My Work collapse chevron */
.collapse-chevron {
    display: inline-block;
    transition: transform .2s ease;
}

button[aria-expanded="true"] .collapse-chevron {
    transform: rotate(90deg);
}

/* =========================
   Workspace
   ========================= */
.workspace-shell {
    position: relative;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(93, 173, 226, 0.12), transparent 24rem),
        radial-gradient(circle at bottom right, rgba(25, 135, 84, 0.07), transparent 18rem),
        linear-gradient(180deg, #F8FBFF 0%, #FDFEFF 100%);
    overflow: visible;
    isolation: isolate;
}

.workspace-inner {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

.workspace-header {
    padding: 1rem 1rem 0.85rem;
    border: 1px solid rgba(93, 173, 226, 0.12);
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.workspace-header-topline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.workspace-header-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.workspace-header-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.workspace-grid {
    display: grid;
    gap: 1rem;
}

.workspace-card {
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(93, 173, 226, 0.12);
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.workspace-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.workspace-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0;
}

.workspace-card-title {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.workspace-card-copy {
    margin-bottom: 0;
    color: #6C757D;
    font-size: 0.875rem;
}

.workspace-card-meta {
    margin-bottom: 0;
    color: #6C757D;
    font-size: 0.875rem;
}

.workspace-inline-feedback {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.workspace-card-action {
    margin-top: auto;
}

.workspace-card-list {
    display: grid;
    gap: 0.65rem;
}

.workspace-card-list-item {
    border: 1px solid #D9E6F2;
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%);
}

.workspace-card-emphasis {
    border-left: 4px solid rgba(93, 173, 226, 0.55);
}

.workspace-card-emphasis .card-body {
    background:
        linear-gradient(180deg, rgba(247, 251, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.workspace-overlay {
    position: fixed;
    inset: 0;
    z-index: 1065;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
}

    .workspace-overlay.d-none {
        display: none !important;
    }

.workspace-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 0;
}

.workspace-overlay-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100%;
    background: linear-gradient(180deg, #F8FBFF 0%, #FFFFFF 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workspace-overlay-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    z-index: 2;
    flex: 0 0 auto;
}

.mywork-overlay-header {
    min-height: 4.25rem;
    padding: 1rem;
}

.mywork-overlay-title {
    display: block;
    max-width: calc(100vw - 5rem);
    margin: 0;
    overflow: hidden;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-overlay-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin: 0;
    background: transparent;
    overscroll-behavior: contain;
}

.workspace-overlay-form {
    max-width: 860px;
    padding: 1.15rem 1.15rem 1rem;
    border: 1px solid rgba(93, 173, 226, 0.12);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
}

.workspace-overlay-section-title {
    margin-bottom: 0.35rem;
    font-size: 1rem;
    font-weight: 700;
}

.workspace-overlay-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.workspace-overlay-open .workspace-inner {
    pointer-events: none;
    user-select: none;
}

.workspace-overlay-open .workspace-overlay,
.workspace-overlay-open .workspace-overlay * {
    pointer-events: auto;
}

.workspace-modal-overlay-open {
    overflow: hidden;
}

.workspace-overlay-open-global {
    overflow: hidden;
}

/* Participants overlay */
.assignee-row {
    border: 1px solid #D9E6F2;
    border-radius: 0.75rem;
    padding: 0.9rem;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%);
}

.assignee-actions {
    min-width: 170px;
}

@media (min-width: 576px) {
    .mywork-search-row {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: stretch;
    }

    .mywork-search-row.has-clear {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

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

@media (min-width: 768px) {
    .mywork-page-actions {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        width: auto;
    }

    .mywork-page .tenant-page-header {
        margin-bottom: 1.5rem;
    }

    .workspace-header-topline {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .workspace-header-title {
        font-size: 1.25rem;
    }
}

@media (min-width: 992px) {
    .mywork-card-topline {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
    }

    .mywork-actions {
        min-width: 180px;
        width: auto;
    }
}

@media (max-width: 575.98px) {
    .mywork-shell-card {
        border-radius: 1rem;
    }

    .mywork-page .card-body {
        padding: 0.7rem !important;
    }

    .mywork-page .tenant-page-header {
        gap: 0.5rem;
        margin-bottom: 0.65rem !important;
    }

    .mywork-page .tenant-page-title {
        font-size: 1.25rem;
    }

    .mywork-page .tenant-page-subtitle {
        display: none;
    }

    .mywork-card .card-body {
        padding: 0.7rem !important;
    }

    .mywork-card-topline {
        gap: 0.25rem;
        margin-bottom: 0 !important;
    }

    .mywork-card-badges {
        gap: 0.25rem;
    }

    .mywork-card-badges .badge,
    .workspace-header-badges .badge {
        padding: 0.25rem 0.45rem;
        font-size: 0.68rem;
    }

    .mywork-card-title {
        font-size: 0.94rem;
        line-height: 1.18;
    }

    .mywork-card-layout {
        gap: 0.55rem !important;
    }

    .mywork-card .text-muted.small,
    .mywork-card .small {
        font-size: 0.78rem;
        line-height: 1.2;
    }

    .mywork-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.25rem;
        margin-top: 0.35rem !important;
    }

    .mywork-meta-grid > div {
        padding: 0.22rem 0.35rem;
    }

    .mywork-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .mywork-actions .btn {
        min-height: 38px;
        padding: 0.35rem 0.55rem;
        font-size: 0.84rem;
        border-radius: 0.75rem;
    }

    .mywork-actions .btn:only-child {
        grid-column: 1 / -1;
    }

    .mywork-section-heading {
        margin-bottom: 0.45rem !important;
    }

    .mywork-section-heading-label {
        font-size: 0.8rem;
        gap: 0.35rem;
    }

    .mywork-section-heading-label::before {
        width: 0.55rem;
        height: 0.55rem;
    }

    .mywork-section-heading-count {
        min-width: 1.5rem;
        padding: 0.1rem 0.4rem;
        font-size: 0.74rem;
    }

    .mywork-page-actions {
        gap: 0.35rem;
    }

    .mywork-page-actions .btn,
    .mywork-search-row .btn,
    .mywork-search-row .form-control {
        min-height: 40px;
    }

    .mywork-search-row {
        gap: 0.35rem;
    }

    .mywork-search-row .form-control {
        font-size: 0.92rem;
    }

    .workspace-overlay-actions {
        flex-direction: column-reverse;
    }

    .workspace-overlay-actions .btn {
        width: 100%;
    }

    .assignee-actions {
        min-width: 0;
        width: 100%;
    }

    .workspace-overlay-form {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .mywork-overlay-header {
        min-height: 3.6rem;
        padding: 0.55rem 0.8rem;
    }

    .mywork-overlay-header .mywork-overlay-close {
        width: 2em;
        height: 2em;
        padding: 0.5em;
        margin: -0.5em -0.5em -0.5em auto;
        background-size: 2em 2em;
        flex: 0 0 auto;
    }

    .mywork-overlay-title {
        font-size: 1rem;
    }

    .mywork-page .tenant-page-title {
        display: none;
    }
}

/* =========================
   Service Orders
   ========================= */
.so-revenue-card {
    border-radius: 1rem;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%);
    border: 1px solid rgba(13, 110, 253, 0.10);
    box-shadow: 0 8px 24px rgba(93, 173, 226, 0.08);
}

    .so-revenue-card h3,
    .so-revenue-card h5 {
        font-weight: 700;
    }

    .so-revenue-card .input-group-text {
        font-weight: 700;
        background-color: #F8FBFF;
        border-color: #B0D6EB;
    }

    .so-revenue-card .form-control {
        font-size: 1.25rem;
        font-weight: 600;
        min-height: 58px;
    }

.service-order-edit-form .so-revenue-card .form-control {
    font-size: 1.15rem;
    font-weight: 600;
}

/* Wizard layout */
.service-order-wizard .so-step {
    min-height: 100%;
}

/* Small missing-revenue badge used in list/table */
.so-revenue-missing-badge {
    color: #1C1C1C !important;
    font-weight: 600;
}

/* Compact inline warning used on details summary */
.so-inline-warning {
    background-color: #FFF4DB;
    border: 1px solid #F3D18B;
    color: #5C4400;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

    .so-inline-warning .small {
        line-height: 1.25;
    }

    .so-inline-warning .btn {
        white-space: nowrap;
    }

/* Optional compact stats feel in summary/header */
.so-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* =========================
   Payroll Draft
   ========================= */

.payroll-draft-page {
    min-height: 0;
}

.payroll-draft-shell {
    min-height: 0;
}

.payroll-sticky-panel {
    min-height: 0;
    z-index: 1;
}

.payroll-work-card {
    min-height: 0;
}

.payroll-queue-card,
.payroll-detail-card,
.payroll-detail-panel-wrap,
.payroll-detail-panel-host,
.payroll-detail-card-body {
    position: relative;
    z-index: 0;
    min-height: 0;
}

    .payroll-queue-card .card-body {
        min-height: 0;
    }

.payroll-draft-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.payroll-summary-strip {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid #D1E7F7;
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.payroll-summary-strip-label {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #4F5F6D;
}

.payroll-summary-strip-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.8rem;
    align-items: center;
}

.payroll-summary-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    white-space: nowrap;
}

.payroll-summary-item-label {
    font-size: 0.82rem;
    color: #5E6C79;
}

.payroll-summary-item-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1C1C1C;
}

.payroll-summary-item-strong .payroll-summary-item-value {
    font-size: 1rem;
}

.payroll-summary-item-message {
    white-space: normal;
    margin-left: 1rem;
}

    .payroll-summary-item-message .payroll-summary-item-value {
        font-size: 0.83rem;
        font-weight: 700;
        color: #2F3B46;
    }

.payroll-summary-strip.payroll-summary-card-review-danger {
    background: linear-gradient(180deg, #FFF6F6 0%, #FDEBEC 100%);
    border-color: rgba(220, 53, 69, 0.28);
}

.payroll-summary-strip.payroll-summary-card-review-warning {
    background: linear-gradient(180deg, #FFF9EF 0%, #FFF2D9 100%);
    border-color: rgba(245, 176, 65, 0.4);
}

.payroll-summary-strip.payroll-summary-card-review-success {
    background: linear-gradient(180deg, #F4FCF8 0%, #EAF8F1 100%);
    border-color: rgba(72, 201, 176, 0.35);
}

.payroll-draft-page .modal,
.payroll-draft-page .modal-backdrop {
    z-index: 1055;
}

.payroll-draft-page .modal-dialog {
    z-index: 1060;
}

@media (min-width: 1200px) {
    :root {
        --wh-payroll-sticky-top: 1rem;
        --wh-payroll-panel-height: calc(100vh - var(--wh-payroll-sticky-top) - 2rem);
    }

    .payroll-sticky-panel {
        position: sticky;
        top: var(--wh-payroll-sticky-top);
    }

    .payroll-queue-card,
    .payroll-detail-card {
        max-height: var(--wh-payroll-panel-height);
        height: var(--wh-payroll-panel-height);
    }

        .payroll-queue-card .card-body,
        .payroll-detail-card-body {
            display: flex;
            flex-direction: column;
            height: 100%;
            min-height: 0;
        }

    .payroll-queue-scroll,
    .payroll-detail-scroll {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 0.25rem;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

@media (max-width: 1199.98px) {
    .payroll-sticky-panel,
    .payroll-queue-card,
    .payroll-detail-card,
    .payroll-queue-card .card-body,
    .payroll-detail-card-body,
    .payroll-queue-scroll,
    .payroll-detail-scroll {
        position: static;
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 767.98px) {
    .payroll-summary-strip {
        padding: 0.6rem 0.75rem;
    }

    .payroll-summary-strip-items {
        gap: 0.35rem 0.7rem;
    }

    .payroll-summary-item {
        white-space: normal;
    }

    .payroll-summary-item-message {
        margin-left: 0;
        width: 100%;
    }
}

/* =========================
   Responsive helpers
   ========================= */
@media (max-width: 991.98px) {
    .navbar-brand-text .platform-name {
        font-size: 1.1rem;
    }

    .navbar-brand-text .company-name {
        max-width: 160px;
    }

    .navbar-welcome {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    .navbar-robotic .navbar-collapse {
        margin-top: 0.75rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255,255,255,0.18);
        max-height: calc(100vh - 84px);
        max-height: calc(100svh - 84px);
        overflow-y: auto;
    }

    .navbar-robotic .navbar-nav {
        align-items: stretch !important;
    }

    .tenant-session-banner-inner,
    .tenant-session-banner-copy {
        align-items: stretch;
    }

    .tenant-session-banner-actions {
        width: 100%;
        justify-content: stretch;
    }

    .tenant-session-banner-action,
    .tenant-session-banner-action .btn {
        width: 100%;
    }

    .navbar-robotic .nav-link {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .navbar-link-with-badges {
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .navbar-badge-cluster {
        justify-content: flex-end;
    }

    .navbar-count-badge {
        margin-left: 0;
    }

    .app-shell {
        padding-top: 1rem;
        padding-bottom: 1.75rem;
    }

    .dashboard-page {
        max-width: none;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
        margin-bottom: 1.1rem;
    }

    .dashboard-title {
        font-size: 2rem;
    }

    .dashboard-header-actions {
        padding-top: 0;
    }

    .dashboard-manage-btn {
        min-height: 40px;
    }

    .dashboard-sections {
        gap: 1.2rem;
    }

    .dashboard-section-title {
        margin-bottom: 0.65rem;
    }

    .dashboard-card .card-body {
        padding: 1.1rem 1rem 1.05rem;
    }
}

@media (max-width: 767.98px) {
    .page-safe {
        padding-left: max(0.85rem, env(safe-area-inset-left));
        padding-right: max(0.85rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .dashboard-title {
        font-size: 1.85rem;
    }

    .dashboard-card-title {
        font-size: 0.98rem;
    }

    .dashboard-card-description {
        font-size: 0.98rem;
    }
}

@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }
}

@media (min-width: 992px) {
    .mywork-meta-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mywork-actions {
        width: 190px !important;
        align-self: center;
    }

    .workspace-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

@media (min-width: 1200px) {
    .dashboard-hero .card-body {
        padding: 1.2rem 1.7rem;
    }

    .dashboard-hero-row {
        min-height: 128px;
    }

    .dashboard-hero-left::before {
        width: 580px;
    }

    .dashboard-hero-logo {
        width: 300px;
    }

    .dashboard-hero-company {
        max-width: 360px;
    }
}

@media (min-width: 1400px) {
    .workspace-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.operations-nav {
    border-bottom: 1px solid #cfe5fb;
    margin-bottom: 1rem;
}

.operations-nav .nav-tabs {
    border-bottom: 0;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.operations-nav-mobile-toggle {
    border: 1px solid #cfe5fb;
    border-radius: 1rem;
    background: #ffffff;
    color: #17283a;
    font-weight: 600;
    padding: 0.85rem 1rem;
    box-shadow: 0 10px 24px rgba(69, 122, 181, 0.08);
}

.operations-nav-mobile-toggle::after {
    float: right;
    margin-top: 0.65rem;
}

.operations-nav-mobile-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7c8f;
    margin-bottom: 0.15rem;
}

.operations-nav-mobile-value {
    display: block;
    font-size: 1rem;
    color: #17283a;
}

.operations-nav-mobile-menu {
    border: 1px solid #cfe5fb;
    border-radius: 1rem;
    padding: 0.35rem;
    box-shadow: 0 16px 32px rgba(69, 122, 181, 0.14);
}

.operations-nav-mobile-menu .dropdown-item {
    border-radius: 0.8rem;
    font-weight: 600;
    padding: 0.75rem 0.85rem;
    color: #415569;
}

.operations-nav-mobile-menu .dropdown-item.active,
.operations-nav-mobile-menu .dropdown-item:active {
    background: #eef6ff;
    color: #1f5fbf;
}

.operations-nav .nav-link {
    border: 0;
    border-radius: 0.85rem 0.85rem 0 0;
    color: #4f6379;
    font-weight: 600;
    padding: 0.8rem 1.1rem;
}

.operations-nav .nav-link:hover,
.operations-nav .nav-link:focus {
    color: #1f5fbf;
    background: rgba(255, 255, 255, 0.55);
}

.operations-nav .nav-link.active {
    color: #17283a;
    background: #ffffff;
    box-shadow: 0 -1px 0 #cfe5fb, 1px 0 0 #cfe5fb, -1px 0 0 #cfe5fb;
}

@media (max-width: 767.98px) {
    .operations-nav {
        border-bottom: 0;
        margin-bottom: 0.85rem;
    }
}

.operations-billing-state {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.operations-billing-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: #9aa7b4;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.operations-billing-state-red .operations-billing-dot {
    background: #dc3545;
}

.operations-billing-state-yellow .operations-billing-dot {
    background: #ffc107;
}

.operations-billing-state-green .operations-billing-dot {
    background: #198754;
}

.operations-attention-card {
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.operations-attention-card:hover {
    box-shadow: 0 0.65rem 1.35rem rgba(28, 55, 90, 0.08);
    transform: translateY(-1px);
}

.operations-attention-title {
    color: #17283a;
}

.operations-attention-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: #5f7286;
    font-size: 0.85rem;
    font-weight: 600;
}

.operations-attention-meta span + span::before {
    content: "•";
    margin-right: 0.5rem;
    color: #91a1b2;
}

.operations-attention-side {
    min-width: 10.5rem;
}

@media (max-width: 767.98px) {
    .operations-attention-card .card-body {
        padding: 0.85rem;
    }

    .operations-attention-card .badge {
        font-size: 0.68rem;
    }

    .operations-attention-title {
        font-size: 0.98rem;
        line-height: 1.25;
    }

    .operations-attention-meta {
        gap: 0.35rem;
        font-size: 0.78rem;
    }

    .operations-attention-side {
        min-width: 0;
        width: 100%;
        text-align: left;
    }

    .operations-attention-card .d-flex.flex-wrap.gap-2.mt-3 {
        gap: 0.45rem !important;
    }

.operations-attention-card .d-flex.flex-wrap.gap-2.mt-3 .btn {
        flex: 1 1 auto;
    }
}

.billing-info-center-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 1rem 1.1rem;
}

.billing-info-center-card {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: none;
}

.billing-info-center-heading {
    max-width: 42rem;
}

.billing-signal-carousel {
    position: relative;
    min-width: 0;
}

.billing-signal-viewport {
    overflow: hidden;
    min-width: 0;
}

.billing-signal-carousel-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.billing-signal-carousel-status {
    min-width: 4.75rem;
    text-align: right;
    font-weight: 600;
}

.billing-signal-filter-group .billing-signal-filter {
    border-color: #d4dee9;
    color: #556b82;
    background: #fff;
    box-shadow: none;
}

.billing-signal-filter-group .billing-signal-filter.is-active,
.billing-signal-filter-group .billing-signal-filter[aria-pressed="true"] {
    color: #1e5dba;
    background: #eef5ff;
    border-color: #b9d1f1;
    font-weight: 600;
}

.billing-signal-empty {
    padding: 0.25rem 0 0.1rem;
}

.billing-signal-carousel-control {
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border-radius: 999px;
    transition: opacity 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.billing-signal-carousel-control.is-disabled,
.billing-signal-carousel-control:disabled {
    opacity: 0.45;
    cursor: default;
}

.billing-signal-track {
    display: flex;
    gap: var(--billing-signal-card-gap, 1rem);
    padding: 0.1rem 0 0.25rem;
    min-width: 0;
    will-change: transform;
    transition: transform 0.24s ease;
}

.billing-signal-card {
    --billing-signal-card-width: 21.5rem;
    flex: 0 0 var(--billing-signal-card-width);
    background: #fff;
    min-height: 100%;
    padding: 0.9rem !important;
    border-color: #dbe6f2 !important;
    box-shadow: 0 0.15rem 0.45rem rgba(27, 50, 79, 0.05);
}

.billing-signal-card .fw-semibold.text-break {
    line-height: 1.25;
}

.billing-signal-card .row.g-2.small.mb-3,
.billing-signal-card .small.mb-3 {
    margin-bottom: 0.75rem !important;
}

.billing-queue-card .card-body {
    padding-top: 1.15rem;
}

.billing-queue-title {
    font-size: 1.15rem;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .billing-signal-card {
        --billing-signal-card-width: 20.5rem;
    }
}

@media (max-width: 767.98px) {
    .billing-info-center-card .card-body {
        gap: 0.35rem;
        padding: 0.9rem;
    }

    .billing-signal-carousel-controls {
        gap: 0.35rem;
    }

    .billing-signal-carousel-status {
        min-width: 0;
        text-align: left;
    }

    .billing-signal-filter-group {
        width: 100%;
    }

    .billing-signal-filter-group .billing-signal-filter {
        flex: 1 1 0;
    }

    .billing-signal-track {
        padding-bottom: 0.15rem;
    }

    .billing-signal-card {
        --billing-signal-card-width: 100%;
        padding: 0.8rem !important;
    }

    .billing-signal-carousel-control {
        width: 2.1rem;
        height: 2.1rem;
    }
}
.issue-submit-active {
    overflow: hidden;
}

.issue-submit-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(20, 42, 58, 0.42);
    backdrop-filter: blur(3px);
}

.issue-submit-overlay[hidden] {
    display: none;
}

.issue-submit-overlay-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: min(100%, 26rem);
    padding: 1.25rem 1.4rem;
    border: 1px solid rgba(98, 174, 220, 0.4);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1.5rem 4rem rgba(20, 42, 58, 0.24);
    color: #17384d;
}

.issue-submit-overlay .spinner-border {
    flex: 0 0 auto;
    color: #4da3d7;
}

.issue-submit-overlay-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.issue-submit-overlay-copy {
    margin-top: 0.15rem;
    color: #60798a;
    font-size: 0.9rem;
}
