body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #050816;
    color: #f9fafb;
}

.dashboard {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.card {
    background: #0b1020;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.status-left {
    flex: 2;
}

.status-right {
    flex: 1;
    text-align: right;
}

.pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    margin: 2px;
}

.pill-warn {
    background: rgba(245, 158, 11, 0.13);
    color: #fcd34d;
}

.pill-bad {
    background: rgba(248, 113, 113, 0.13);
    color: #fca5a5;
}

.pill-info {
    background: rgba(59, 130, 246, 0.13);
    color: #93c5fd;
}

.select-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    margin-bottom: 6px;
}

.muted {
    color: #9ca3af;
    font-size: 12px;
}

.small {
    font-size: 12px;
}

.kpi-main {
    flex: 2;
    min-width: 320px;
}

.kpi-right-column {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kpi-amount {
    font-size: 40px;
    font-weight: 700;
    margin: 8px 0;
}

.kpi-row {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.kpi-block {
    flex: 1;
    min-width: 130px;
    background: rgba(17, 24, 39, 0.72);
    border-radius: 10px;
    padding: 12px;
}

.kpi-label {
    font-size: 12px;
    color: #9ca3af;
}

.kpi-value {
    font-size: 18px;
    font-weight: 600;
    margin-top: 4px;
}

.tag-row {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
}

.tag {
    padding: 4px 8px;
    border-radius: 999px;
    background: #111827;
    color: #d1d5db;
}

.section-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.estate-movement {
    margin-top: 16px;
}

.estate-movement-main {
    font-size: 22px;
    font-weight: 600;
}

.fix-card {
    padding: 12px 14px;
    border-radius: 10px;
    background: #111827;
    margin-bottom: 8px;
    font-size: 13px;
}

.fix-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.fix-meta {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.btn-small {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    color: #fff;
    cursor: pointer;
}

.briefing-card {
    flex: 1;
}

.briefing-header {
    font-weight: 600;
    margin-bottom: 8px;
}

.chat-bubble {
    background: #111827;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 12px;
    margin-bottom: 6px;
    line-height: 1.45;
}

.debug {
    margin-top: 16px;
    color: #fca5a5;
    font-size: 12px;
    white-space: pre-wrap;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 768px) {
    .status-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-right {
        text-align: left;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.period-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.period-nav-title {
    text-align: center;
}

.period-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #111827;
    color: #f9fafb;
    cursor: pointer;
    font-size: 20px;
    line-height: 28px;
}

    .period-arrow:hover {
        background: #1f2937;
    }

.period-arrow-left {
    left: 0;
}

.period-arrow-right {
    right: 0;
}

.security-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 8, 22, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.security-modal {
    width: 100%;
    max-width: 420px;
    background: #0b1020;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}

.security-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.security-modal-text {
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.security-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #111827;
    color: #f9fafb;
    font-size: 18px;
    letter-spacing: 3px;
    text-transform: uppercase;
    outline: none;
}

    .security-input:focus {
        border-color: #6366f1;
    }

.security-button {
    width: 100%;
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    color: #ffffff;
    cursor: pointer;
    font-weight: 600;
}

.security-error {
    display: block;
    margin-top: 10px;
    color: #fca5a5;
    font-size: 12px;
}

.baseline-card {
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(245, 158, 11, 0.12));
    border: 1px solid rgba(147, 197, 253, 0.22);
}

.baseline-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.baseline-title {
    font-size: 15px;
    font-weight: 700;
}

.baseline-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.baseline-box {
    background: rgba(17, 24, 39, 0.65);
    border-radius: 10px;
    padding: 10px 12px;
}

.baseline-label {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.baseline-value {
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .baseline-grid {
        grid-template-columns: 1fr;
    }
}

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

    .cg-table th,
    .cg-table td {
        padding: 8px 10px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.25);
        text-align: left;
    }

    .cg-table th {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #64748b;
    }

.cg-kpi-line {
    margin: 8px 0;
    font-size: 14px;
}

.cg-list-row {
    display: grid;
    grid-template-columns: 1.4fr auto;
    gap: 4px 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

    .cg-list-row small {
        grid-column: 1 / -1;
        color: #64748b;
    }

.cg-positive {
    color: #047857;
}

.cg-negative {
    color: #b91c1c;
}

.cg-pill {
    display: inline-block;
    margin: 4px 6px 4px 0;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    font-size: 12px;
}

.pill-label {
    opacity: 0.72;
    font-weight: 500;
    margin-right: 4px;
}

.dashboard-context-strip {
    display: grid;
    grid-template-columns: 230px 170px 210px minmax(280px, 1fr) 190px 190px;
    align-items: stretch;
    width: 100%;
}

.context-cell {
    padding: 14px 18px;
    border-right: 1px solid rgba(120,140,190,.22);
    min-height: 56px;
}

    .context-cell:last-child {
        border-right: none;
    }

.context-label {
    color: #8d9ab8;
    font-size: 12px;
    margin-bottom: 4px;
}

.context-value {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.context-note {
    color: #9ca9c7;
    font-size: 12px;
    margin-top: 3px;
}

.context-value.warning {
    color: #f59e0b;
    font-weight: 600;
}

.context-brand-ddl {
    background: transparent;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 700;
    padding: 0;
    width: 100%;
    outline: none;
}

    .context-brand-ddl option {
        color: #111827;
    }

.context-completion {
    display: flex;
    align-items: center;
    gap: 12px;
}

.completion-ring {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #030b22 57%, transparent 58%), conic-gradient(#8b5cf6 calc(var(--pct) * 1%), rgba(255,255,255,.14) 0);
    font-size: 12px;
    font-weight: 800;
}

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

    .context-cell:nth-child(2n) {
        border-right: none;
    }
}

@media (max-width: 640px) {
    .dashboard-context-strip {
        grid-template-columns: 1fr;
    }

    .context-cell {
        border-right: none;
        border-bottom: 1px solid rgba(120,140,190,.22);
    }

        .context-cell:last-child {
            border-bottom: none;
        }
}

.ai-question-card {
    margin: 14px 0 18px 0;
}

.ai-question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.ai-question-title {
    font-size: 18px;
    font-weight: 600;
    margin-top: 4px;
}

.ai-question-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: stretch;
}

.ai-question-input {
    width: 100%;
    min-height: 58px;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.45;
    background: rgba(255, 255, 255, 0.96);
    color: #111827;
    box-sizing: border-box;
}

    .ai-question-input:focus {
        outline: none;
        border-color: rgba(59, 130, 246, 0.75);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    }

.ai-question-button {
    min-width: 92px;
    border: 0;
    border-radius: 12px;
    padding: 0 18px;
    font-weight: 700;
    cursor: pointer;
    background: #2563eb;
    color: #fff;
}

    .ai-question-button:hover {
        filter: brightness(0.96);
    }

.ai-answer-panel {
    margin-top: 14px;
    border-radius: 12px;
    padding: 14px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.ai-answer-text {
    margin-top: 6px;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 14px;
}

.ai-question-error {
    display: block;
    margin-top: 10px;
    color: #b91c1c;
    font-weight: 600;
}

@media (max-width: 700px) {
    .ai-question-body {
        grid-template-columns: 1fr;
    }

    .ai-question-button {
        min-height: 44px;
    }
}
.context-billing-progress {
    padding: 0;
    overflow: hidden;
    min-width: 0;
}

.billing-progress-card {
    width: 100%;
    height: 100%;
    min-height: 105px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: 18px;
    color: #ffffff;
    background: radial-gradient(circle at 10% 15%, rgba(118, 86, 255, 0.22), transparent 34%), linear-gradient(135deg, #071126 0%, #090f25 48%, #0d1531 100%);
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.billing-progress-ring {
    --pct: 0;
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(closest-side, #071126 64%, transparent 65%), conic-gradient(#8b5cf6 calc(var(--pct) * 1%), rgba(65, 79, 128, 0.55) 0);
}

.billing-progress-ring-inner {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.billing-progress-content {
    min-width: 0;
    flex: 1;
}

.billing-progress-label {
    font-size: 15px;
    line-height: 1.2;
    font-weight: 400;
    color: rgba(226, 232, 240, 0.78);
    margin-bottom: 8px;
}

.billing-progress-main {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.billing-progress-note {
    font-size: 14px;
    line-height: 1.2;
    font-weight: 400;
    color: rgba(226, 232, 240, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.context-brand-item {
    min-width: 0;
    overflow: hidden;
}

.context-brand-select-wrap {
    position: relative;
    width: 100%;
    max-width: 190px;
    margin-top: 6px;
}

.context-brand-select {
    width: 100%;
    max-width: 190px;
    box-sizing: border-box;
    height: 34px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(147, 197, 253, 0.35);
    border-radius: 10px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 4px 32px 4px 10px;
    outline: none;
    cursor: pointer;
}

    .context-brand-select:hover {
        background: rgba(255, 255, 255, 0.09);
        border-color: rgba(147, 197, 253, 0.55);
    }

    .context-brand-select:focus {
        border-color: rgba(96, 165, 250, 0.85);
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
    }

.context-brand-select-wrap::after {
    content: "▾";
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-52%);
    pointer-events: none;
    color: #bfdbfe;
    font-size: 13px;
    font-weight: 700;
}

.context-brand-select option {
    background: #0b1020;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
}

.context-period-item {
    min-width: 0;
    overflow: hidden;
}

.context-period-select-wrap {
    position: relative;
    width: 100%;
    max-width: 140px;
    margin-top: 6px;
}

.context-period-select {
    width: 100%;
    max-width: 140px;
    box-sizing: border-box;
    height: 34px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(147, 197, 253, 0.35);
    border-radius: 10px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 4px 32px 4px 10px;
    outline: none;
    cursor: pointer;
}

    .context-period-select:hover {
        background: rgba(255, 255, 255, 0.09);
        border-color: rgba(147, 197, 253, 0.55);
    }

    .context-period-select:focus {
        border-color: rgba(96, 165, 250, 0.85);
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
    }

.context-period-select-wrap::after {
    content: "▾";
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-52%);
    pointer-events: none;
    color: #bfdbfe;
    font-size: 13px;
    font-weight: 700;
}

.context-period-select option {
    background: #0b1020;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
}

.billing-progress-card {
    cursor: pointer;
}

.billing-progress-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(176, 92, 255, 0.28);
}

.billing-execution-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 18px;
    background: rgba(2, 8, 20, 0.30);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

.billing-execution-panel {
    width: min(490px, calc(100vw - 28px));
    border: 1px solid rgba(112, 137, 176, 0.18);
    border-radius: 12px;
    background: radial-gradient(circle at top left, rgba(142, 76, 255, 0.10), transparent 28%), linear-gradient(180deg, #071323 0%, #061120 100%);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
    padding: 18px 20px 24px;
    color: #eef5ff;
    cursor: pointer;
}

.billing-execution-header {
    margin-bottom: 24px;
}

.billing-execution-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.billing-execution-title-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    color: #c06cff;
    font-size: 24px;
    line-height: 1;
}

.billing-execution-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.billing-execution-subtitle {
    margin-top: 3px;
    font-size: 13px;
    color: rgba(224, 234, 250, 0.70);
}

.billing-execution-list {
    display: flex;
    flex-direction: column;
}

.billing-execution-row {
    display: grid;
    grid-template-columns: 26px 112px minmax(120px, 1fr) 86px 42px;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    border-bottom: 1px solid rgba(120, 147, 190, 0.10);
}

    .billing-execution-row:last-child {
        border-bottom: none;
    }

.billing-execution-icon {
    color: #c06cff;
    font-size: 18px;
    line-height: 1;
    text-align: center;
}

.billing-execution-name {
    font-size: 13px;
    font-weight: 500;
    color: rgba(238, 245, 255, 0.88);
}

.billing-execution-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(72, 99, 136, 0.40);
    overflow: hidden;
}

.billing-execution-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #b14cff, #8e43ff);
}

.billing-execution-value {
    font-size: 13px;
    font-weight: 700;
    color: #f4f8ff;
    text-align: right;
    white-space: nowrap;
}

.billing-execution-percent {
    font-size: 13px;
    font-weight: 500;
    color: rgba(224, 234, 250, 0.68);
    text-align: right;
}

.billing-execution-footnote {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 13px 15px;
    border: 1px solid rgba(87, 127, 180, 0.15);
    border-radius: 9px;
    background: rgba(19, 39, 66, 0.58);
    color: rgba(226, 235, 249, 0.78);
    font-size: 12px;
}

.billing-execution-info {
    width: 17px;
    height: 17px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #1595ff;
    border-radius: 50%;
    color: #1595ff;
    font-size: 11px;
    font-weight: 700;
    flex: 0 0 auto;
}
/* Append these rules to wwwroot/css/cogenie-mtd.css for the expanded MonthToDate Razor page. */

.mtd-loading,
.mtd-error {
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
}

.mtd-loading {
    background: rgba(15, 23, 42, 0.06);
    color: #64748b;
}

.mtd-error {
    background: rgba(248, 113, 113, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(248, 113, 113, 0.28);
}

.mtd-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.mtd-row-spaced {
    margin-top: 16px;
}

.card {
    background: #0b1020;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: #f9fafb;
}

.card-wide {
    flex: 1 1 100%;
    min-width: 320px;
}

.card-half {
    flex: 1 1 420px;
    min-width: 320px;
}

.kpi-main {
    flex: 2 1 620px;
    min-width: 320px;
}

.kpi-right-column {
    flex: 1 1 340px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kpi-amount {
    font-size: 40px;
    font-weight: 700;
    margin: 8px 0;
}

.kpi-row {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.kpi-block {
    flex: 1;
    min-width: 150px;
    background: rgba(17, 24, 39, 0.72);
    border-radius: 10px;
    padding: 12px;
}

.kpi-label {
    font-size: 12px;
    color: #9ca3af;
}

.kpi-value {
    font-size: 18px;
    font-weight: 600;
    margin-top: 4px;
}

.muted {
    color: #9ca3af;
    font-size: 12px;
}

.section-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.section-title-spaced {
    margin-top: 16px;
}

.tag-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
}

.tag {
    padding: 4px 8px;
    border-radius: 999px;
    background: #111827;
    color: #d1d5db;
}

.pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    margin: 2px;
}

.pill-info {
    background: rgba(59, 130, 246, 0.13);
    color: #93c5fd;
}

.baseline-card {
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(245, 158, 11, 0.12));
    border: 1px solid rgba(147, 197, 253, 0.22);
}

.baseline-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.baseline-title {
    font-size: 15px;
    font-weight: 700;
}

.baseline-grid,
.mtd-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

    .baseline-box,
    .mtd-summary-grid > div {
        background: rgba(17, 24, 39, 0.65);
        border-radius: 10px;
        padding: 10px 12px;
    }

.baseline-label {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.baseline-value {
    font-size: 14px;
    font-weight: 600;
}

.period-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.period-nav-title {
    text-align: center;
}

.period-nav-period {
    font-weight: 600;
    font-size: 14px;
}

.period-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #111827;
    color: #f9fafb;
    cursor: pointer;
    font-size: 20px;
    line-height: 28px;
}

    .period-arrow:hover {
        background: #1f2937;
    }

.period-arrow-left {
    left: 0;
}

.period-arrow-right {
    right: 0;
}

.estate-movement {
    margin-top: 16px;
}

.estate-movement-main {
    font-size: 22px;
    font-weight: 600;
}

.briefing-card {
    flex: 1;
}

.briefing-header {
    font-weight: 600;
    margin-bottom: 8px;
}

.chat-bubble {
    background: #111827;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 12px;
    margin-bottom: 6px;
    line-height: 1.45;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mtd-section-grid {
    margin-top: 12px;
}

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

    .cg-table th,
    .cg-table td {
        padding: 8px 10px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.25);
        text-align: left;
    }

    .cg-table th {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #9ca3af;
    }

.table-scroll {
    overflow-x: auto;
}

.cg-kpi-line {
    margin: 8px 0;
    font-size: 14px;
}

.cg-list-row {
    display: grid;
    grid-template-columns: 1.4fr auto;
    gap: 4px 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

    .cg-list-row small {
        grid-column: 1 / -1;
        color: #9ca3af;
    }

.cg-positive {
    color: #6ee7b7;
}

.cg-negative {
    color: #fca5a5;
}

.fix-card {
    padding: 12px 14px;
    border-radius: 10px;
    background: #111827;
    margin-bottom: 8px;
    font-size: 13px;
}

.fix-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.fix-meta {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 4px;
}

@media (max-width: 900px) {
    .grid-2,
    .baseline-grid,
    .mtd-summary-grid {
        grid-template-columns: 1fr;
    }

    .kpi-amount {
        font-size: 32px;
    }
}
/* =========================================================
   Month To Date - lower dashboard contrast fixes
   Keep this at the VERY BOTTOM of cogenie-mtd.css
   ========================================================= */

.mtd-page {
    color: #dbeafe;
}

    /* Main cards */
    .mtd-page .card,
    .mtd-page .kpi-block,
    .mtd-page .baseline-box,
    .mtd-page .fix-card,
    .mtd-page .chat-bubble,
    .mtd-page .mtd-summary-grid > div {
        background-color: #111827;
        color: #e5eefc !important;
    }

    /* Main headings */
    .mtd-page .section-title,
    .mtd-page .briefing-header,
    .mtd-page .baseline-title {
        color: #f8fafc !important;
        opacity: 1;
    }

    /* Main KPI numbers */
    .mtd-page .kpi-amount,
    .mtd-page .kpi-value,
    .mtd-page .baseline-value,
    .mtd-page .estate-movement-main {
        color: #f1f5f9 !important;
        opacity: 1;
    }

    /* Labels and secondary text */
    .mtd-page .kpi-label,
    .mtd-page .baseline-label,
    .mtd-page .muted,
    .mtd-page .fix-meta,
    .mtd-page .cg-list-row small,
    .mtd-page .cg-table th {
        color: #b7c7df !important;
        opacity: 1;
    }

    /* Normal body text inside cards */
    .mtd-page .cg-kpi-line,
    .mtd-page .cg-list-row,
    .mtd-page .cg-table td,
    .mtd-page .fix-title,
    .mtd-page .chat-bubble {
        color: #dbeafe !important;
    }

    /* Positive / negative values */
    .mtd-page .cg-positive {
        color: #34d399 !important;
    }

    .mtd-page .cg-negative {
        color: #fb7185 !important;
    }

    /* Warning / amber text */
    .mtd-page .context-value.warning,
    .mtd-page .warning {
        color: #fbbf24 !important;
    }

    /* Tags / pills */
    .mtd-page .tag,
    .mtd-page .pill,
    .mtd-page .pill-info {
        color: #e5eefc !important;
        background: rgba(30, 41, 59, 0.95);
    }

    /* Tables */
    .mtd-page .cg-table {
        color: #dbeafe !important;
    }

        .mtd-page .cg-table th,
        .mtd-page .cg-table td {
            border-bottom-color: rgba(148, 163, 184, 0.32);
        }

    /* Summary boxes need a clearer border on the dark background */
    .mtd-page .mtd-summary-grid > div,
    .mtd-page .kpi-block,
    .mtd-page .fix-card,
    .mtd-page .baseline-box {
        border: 1px solid rgba(148, 163, 184, 0.16);
    }

    /* Slightly brighten card borders */
    .mtd-page .card {
        border-color: rgba(148, 163, 184, 0.18);
    }
/* =========================================================
   Month To Date - section row layout
   ========================================================= */

.mtd-lower-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

/* Generic row */
.mtd-row {
    width: 100%;
}

/* 2 sections side by side */
.mtd-row-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

/* Full-width single section */
.mtd-row-full {
    display: block;
}

/* Shared panel styling */
.mtd-panel {
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
}

/* First row can be weighted slightly like the old layout if wanted */
.mtd-row-split.mtd-row-top {
    grid-template-columns: 2fr 1fr;
}

/* Optional: if you want the first row wider on left, use this class instead */
.mtd-row-estate {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Make tables/cards behave properly inside grid items */
.mtd-panel .cg-table {
    width: 100%;
}

    .mtd-panel .cg-table th,
    .mtd-panel .cg-table td {
        white-space: normal;
    }

/* Stop inner content forcing cards too wide */
.mtd-panel * {
    max-width: 100%;
}

/* Responsive */
@media (max-width: 1100px) {
    .mtd-row-split,
    .mtd-row-estate {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   Month To Date - compact top context strip
   Keep this at the VERY BOTTOM of cogenie-mtd.css
   ========================================================= */

/* Reduce the overall height of the top row */
.dashboard-context-strip {
    align-items: stretch;
}

    /* Make each top cell less tall */
    .dashboard-context-strip .context-cell {
        padding-top: 18px;
        padding-bottom: 18px;
        min-height: 110px;
    }

    /* Reduce excessive vertical spacing inside labels/values */
    .dashboard-context-strip .context-label {
        margin-bottom: 8px;
        line-height: 1.2;
    }

    .dashboard-context-strip .context-value {
        line-height: 1.25;
    }

    /* Stop long notes, especially Commercial Health, from making the whole row huge */
    .dashboard-context-strip .context-note {
        font-size: 13px;
        line-height: 1.35;
        margin-top: 10px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Bring Billing Progress nearer the top */
    .dashboard-context-strip .context-billing-progress {
        padding-top: 0;
        padding-bottom: 0;
        display: flex;
        align-items: flex-start;
    }

    /* Make the Billing Progress card sit higher and not centre vertically too low */
    .dashboard-context-strip .billing-progress-card {
        min-height: 110px;
        height: 100%;
        align-items: center;
        justify-content: flex-start;
        padding-top: 22px;
        padding-bottom: 18px;
    }

    /* Slightly tighten the Billing Progress text */
    .dashboard-context-strip .billing-progress-content {
        padding-top: 0;
    }

    .dashboard-context-strip .billing-progress-label {
        margin-bottom: 8px;
        line-height: 1.2;
    }

    .dashboard-context-strip .billing-progress-main {
        line-height: 1.2;
        margin-bottom: 6px;
    }

    .dashboard-context-strip .billing-progress-note {
        line-height: 1.25;
    }

    /* Slightly reduce the ring so the row can shrink */
    .dashboard-context-strip .billing-progress-ring {
        width: 72px;
        height: 72px;
        min-width: 72px;
    }

    .dashboard-context-strip .billing-progress-ring-inner {
        font-size: 15px;
    }

    /* =========================================================
   Month To Date - tighter top strip override
   Put this AFTER the previous compact top strip CSS
   ========================================================= */

    /* Shrink the whole top strip */
    .dashboard-context-strip .context-cell {
        padding-top: 14px !important;
        padding-bottom: 14px !important;
        min-height: 92px !important;
    }

    /* Make Billing Progress start at the same top level as Brand/Billing Period */
    .dashboard-context-strip .context-billing-progress {
        padding: 14px 24px !important;
        display: flex !important;
        align-items: flex-start !important;
    }

    /* Remove the internal vertical centering that is pushing Billing Progress down */
    .dashboard-context-strip .billing-progress-card {
        height: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
    }

    /* Keep ring aligned with the Billing Progress text */
    .dashboard-context-strip .billing-progress-ring {
        width: 58px !important;
        height: 58px !important;
        min-width: 58px !important;
        margin-top: 0 !important;
    }

    .dashboard-context-strip .billing-progress-ring-inner {
        font-size: 13px !important;
    }

    /* Tighten Billing Progress text */
    .dashboard-context-strip .billing-progress-content {
        padding-top: 0 !important;
    }

    .dashboard-context-strip .billing-progress-label {
        font-size: 14px !important;
        line-height: 1.15 !important;
        margin-bottom: 6px !important;
    }

    .dashboard-context-strip .billing-progress-main {
        font-size: 16px !important;
        line-height: 1.15 !important;
        margin-bottom: 4px !important;
    }

    .dashboard-context-strip .billing-progress-note {
        font-size: 14px !important;
        line-height: 1.2 !important;
    }

    /* Make all top notes smaller */
    .dashboard-context-strip .context-note {
        font-size: 12px !important;
        line-height: 1.25 !important;
        margin-top: 8px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    /* Commercial Health specifically: smaller and more compact */
    .dashboard-context-strip .context-cell:last-child .context-note {
        font-size: 11px !important;
        line-height: 1.22 !important;
        margin-top: 6px !important;
        -webkit-line-clamp: 3 !important;
    }

    /* Commercial Health value slightly smaller too */
    .dashboard-context-strip .context-cell:last-child .context-value {
        font-size: 17px !important;
        line-height: 1.15 !important;
    }

    /* Keep the labels aligned */
    .dashboard-context-strip .context-label {
        font-size: 13px !important;
        line-height: 1.15 !important;
        margin-bottom: 8px !important;
    }
/* Customer Movement colours */
.estate-movement-main.cg-positive {
    color: #34d399 !important;
}

.estate-movement-main.cg-negative {
    color: #fb7185 !important;
}

.estate-movement-main.cg-neutral {
    color: #e5eefc !important;
}

.estate-movement-pills {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 8px;
    margin-bottom: 8px;
}

    .estate-movement-pills .cg-positive {
        color: #34d399 !important;
    }

    .estate-movement-pills .cg-negative {
        color: #fb7185 !important;
    }


.billing-execution-overlay.cg-modal-hidden {
    display: none !important;
}
