/* The practitioner dashboard and markup statement (Kirsten's Dashboard design): outlined cards on a white page, small
   spaced capitals for section labels, a dark card for markup figures. Colours come from customer.css's variables. */

.tb-customer-main:has(.tb-dash) {
    background: #fff;
}

.tb-dash {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px 48px 56px;
}

.tb-dash-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.tb-dash-heading > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tb-dash-title {
    margin: 0;
    color: var(--tb-ink);
    font-size: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

/* Blazor's router focuses the page h1 after navigation (FocusOnNavigate); the design shows no focus ring there. */
.tb-dash-title:focus {
    outline: none;
}

/* Legacy's base styles underline a heading's span. */
.tb-dash-title span {
    font-weight: 300;
    color: var(--tb-teal-ink);
    text-decoration: none;
}

.tb-dash-sub {
    font-size: 12.5px;
    color: var(--tb-ink-faint);
}

.tb-dash-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 24px;
    border: 0;
    border-radius: 8px;
    background: var(--tb-teal-fill);
    color: var(--tb-teal-fill-text) !important;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.tb-dash-button:hover {
    transform: var(--tb-lift);
}

.tb-dash-button:disabled {
    opacity: 0.6;
    cursor: default;
}

.tb-dash-label {
    font-size: var(--tb-eyebrow-size);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tb-eyebrow-tracking);
    color: var(--tb-ink-faint);
}

/* ---------- At a glance ---------- */

.tb-dash-glance {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    background: linear-gradient(180deg, #FFFFFF 0%, var(--tb-teal-wash) 100%);
    border: 1px solid var(--tb-teal-tint-border);
    border-radius: 8px;
}

.tb-dash-metric {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 22px 24px;
}

.tb-dash-metric + .tb-dash-metric {
    border-left: 1px solid var(--tb-teal-tint-border);
}

.tb-dash-metric-value {
    font-size: 42px;
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1;
}

.tb-dash-metric-note {
    font-size: 12px;
    line-height: 1.45;
    color: var(--tb-ink-faint);
}

.tb-dash-metric-delta {
    min-height: 22px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--tb-ink-faint);
    font-size: 12px;
    font-weight: 600;
}

.tb-dash-delta-icon {
    width: 22px;
    height: 22px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.tb-dash-up .tb-dash-delta-icon {
    background: var(--tb-teal-tint);
}

.tb-dash-down .tb-dash-delta-icon {
    background: #FBECEC;
}

.tb-dash-up {
    color: var(--tb-teal-ink);
}

.tb-dash-down {
    color: #B84545;
}

/* ---------- Lists ---------- */

.tb-dash-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--tb-line);
    border-radius: 8px;
}

.tb-dash-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 14px;
}

.tb-dash-count {
    min-width: 20px;
    height: 20px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--tb-teal-tint);
    color: var(--tb-teal-ink);
    font-size: 11px;
    font-weight: 700;
}

.tb-dash-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) 100px 160px 100px;
    gap: 12px;
    align-items: center;
    min-height: 50px;
    padding: 11px 20px;
    border-top: 1px solid var(--tb-line-soft);
    font-size: 12.5px;
}

.tb-dash-row-head {
    min-height: 0;
    padding: 9px 20px;
    font-size: var(--tb-eyebrow-size);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--tb-ink-faint);
}

.tb-dash-row > span,
.tb-dash-blend {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tb-ink-muted);
}

/* block: legacy's styles make a button a flex box, which centres the name and stops the ellipsis. */
.tb-dash-blend {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    color: var(--tb-ink);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.tb-dash-blend:hover {
    color: var(--tb-teal-ink);
    text-decoration: underline;
}

.tb-dash-row > .tb-dash-ago {
    justify-self: start;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--tb-line-soft);
    color: var(--tb-ink-muted);
    font-size: 10.5px;
    font-weight: 600;
}

/* The design's filled button, smaller than the page's. */
.tb-dash-row .tb-pill {
    justify-self: end;
    height: 28px;
    padding: 0 14px;
    background: var(--tb-teal-fill);
    border-color: var(--tb-teal-fill);
    border-radius: 8px;
    color: var(--tb-teal-fill-text) !important;
    font-size: 10.5px;
    font-weight: 700;
}

.tb-dash-row .tb-pill:hover {
    transform: var(--tb-lift);
}

.tb-dash-empty {
    padding: 20px;
    border-top: 1px solid var(--tb-line-soft);
    font-size: 12.5px;
    color: var(--tb-ink-faint);
}

.tb-dash-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 44px;
    padding: 4px 20px;
    border-top: 1px solid var(--tb-line-soft);
    font-size: 12px;
    color: var(--tb-ink-faint);
}

.tb-dash-link {
    color: var(--tb-teal-ink) !important;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}

.tb-dash-link:hover {
    text-decoration: underline;
}

.tb-dash-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tb-dash-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid var(--tb-line);
    border-radius: 8px;
    color: var(--tb-ink) !important;
    text-decoration: none;
    transition: border-color 300ms ease-out;
}

.tb-dash-link-card:hover {
    border-color: var(--tb-teal-ui);
}

.tb-dash-link-card strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.tb-dash-link-card small {
    font-size: 12.5px;
    color: var(--tb-ink-faint);
}

.tb-dash-arrow {
    flex: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--tb-teal-tint);
    color: var(--tb-teal-ink);
}

/* ---------- Dark card: markup (shown once commission figures exist) ---------- */

.tb-dash-dark {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 48px;
    align-items: end;
    padding: 28px 32px;
    background: var(--tb-gradient-dark);
    border-radius: 8px;
    color: #fff;
}

.tb-dash-dark > div {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.tb-dash-dark .tb-dash-label {
    color: var(--tb-teal-ui);
}

.tb-dash-dark .tb-dash-label-soft {
    color: rgba(255, 255, 255, 0.65);
}

.tb-dash-amount {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.tb-dash-amount strong {
    font-size: 40px;
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #fff;
}

.tb-dash-soft {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.65);
}

.tb-dash-bar {
    height: 10px;
    display: flex;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.tb-dash-bar span {
    background: var(--tb-teal-ui);
    border-radius: 999px;
}

.tb-dash-statement {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tb-dash-statement select {
    flex: 1 1 240px;
    min-width: 0;
    height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
}

.tb-dash-statement option {
    background: #fff;
    color: var(--tb-ink);
}

.tb-dash-ghost {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff !important;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.tb-dash-ghost:hover {
    border-color: rgba(255, 255, 255, 0.6);
}

/* ---------- Updates ---------- */

.tb-dash-updates {
    padding: 18px 20px 6px;
}

.tb-dash-update {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 0;
    border-top: 1px solid var(--tb-line-soft);
    font-size: 13px;
    line-height: 1.45;
}

.tb-dash-updates > .tb-dash-label {
    margin-bottom: 6px;
}

.tb-dash-update a {
    color: inherit;
}

.tb-dash-update time {
    font-size: var(--tb-eyebrow-size);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--tb-teal-ink);
}

/* ---------- Statement preview ---------- */

.tb-dash-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    color: var(--tb-teal-ink) !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.tb-dash-back:hover {
    text-decoration: underline;
}

.tb-sheet {
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-width: 0;
    padding: 40px 44px;
    background: #fff;
    border: 1px solid var(--tb-line);
    border-radius: 8px;
}

.tb-sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.tb-sheet-head img {
    display: block;
    width: auto;
    height: 36px;
}

.tb-sheet-head div,
.tb-sheet-facts div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tb-sheet-month {
    font-size: 18px;
    font-weight: 600;
}

.tb-sheet-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 24px;
    padding: 18px 0;
    border-top: 1px solid var(--tb-line-soft);
    border-bottom: 1px solid var(--tb-line-soft);
    font-size: 13px;
}

.tb-sheet-facts strong {
    font-weight: 600;
}

.tb-sheet-facts small {
    font-size: 12px;
    color: var(--tb-ink-faint);
}

.tb-sheet-scroll {
    min-width: 0;
    overflow-x: auto;
}

.tb-sheet-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.tb-sheet-table th {
    padding: 0 12px 10px 0;
    border-bottom: 1px solid var(--tb-line-strong);
    font-size: var(--tb-eyebrow-size);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    line-height: 1.4;
    color: var(--tb-ink-faint);
    text-align: left;
    vertical-align: bottom;
}

.tb-sheet-table td {
    padding: 11px 12px 11px 0;
    border-bottom: 1px solid var(--tb-line-soft);
    white-space: nowrap;
}

.tb-sheet-table th:last-child,
.tb-sheet-table td:last-child {
    padding-right: 0;
}

.tb-sheet-table .tb-sheet-amount {
    text-align: right;
}

.tb-sheet-table .tb-sheet-blend {
    font-weight: 600;
    white-space: normal;
}

.tb-sheet-table td.tb-sheet-markup {
    font-weight: 600;
}

.tb-sheet-cancelled td {
    color: var(--tb-ink-faint);
}

.tb-sheet-cancelled .tb-sheet-struck {
    text-decoration: line-through;
}

.tb-sheet-badge {
    margin-left: 8px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--tb-line-soft);
    color: var(--tb-ink-muted);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
}

.tb-sheet-sale {
    display: block;
    margin-top: 2px;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--tb-ink-faint);
}

.tb-sheet-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding-top: 16px;
    font-size: 13px;
    font-weight: 700;
}

.tb-sheet-total span:last-child {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.tb-sheet-note {
    font-size: 10px;
    line-height: 1.5;
    color: var(--tb-ink-faint);
}

@media (max-width: 991.98px) {
    .tb-dash {
        padding: 20px 16px 40px;
    }

    .tb-dash-title {
        font-size: 28px;
    }

    .tb-dash-glance,
    .tb-dash-links,
    .tb-dash-dark,
    .tb-sheet-facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .tb-dash-metric + .tb-dash-metric {
        border-top: 1px solid var(--tb-teal-tint-border);
        border-left: 0;
    }

    /* A row becomes the blend name on its own line, then who, when and the action. */
    .tb-dash-row {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 12px;
        padding: 14px 16px;
    }

    .tb-dash-row-head {
        display: none;
    }

    .tb-dash-row > .tb-dash-blend {
        order: -1;
        flex: 1 0 100%;
    }

    .tb-dash-row .tb-pill {
        margin-left: auto;
    }

    .tb-sheet {
        padding: 24px 18px;
    }
}
