html, body {
    background: #f4f6f8;
    color: #1d2733;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.25rem;
}

h1 {
    color: #182230;
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

h2 {
    color: #27364a;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: .85rem;
}

.metric-grid {
    display: grid;
    gap: .9rem;
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    margin-bottom: 1rem;
}

.metric {
    background: #ffffff;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    padding: .9rem 1rem;
}

.metric span {
    color: #526174;
    display: block;
    font-size: .84rem;
}

.metric strong {
    color: #16202d;
    display: block;
    font-size: 1.8rem;
    line-height: 1.15;
}

.metric.urgent strong {
    color: #b42318;
}

.two-column,
.workspace {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
}

.panel {
    background: #ffffff;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    padding: 1rem;
}

.form-grid {
    display: grid;
    gap: .8rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: .9rem;
}

.form-grid label {
    color: #465568;
    font-size: .86rem;
    font-weight: 600;
}

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

.table {
    margin-bottom: 0;
}

.table th {
    color: #526174;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.table td {
    color: #1d2733;
    vertical-align: middle;
}

.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #526174;
    margin: 0;
    padding: 1rem;
    text-align: center;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.compact td,
.compact th {
    padding: .45rem .5rem;
}

.link-button {
    background: transparent;
    border: 0;
    color: #006bb7;
    font: inherit;
    font-weight: 700;
    padding: 0;
    text-align: left;
}

.link-button:hover,
.link-button:focus {
    color: #004f87;
    text-decoration: underline;
}

.status {
    background: #e8f0fe;
    border: 1px solid #c6d7fb;
    border-radius: 999px;
    color: #1b4d9b;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    padding: .28rem .5rem;
}

.top-row {
    gap: .75rem;
}

.current-user {
    color: #344054;
    font-size: .88rem;
    font-weight: 700;
    margin-left: auto;
}

.auth-main {
    align-items: center;
    background: #eef2f6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
}

.login-panel {
    background: #fff;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(18, 32, 48, .1);
    display: grid;
    gap: 1rem;
    max-width: 430px;
    padding: 1.4rem;
    width: min(430px, calc(100vw - 2rem));
}

.login-panel h1 {
    margin-bottom: .35rem;
}

.login-panel p {
    color: #526174;
    margin: 0;
}

.login-kicker {
    align-items: center;
    color: #1b6ec2;
    display: inline-flex;
    font-size: .78rem;
    gap: .5rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.login-kicker .brand-logo {
    height: 2.4rem;
    object-fit: contain;
    width: 2.4rem;
}

.login-form {
    display: grid;
    gap: .8rem;
    margin-bottom: 1rem;
}

.login-form label {
    align-items: center;
    color: #526174;
    display: grid;
    font-size: .86rem;
    font-weight: 600;
    gap: .45rem;
}

.role-chip {
    background: #edf7ed;
    border: 1px solid #c8e6c9;
    border-radius: 999px;
    color: #1b5e20;
    font-size: .78rem;
    font-weight: 700;
    padding: .3rem .6rem;
}

.context-line {
    color: #526174;
    font-size: .9rem;
    margin-bottom: 1rem;
}

.page-title-row {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.details-grid {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    margin-bottom: 1rem;
}

.details-grid dt {
    color: #526174;
    font-weight: 700;
}

.details-grid dd {
    margin-bottom: .55rem;
}

.lead-contact-list {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    margin-bottom: 1rem;
    overflow: hidden;
}

.lead-contact-row {
    align-items: center;
    border-bottom: 1px solid #eef1f5;
    display: grid;
    gap: .7rem;
    grid-template-columns: 100px minmax(0, 1fr) minmax(120px, auto);
    padding: .65rem .75rem;
}

.lead-contact-row:last-child {
    border-bottom: 0;
}

.lead-contact-row span {
    color: #526174;
    font-size: .86rem;
}

.lead-contact-row strong {
    color: #1d2733;
    font-weight: 700;
}

.lead-comment {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: .75rem;
}

.lead-comment p {
    margin: .35rem 0 0;
}

.field-block {
    color: #465568;
    display: block;
    font-size: .86rem;
    font-weight: 600;
    margin-bottom: .75rem;
}

.inline-form {
    display: flex;
    gap: .75rem;
}

.filter-bar {
    align-items: end;
    display: grid;
    gap: .6rem;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    margin-bottom: .85rem;
}

.filter-bar label {
    color: #465568;
    font-size: .82rem;
    font-weight: 600;
}

.section-gap {
    margin-top: 1rem;
}

.section-gap-small {
    margin-top: .75rem;
}

.timeline {
    display: grid;
    gap: .75rem;
    margin-top: 1rem;
}

.timeline-item {
    border-left: 3px solid #8fb3e8;
    padding-left: .75rem;
}

.timeline-item span {
    color: #526174;
    display: block;
    font-size: .78rem;
}

.timeline-item p {
    margin: .3rem 0 0;
}

.table-actions {
    white-space: nowrap;
}

.pagination-bar {
    align-items: center;
    border-top: 1px solid #eef1f5;
    color: #526174;
    display: flex;
    font-size: .86rem;
    gap: .75rem;
    justify-content: space-between;
    margin-top: .75rem;
    padding-top: .75rem;
}

.pagination-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.pagination-actions span {
    color: #344054;
    font-weight: 700;
}

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

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

.calendar-strip {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .75rem;
}

.day-pill {
    background: #fff;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    color: #344054;
    min-width: 5.25rem;
    padding: .55rem .65rem;
    text-align: left;
}

.day-pill span {
    color: #667085;
    display: block;
    font-size: .78rem;
}

.day-pill.active {
    border-color: #1b6ec2;
    box-shadow: inset 0 0 0 1px #1b6ec2;
}

.lesson-block,
.funnel-block,
.duplicate-row {
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    margin-bottom: .75rem;
    padding: .85rem;
}

.lesson-head {
    align-items: flex-start;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    margin-bottom: .65rem;
}

.lesson-head span,
.duplicate-row span {
    color: #526174;
    display: block;
    font-size: .84rem;
}

.attendance-table {
    table-layout: fixed;
    width: 100%;
}

.attendance-client-column {
    width: 43%;
}

.attendance-status-column {
    width: 26%;
}

.attendance-actions-column {
    width: 31%;
}

.attendance-client-cell,
.attendance-status-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attendance-actions {
    align-items: center;
    justify-content: flex-start;
}

.check-grid {
    display: grid;
    gap: .45rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 16rem;
    overflow: auto;
}

.check-row {
    align-items: center;
    display: flex;
    gap: .45rem;
}

.stage-list {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.funnel-workspace {
    background: #fbfcfe;
}

.funnel-board-toolbar {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.funnel-board-toolbar h2 {
    margin-bottom: .25rem;
}

.funnel-board-toolbar p {
    color: #526174;
    font-size: .88rem;
    margin: 0;
}

.funnel-board-controls {
    align-items: center;
    display: flex;
    gap: .65rem;
}

.funnel-board-controls span {
    background: #eef2f6;
    border: 1px solid #d8e0ea;
    border-radius: 999px;
    color: #465568;
    font-size: .8rem;
    font-weight: 700;
    padding: .32rem .6rem;
    white-space: nowrap;
}

.funnel-select {
    min-width: 17rem;
}

.funnel-board {
    display: grid;
    gap: .85rem;
    grid-auto-columns: minmax(18rem, 1fr);
    grid-auto-flow: column;
    overflow-x: auto;
    padding: .15rem .15rem .75rem;
}

.funnel-column {
    --stage-accent: #1b6ec2;
    background: #f8fafc;
    border: 1px solid #d8e0ea;
    border-top: 4px solid var(--stage-accent);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(18, 32, 48, .06);
    display: flex;
    flex-direction: column;
    max-height: 38rem;
    min-width: 0;
    padding: .75rem;
}

.funnel-column-head {
    align-items: flex-start;
    display: flex;
    gap: .5rem;
    justify-content: space-between;
    margin-bottom: .55rem;
}

.funnel-column-head h3 {
    color: #182230;
    font-size: .98rem;
    font-weight: 800;
    margin: 0;
}

.funnel-column-head span,
.funnel-column-empty,
.lead-card span {
    color: #526174;
    font-size: .8rem;
}

.funnel-count {
    align-items: center;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--stage-accent) 35%, #d8e0ea);
    border-radius: 999px;
    color: var(--stage-accent) !important;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-width: 2rem;
    padding: .25rem .45rem;
}

.funnel-column-tools {
    align-items: center;
    display: flex;
    gap: .35rem;
}

.funnel-column-tools .btn {
    align-items: center;
    display: inline-flex;
    font-weight: 800;
    height: 2rem;
    justify-content: center;
    padding: 0;
    width: 2rem;
}

.stage-kind {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    color: #9a3412;
    font-size: .76rem;
    font-weight: 800;
    margin-bottom: .6rem;
    padding: .32rem .45rem;
}

.stage-kind-success {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #166534;
}

.funnel-column-body {
    overflow-y: auto;
    padding-right: .15rem;
}

.funnel-column-empty {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: .85rem;
    text-align: center;
}

.lead-card {
    background: #fff;
    border: 1px solid #d8e0ea;
    border-left: 3px solid var(--stage-accent);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(18, 32, 48, .05);
    display: grid;
    gap: .5rem;
    margin-bottom: .6rem;
    padding: .72rem;
}

.lead-card-main,
.lead-card-meta {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

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

.lead-card strong {
    color: #182230;
}

.lead-card-meta {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
}

.lead-card-meta span:first-child {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: #1f2a5c;
    font-weight: 700;
    padding: .22rem .45rem;
}

.lead-card-actions {
    display: grid;
    gap: .35rem;
    grid-template-columns: 2.35rem minmax(0, 1fr) 2.35rem;
}

.lead-card-actions .btn {
    min-height: 2rem;
}

.board-action-panel {
    background: #fff;
    border: 1px solid #d8e0ea;
    border-left: 4px solid #1b6ec2;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(18, 32, 48, .06);
    margin-bottom: 1rem;
    padding: .9rem;
}

.board-action-panel .filter-bar {
    margin-bottom: .75rem;
}

.existing-lead-list {
    display: grid;
    gap: .5rem;
}

.existing-lead-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    padding: .65rem .75rem;
}

.existing-lead-row div {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.existing-lead-row strong,
.existing-lead-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.existing-lead-row span {
    color: #526174;
    font-size: .82rem;
}

@media (max-width: 640.98px) {
    .funnel-board-toolbar,
    .funnel-board-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .funnel-select {
        min-width: 0;
        width: 100%;
    }

    .existing-lead-row {
        align-items: stretch;
        flex-direction: column;
    }
}

.utility-box {
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: .85rem;
}

.panel-title-row {
    align-items: center;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    margin-bottom: .85rem;
}

.panel-title-row h2 {
    margin-bottom: 0;
}

.segmented-control {
    background: #eef2f6;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    display: inline-flex;
    padding: .15rem;
}

.segmented-control button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #465568;
    font-size: .8rem;
    font-weight: 700;
    padding: .32rem .55rem;
}

.segmented-control button.active {
    background: #fff;
    box-shadow: 0 1px 4px rgba(16, 24, 40, .12);
    color: #1b4d9b;
}

.page-tabs {
    margin-bottom: 1rem;
}

.app-modal-backdrop {
    align-items: center;
    background: rgba(15, 23, 42, .35);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 30;
}

.app-modal-panel {
    background: #fff;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .22);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    padding: 1rem;
    width: min(620px, calc(100vw - 2rem));
}

.app-modal-panel-wide {
    width: min(760px, calc(100vw - 2rem));
}

.bar-row {
    align-items: center;
    display: grid;
    gap: .6rem;
    grid-template-columns: minmax(120px, 1fr) minmax(120px, 2fr) auto;
    margin-bottom: .65rem;
}

.bar-row span {
    color: #344054;
    font-size: .88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    background: #edf1f6;
    border-radius: 999px;
    height: .55rem;
    overflow: hidden;
}

.bar-fill {
    background: #1b6ec2;
    height: 100%;
}

.bar-fill.alt {
    background: #667085;
}

.bar-fill.good {
    background: #208a5d;
}

.bar-fill.danger {
    background: #d92d20;
}

.attendance-track {
    display: flex;
}

.pie-view {
    align-items: center;
    display: grid;
    gap: 1rem;
    grid-template-columns: 150px minmax(0, 1fr);
}

.pie-chart {
    aspect-ratio: 1;
    border: 1px solid #d8e0ea;
    border-radius: 50%;
    box-shadow: inset 0 0 0 18px #fff;
    width: 150px;
}

.pie-legend {
    display: grid;
    gap: .45rem;
}

.pie-legend div {
    align-items: center;
    display: grid;
    gap: .45rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.pie-legend span:nth-child(2) {
    color: #344054;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-dot {
    border-radius: 999px;
    display: inline-block;
    height: .65rem;
    width: .65rem;
}

.alert {
    border-radius: 8px;
}

@media (max-width: 1200px) {
    .metric-grid {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .two-column,
    .workspace {
        grid-template-columns: 1fr;
    }

    .pie-view {
        grid-template-columns: 1fr;
    }
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgM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ODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
