:root {
    --app-ink: #102033;
    --app-ink-soft: #5e7084;
    --app-bg: #c7d0d8;
    --app-panel: #ffffff;
    --app-accent: #0e7490;
    --app-accent-dark: #155e75;
    --app-border: #d6e0e8;
    --app-shadow: 0 24px 48px rgba(16, 32, 51, 0.08);
    --app-success: #1f8a4c;
    --app-danger: #b42318;
}

.metric-card {
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: var(--bs-body-bg);
}

.metric-card span {
    display: block;
    color: var(--bs-secondary-color);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    margin-top: .35rem;
    font-size: 1.35rem;
}

.dashboard-section[aria-labelledby="DashboardDailyOperationsHeading"] .metric-card span {
    color: #5e7084;
}

.dashboard-section[aria-labelledby="DashboardDailyOperationsHeading"] .metric-card strong {
    color: #102033;
}

.daily-operations-metrics .metric-card span {
    color: #5e7084;
}

.daily-operations-metrics .metric-card strong {
    color: #102033;
}

body.app-body {
    min-height: 100vh;
    margin: 0;
    color: var(--app-ink);
    background:
        radial-gradient(circle at top right, rgba(14, 116, 144, 0.12), transparent 28%),
        linear-gradient(180deg, #d8e0e7 0%, var(--app-bg) 100%);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.bill-selection-summary {
    padding: 0.65rem;
    color: var(--app-ink);
    background: var(--app-panel);
    border: 1px solid var(--app-border);
    border-radius: 0.75rem;
}

.bill-selection-summary__item {
    min-height: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
    background: rgba(16, 32, 51, 0.04);
}

.bill-selection-summary__label {
    color: var(--app-ink-soft);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.2;
}

.bill-selection-summary__value {
    margin-top: 0.18rem;
    color: var(--app-ink);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.topbar {
    border-bottom: 1px solid rgba(214, 224, 232, 0.9);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.topbar__brand-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.topbar__brand,
.topbar__brand:hover {
    color: var(--app-ink);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar__nav.collapse:not(.show) {
    display: flex;
}

.topbar__toggle {
    display: none;
    border-color: rgba(16, 32, 51, 0.14);
}

.topbar__toggle .navbar-toggler-icon {
    width: 1.2rem;
    height: 1.2rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2816, 32, 51, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.topbar__nav a {
    color: var(--app-ink-soft);
    text-decoration: none;
}

.topbar__dropdown-toggle {
    color: var(--app-ink-soft);
    text-decoration: none;
}

.topbar__dropdown-toggle:hover,
.topbar__dropdown-toggle:focus,
.topbar__nav a:hover,
.topbar__nav a:focus {
    color: var(--app-ink);
}

.topbar__dropdown-menu {
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    box-shadow: var(--app-shadow);
}

.topbar__dropdown-menu .dropdown-item {
    color: var(--app-ink);
}

.topbar__dropdown-menu .dropdown-item:hover,
.topbar__dropdown-menu .dropdown-item:focus {
    background: rgba(14, 116, 144, 0.08);
}

.topbar__dropdown-form {
    margin: 0;
}

.topbar__dropdown-button {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.topbar__icon-link,
.topbar__icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    height: 2.45rem;
    color: var(--app-ink-soft);
    border: 1px solid rgba(16, 32, 51, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
}

.topbar__icon-link svg,
.topbar__icon-button svg {
    width: 1.35rem;
    height: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.topbar__icon-link:hover,
.topbar__icon-link:focus,
.topbar__icon-button:hover,
.topbar__icon-button:focus {
    color: var(--app-ink);
}

.topbar-status-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.topbar-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.topbar-status--in {
    background: rgba(31, 138, 76, 0.14);
    color: var(--app-success);
}

.topbar-status--out {
    background: rgba(180, 35, 24, 0.14);
    color: var(--app-danger);
}

.topbar-status-text {
    color: var(--app-ink-soft);
    font-size: 0.9rem;
}

.app-main {
    padding-top: 2rem !important;
}

.hero-card,
.panel,
.status-panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--app-border);
    border-radius: 1.25rem;
    box-shadow: var(--app-shadow);
}

.hero-card {
    padding: 2rem;
}

.panel,
.status-panel {
    padding: 1.5rem;
    height: 100%;
}

.status-panel dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 0.75rem;
}

.status-panel dt {
    color: var(--app-ink-soft);
    font-weight: 600;
}

.status-panel dd {
    margin: 0;
}

.status-panel__split {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.status-panel__hours {
    color: #35526c;
    font-weight: 600;
    text-align: right;
}

.external-link {
    margin-left: 0.4rem;
    color: var(--app-accent);
    text-decoration: none;
}

.external-link:hover {
    color: var(--app-accent-dark);
}

.eyebrow {
    margin-bottom: 0.75rem;
    color: var(--app-accent-dark);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.btn-primary {
    background-color: var(--app-accent);
    border-color: var(--app-accent);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--app-accent-dark);
    border-color: var(--app-accent-dark);
}

.app-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

.app-shell--narrow {
    max-width: 640px;
}

@media (max-width: 767px) {
    .hero-card {
        padding: 1.5rem;
    }

    .topbar__inner {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .topbar__toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .topbar__nav {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-top: 0.75rem;
    }

    .topbar__dropdown {
        width: 100%;
    }

    .topbar__dropdown-toggle {
        display: inline-flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
    }

    .topbar__dropdown-menu {
        position: static !important;
        width: 100%;
        margin-top: 0.5rem;
        transform: none !important;
    }

    .topbar__nav.collapse:not(.show) {
        display: none;
    }

    .topbar__icon-link,
    .topbar__icon-button {
        width: 2.7rem;
        height: 2.7rem;
    }

    .topbar__icon-link svg,
    .topbar__icon-button svg {
        width: 1.45rem;
        height: 1.45rem;
    }

    .topbar__dropdown-form {
        width: 100%;
    }
}

.password-toggle-button {
    min-width: 3rem;
    color: var(--app-ink-soft);
}

.password-toggle-button:hover,
.password-toggle-button:focus {
    color: var(--app-accent-dark);
}

.topbar__logout-form {
    margin: 0;
}

.topbar__logout-button {
    border: 0;
    background: transparent;
    color: var(--app-ink-soft);
    padding: 0;
    line-height: inherit;
}

.topbar__logout-button:hover,
.topbar__logout-button:focus {
    color: var(--app-ink);
}

.topbar-status-text--alert {
    color: var(--app-danger);
    font-weight: 600;
}

.dashboard-alert-text {
    color: var(--app-danger);
    font-weight: 600;
}

.list-item--inactive,
.list-item--inactive a,
.list-item--inactive td,
.list-item--inactive th {
    color: #a9b2bc !important;
}

.crm-meta {
    color: var(--app-ink-soft);
    font-size: 0.82rem;
}

.crm-meta--warning {
    color: #9a3412;
    font-weight: 600;
}

.app-desktop-nav {
    gap: 0.25rem;
}

.app-nav-group__toggle {
    padding: 0.35rem 0.55rem;
    color: var(--app-ink-soft);
    text-decoration: none;
}

.app-nav-group__toggle:hover,
.app-nav-group__toggle:focus {
    color: var(--app-ink);
}

.app-mobile-nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.app-mobile-nav__section {
    border-bottom: 1px solid var(--app-border);
    padding-bottom: 0.75rem;
}

.app-mobile-nav__heading,
.customer-context-nav__label {
    margin: 0 0 0.4rem;
    color: var(--app-ink-soft);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-mobile-nav__link {
    display: block;
    padding: 0.35rem 0;
    color: var(--app-ink);
    text-decoration: none;
}

.app-mobile-nav__link.active,
.app-mobile-nav__link:hover,
.app-mobile-nav__link:focus {
    color: var(--app-accent-dark);
    font-weight: 700;
}

.app-mobile-nav__logout {
    margin-top: auto;
}

.customer-context-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.78);
}

.customer-context-nav__label {
    margin: 0 0.35rem 0 0;
}

.customer-context-nav a {
    color: var(--app-ink-soft);
    text-decoration: none;
}

.customer-context-nav a.active,
.customer-context-nav a:hover,
.customer-context-nav a:focus {
    color: var(--app-accent-dark);
    font-weight: 700;
}

.crm-meta--overdue {
    color: var(--app-danger);
    font-weight: 600;
}

.crm-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.crm-timeline__item {
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    background: rgba(238, 243, 247, 0.45);
}

.crm-timeline__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.9rem;
    margin-bottom: 0.35rem;
    color: var(--app-ink-soft);
    font-size: 0.88rem;
}

.executive-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.exec-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 150px;
    padding: 1.35rem;
    border-radius: 1.15rem;
    color: #fff;
    box-shadow: var(--app-shadow);
}

.exec-card__label {
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.9;
}

.exec-card__value {
    font-size: 2rem;
    line-height: 1;
}

.exec-card__meta {
    font-size: 0.95rem;
    opacity: 0.92;
}

.exec-card--teal {
    background: linear-gradient(135deg, #0e7490 0%, #155e75 100%);
}

.exec-card--gold {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.exec-card--rose {
    background: linear-gradient(135deg, #be123c 0%, #9f1239 100%);
}

.exec-card--navy {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
}

.exec-card--slate {
    background: linear-gradient(135deg, #334155 0%, #0f172a 100%);
}

.exec-card--sea {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
}

.website-monitor-row-down td {
    background-color: #fff1f2;
}

.billing-row-reversed td {
    background-color: #fff;
    color: #CCC;
}

.billing-row-reversed a {
    color: var(--bs-link-color);
}

.executive-stat-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.executive-stat-list__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--app-border);
}

.executive-stat-list__row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.executive-bars {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.executive-bars__row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) 90px;
    gap: 0.85rem;
    align-items: center;
}

.executive-bars__row--stacked {
    grid-template-columns: 1fr;
    gap: 0.55rem;
}

.executive-bars__label {
    font-weight: 600;
}

.executive-bars__label--wide {
    font-weight: 400;
}

.executive-bars__track {
    position: relative;
    height: 0.85rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.executive-bars__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0ea5e9 0%, #2563eb 100%);
}

.executive-bars__fill--accent {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.executive-bars__value {
    color: var(--app-ink-soft);
    font-weight: 700;
    text-align: right;
}

@media (max-width: 1199px) {
    .executive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .executive-grid {
        grid-template-columns: 1fr;
    }

    .executive-bars__row {
        grid-template-columns: 1fr;
    }

    .executive-bars__value {
        text-align: left;
    }
}

@media (max-width: 991px) {
    .topbar__toggle {
        display: inline-flex;
        margin-left: auto;
    }
}

/* Help Manual */
.help-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.help-toc {
    position: sticky;
    top: 1rem;
}

.help-toc__list {
    display: grid;
    gap: 0.5rem;
}

.help-toc__link {
    display: block;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--app-border);
    border-radius: 0.4rem;
    background: rgba(148, 163, 184, 0.08);
    color: var(--app-ink-soft);
    text-decoration: none;
}

.help-toc__link:hover,
.help-toc__link:focus {
    color: var(--bs-link-color);
    border-color: var(--bs-link-color);
    background: rgba(13, 110, 253, 0.1);
    text-decoration: underline;
}

.help-section {
    scroll-margin-top: 1rem;
}

.help-section[hidden] {
    display: none !important;
}

.help-anchor {
    color: var(--app-ink-soft);
    font-size: 0.8em;
    margin-left: 0.35rem;
    text-decoration: none;
}

.help-anchor:hover {
    color: var(--bs-link-color);
}

.help-callout {
    border-left: 4px solid #0d6efd;
    background: rgba(13, 110, 253, 0.08);
    border-radius: 0.4rem;
    padding: 0.9rem 1rem;
}

.help-callout--warning {
    border-left-color: #d97706;
    background: rgba(217, 119, 6, 0.11);
}

.help-callout--success {
    border-left-color: #198754;
    background: rgba(25, 135, 84, 0.1);
}

.help-detail {
    border: 1px solid var(--app-border);
    border-radius: 0.45rem;
    overflow: hidden;
}

.help-detail + .help-detail {
    margin-top: 0.75rem;
}

.help-detail summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    padding: 0.85rem 2.8rem 0.85rem 1rem;
    position: relative;
    transition: background-color 0.15s ease-in-out;
}

.help-detail summary::-webkit-details-marker {
    display: none;
}

.help-detail summary::after {
    content: "+";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.12);
    color: var(--bs-link-color);
    font-size: 1.15rem;
    line-height: 1;
}

.help-detail[open] summary::after {
    content: "–";
}

.help-detail summary:hover,
.help-detail summary:focus {
    background: rgba(13, 110, 253, 0.08);
    outline: none;
}

.help-detail summary:focus-visible {
    outline: 2px solid var(--bs-link-color);
    outline-offset: -2px;
}

.help-detail__content {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--app-border);
}

.help-detail__content > :first-child {
    margin-top: 1rem;
}

.help-search-empty[hidden] {
    display: none !important;
}

@media (max-width: 991px) {
    .help-layout {
        grid-template-columns: 1fr;
    }

    .help-toc {
        position: static;
    }

    .help-toc__list {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* Dashboard active-projects summary */
.dashboard-section {
    display: grid;
    gap: 1rem;
}

.dashboard-section > .row,
.dashboard-section > .row > [class*="col-"],
.dashboard-section > .row .panel {
    min-width: 0;
}

.dashboard-section > .row .table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

.dashboard-section__heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-action-grid,
.dashboard-attention-grid,
.dashboard-summary-grid,
.dashboard-utility-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-action-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-action-card,
.dashboard-attention-card,
.dashboard-summary-card,
.dashboard-utility-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    background: var(--app-panel);
    color: var(--app-ink);
    box-shadow: var(--app-shadow);
}

.dashboard-action-card,
.dashboard-attention-card,
.dashboard-utility-card {
    text-decoration: none;
}

.dashboard-action-card:hover,
.dashboard-action-card:focus-visible,
.dashboard-attention-card:hover,
.dashboard-attention-card:focus-visible,
.dashboard-utility-card:hover,
.dashboard-utility-card:focus-visible {
    color: var(--app-ink);
    border-color: rgba(13, 110, 253, 0.5);
    box-shadow: 0 0.6rem 1.4rem rgba(16, 32, 51, 0.14);
    transform: translateY(-1px);
}

.dashboard-action-card--primary {
    border-color: #0d6efd;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.13), rgba(14, 116, 144, 0.1));
}

.dashboard-action-card__eyebrow,
.dashboard-attention-card__label,
.dashboard-summary-card__label,
.dashboard-utility-card__label {
    color: var(--app-ink-soft);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.dashboard-action-card__title {
    font-size: 1.05rem;
}

.dashboard-action-card__detail,
.dashboard-attention-card__detail,
.dashboard-summary-card__detail,
.dashboard-utility-card__detail {
    color: var(--app-ink-soft);
    font-size: 0.88rem;
    line-height: 1.35;
}

.dashboard-attention-card {
    min-height: 8.6rem;
    background: rgba(255, 251, 235, 0.78);
}

.dashboard-attention-card--monitor {
    background: rgba(255, 241, 242, 0.88);
}

.dashboard-attention-card__value,
.dashboard-summary-card__value,
.dashboard-utility-card__value {
    font-size: 1.35rem;
    line-height: 1.15;
}

.dashboard-summary-card {
    box-shadow: none;
    background: rgba(238, 243, 247, 0.62);
}

.dashboard-utility-card {
    background: rgba(238, 243, 247, 0.62);
    box-shadow: none;
}

body.theme-dark .dashboard-action-card,
body.theme-dark .dashboard-summary-card,
body.theme-dark .dashboard-utility-card {
    background: rgba(20, 29, 38, 0.94);
    border-color: var(--app-border);
}

body.theme-dark .dashboard-attention-card {
    background: rgba(89, 67, 25, 0.35);
    border-color: var(--app-border);
}

body.theme-dark .dashboard-attention-card--monitor {
    background: rgba(101, 35, 49, 0.42);
}

@media (max-width: 1199.98px) {
    .dashboard-action-grid,
    .dashboard-attention-grid,
    .dashboard-summary-grid,
    .dashboard-utility-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
body.theme-dark .dashboard-action-card--primary {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.28), rgba(14, 116, 144, 0.22));
}
.active-projects-progress {
    min-width: 7rem;
    height: 0.85rem;
}

.active-projects-progress .progress-bar {
    min-width: 2.25rem;
    font-size: 0.7rem;
    line-height: 0.85rem;
}

@media (max-width: 767px) {
    .dashboard-section__heading {
        align-items: start;
    }

    .dashboard-action-grid,
    .dashboard-action-grid--compact,
    .dashboard-attention-grid,
    .dashboard-summary-grid,
    .dashboard-utility-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-action-card,
    .dashboard-attention-card,
    .dashboard-summary-card,
    .dashboard-utility-card {
        min-height: 0;
    }
    .active-projects-table th,
    .active-projects-table td {
        white-space: normal;
    }

    .active-projects-table th:nth-child(1),
    .active-projects-table td:nth-child(1) {
        min-width: 8rem;
    }

    .active-projects-table th:nth-child(2),
    .active-projects-table td:nth-child(2) {
        min-width: 10rem;
    }

    .active-projects-table th:nth-child(3),
    .active-projects-table td:nth-child(3) {
        min-width: 7.5rem;
    }

    .active-projects-table th:nth-child(4),
    .active-projects-table td:nth-child(4) {
        min-width: 8.5rem;
    }
}

@media print {
    .topbar,
    .offcanvas,
    .help-controls,
    .help-toc,
    .help-back-to-top {
        display: none !important;
    }

    .app-main {
        padding: 0 !important;
    }

    .panel,
    .hero-card {
        box-shadow: none !important;
        border: 0 !important;
    }

    .help-section {
        break-inside: avoid;
    }
}

