/* Pretendard Variable — self-hosted so the shell renders identically on an
   air-gapped IIS box. Source: github.com/orioncactus/pretendard v1.3.9,
   SIL Open Font License 1.1 (full text in fonts/pretendard/OFL.txt).
   Copyright (c) 2021 Kil Hyung-jin, with Reserved Font Name Pretendard. */
@font-face {
    font-family: "Pretendard Variable";
    font-weight: 45 920;
    font-style: normal;
    font-display: swap;
    src: url("fonts/pretendard/PretendardVariable.woff2") format("woff2");
}

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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}

:root {
    --M1T-emerald: #7B4BAE;
    --M1T-emerald-dark: #6D3E9C;
    --M1T-emerald-light: #B08FD6;
    --M1T-amber: #FFC400;
    --M1T-amber-dark: #9A6B00;
    --M1T-amber-light: #FFD75E;
    --M1T-slate-900: #4E2A73;
    --M1T-slate-800: #3A2358;
    --M1T-slate-700: #334155;
    --M1T-slate-500: #64748B;
    --M1T-slate-300: #E2E8F0;
    --M1T-slate-100: #F1F5F9;
    --M1T-slate-50:  #F8FAFC;

    --M1T-bg:           #F5F7FA;
    --M1T-bg-elevated:  #ffffff;
    --M1T-surface:      #ffffff;
    --M1T-surface-soft: #F8FAFC;
    --M1T-border:       #E2E8F0;
    --M1T-border-soft:  rgba(30, 41, 59, 0.06);
    --M1T-text:         #1E293B;
    --M1T-text-strong:  #0F172A;
    --M1T-muted:        #64748B;
    --M1T-link:         #7B4BAE;
    --M1T-success:      #22C55E;
    --M1T-warning:      #FFC400;
    --M1T-error:        #E02B20;
    --M1T-shadow-card:  0 4px 24px rgba(46, 24, 64, 0.07);
    --M1T-shadow-cta:   0 4px 14px rgba(109, 62, 156, 0.25);
    --M1T-bg-shell:     var(--M1T-bg);
    --M1T-row-hover:    rgba(109, 62, 156, 0.06);
}

html,
body {
    min-height: 100%;
    background: var(--M1T-bg);
    color: var(--M1T-text);
    color-scheme: light;
}

body {
    font-family: "Pretendard Variable", Pretendard, "Noto Sans Mongolian", system-ui, sans-serif;
}

body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body::-webkit-scrollbar-track {
    background: var(--M1T-bg-elevated);
}

body::-webkit-scrollbar-thumb {
    background: var(--M1T-border);
    border-radius: 999px;
}

body::-webkit-scrollbar-thumb:hover {
    background: var(--M1T-muted);
}

.M1T-layout-shell,
.mud-layout.M1T-layout-shell {
    min-height: 100vh;
    background: var(--M1T-bg-shell) !important;
    color: var(--M1T-text);
}

.M1T-appbar {
    background: var(--M1T-surface) !important;
    border-bottom: 1px solid var(--M1T-border);
}

.M1T-brand-title {
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ─── System brand (logo + product title in the AppBar) ───────────────── */
/*
 * The brand is wrapped in <a> so the user can click it to go home.
 * Reset the link styling so it doesn't pick up MudBlazor's default
 * underline/colour on hover. Keep the logo + text on a single baseline
 * with `align-items: center` instead of `vertical-align` so that the
 * MudText element (which renders as a div) doesn't shift the icon.
 */
.M1T-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
    color: inherit !important;
    line-height: 1;
}
.M1T-brand:hover .M1T-brand-title { opacity: .85; }

.M1T-brand-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12);
    object-fit: contain;
    flex: 0 0 auto;
}
.M1T-brand-logo--lg {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

/* On printed report pages the brand sits on a white surface — the white
   ring would disappear, so we swap it for a subtle grey outline instead. */
.M1T-doc-logo,
.M1T-report-brand-logo {
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .08);
}

/* ─── Reports / dashboard header brand block ──────────────────────────── */
.M1T-report-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.M1T-report-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
}
.M1T-report-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.M1T-report-brand-text small {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .55;
}

/* ─── CompanySwitcher (header pill + searchable popup) ─────────────────── */

/* Trigger pill — sits beside the brand title in the AppBar. The outlined
   button gets a slate background so it reads as a chip, not as just another
   icon button. */
.M1T-company-switcher-trigger {
    border-color: rgba(255, 255, 255, 0.18) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    text-transform: none !important;
    font-weight: 500 !important;
    border-radius: 999px !important;
    padding: 4px 12px !important;
    min-height: 36px !important;
    max-width: 320px;
}

.M1T-company-switcher-trigger:hover {
    background: rgba(255, 255, 255, 0.10) !important;
    border-color: rgba(255, 255, 255, 0.30) !important;
}

.M1T-company-switcher-label {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 4px;
}

/* Popup — fixed width so it doesn't jitter while typing in the search box. */
.M1T-company-switcher-popup {
    width: 360px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
}

.M1T-company-switcher-header {
    padding: 12px 12px 8px 12px;
    background: var(--M1T-surface-soft);
}

.M1T-company-switcher-stats {
    margin-top: 6px;
    padding: 0 4px;
}

.M1T-company-switcher-list {
    max-height: 50vh;
    overflow-y: auto;
}

.M1T-company-switcher-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--M1T-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.M1T-company-switcher-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.M1T-company-switcher-row-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.M1T-company-switcher-code {
    font-weight: 600;
    line-height: 1.2;
}

/* Subtle highlight for the currently-active company so it's findable even
   when the list is long. The mud-list focus ring still works on top. */
.M1T-company-switcher-item-active {
    background: linear-gradient(90deg, rgba(8, 145, 178, 0.08), transparent) !important;
}

.M1T-drawer,
.mud-drawer.M1T-drawer {
    border-right: 1px solid var(--M1T-border);
    background: var(--M1T-bg-elevated) !important;
    color: var(--M1T-text);
}

.M1T-drawer .mud-drawer-content {
    min-height: 100%;
    background: var(--M1T-bg-elevated) !important;
    color: var(--M1T-text);
}

.M1T-main-content,
.mud-main-content.M1T-main-content {
    min-height: calc(100vh - 64px);
    background: transparent !important;
    color: var(--M1T-text);
}

.mud-main-content {
    background: transparent !important;
}

.M1T-main-content > .mud-container {
    background: transparent !important;
    color: inherit;
}

.mud-paper {
    border: 1px solid var(--M1T-border);
    box-shadow: var(--M1T-shadow-card) !important;
    background-color: var(--M1T-surface) !important;
    color: var(--M1T-text);
}

.M1T-nav .mud-nav-link.active-item,
.M1T-nav .mud-nav-link.mud-nav-link-active,
.M1T-nav .active {
    background: rgba(8, 145, 178, 0.1) !important;
    color: var(--M1T-emerald-dark) !important;
    font-weight: 700;
    border-left: 3px solid var(--M1T-emerald);
}

.M1T-nav .mud-nav-link:hover {
    background: var(--M1T-row-hover) !important;
}

.mud-table {
    background: transparent;
}

.mud-table-head .mud-table-cell {
    color: var(--M1T-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mud-table-body .mud-table-cell {
    font-size: 0.92rem;
}

.mud-table-row:hover {
    background: var(--M1T-row-hover) !important;
}

.mud-button-root.mud-button-filled.mud-button-filled-primary {
    background: var(--M1T-emerald);
    box-shadow: none;
}

.mud-button-root.mud-button-filled.mud-button-filled-primary:hover {
    background: var(--M1T-emerald-dark);
    filter: none;
}

.mud-button-root.mud-button-filled.mud-button-filled-secondary {
    background: linear-gradient(180deg, var(--M1T-amber) 0%, var(--M1T-amber-dark) 100%);
    color: #1e293b !important;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.25);
}

.mud-chip {
    font-weight: 700;
}

.mud-input > input.mud-input-root,
div.mud-input-slot.mud-input-root,
.mud-input-control > .mud-input-control-input-container {
    font-size: 0.95rem;
}

.mud-input-outlined-border {
    border-color: var(--M1T-border) !important;
}

.mud-input-control.mud-input-required .mud-input-label::after {
    color: var(--M1T-amber-dark);
}

.mud-alert {
    border-radius: 12px;
}

.badge-outline-success,
.badge-outline-danger,
.badge-outline-warning,
.badge-outline-primary {
    background: transparent;
    border-width: 1px;
    border-style: solid;
    border-radius: 999px;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
}

.badge-outline-success {
    border-color: var(--M1T-success);
    color: var(--M1T-success);
}

.badge-outline-danger {
    border-color: var(--M1T-error);
    color: var(--M1T-error);
}

.badge-outline-warning {
    border-color: var(--M1T-warning);
    color: var(--M1T-warning);
}

.badge-outline-primary {
    border-color: var(--M1T-emerald);
    color: var(--M1T-emerald-dark);
}

#blazor-error-ui {
    background: #fff7d6;
    border-top: 3px solid var(--M1T-amber);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.12);
}

/* ────────────────────────────────────────────────────────────────────────
   Print documents (/print/*) — Korean trade-document layout used for
   주문서 / 거래명세서 / 발주서 / 출고증 etc. Visual structure mirrors
   BusinessDocumentPdfRenderer so screen and PDF look the same.
   ──────────────────────────────────────────────────────────────────────── */

.M1T-print-shell {
    background: #fff;
    color: #111;
    padding: 24px 32px;
    font-family: "Malgun Gothic", "Noto Sans CJK KR", "NanumGothic", Calibri, Arial, sans-serif;
    font-size: 12px;
    min-height: 100vh;
}

.M1T-print-toolbar {
    text-align: right;
    margin-bottom: 16px;
}

.M1T-print-toolbar button {
    background: #1976d2;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
}

.M1T-doc h1 {
    font-size: 28px;
    text-align: center;
    margin: 0 0 4px 0;
    letter-spacing: 2px;
}

.M1T-doc-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 12px;
    font-size: 11px;
}

.M1T-doc-title {
    border-bottom: 1px solid #bbb;
    padding-bottom: 8px;
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: 120px 1fr 120px;
    align-items: center;
    gap: 8px;
}

.M1T-doc-title-text {
    grid-column: 2;
}

.M1T-doc-logo {
    grid-column: 1;
    max-height: 56px;
    max-width: 120px;
    object-fit: contain;
    justify-self: start;
}

.M1T-doc-signatures .signature-canvas {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.M1T-doc-seal {
    max-height: 36px;
    max-width: 72px;
    object-fit: contain;
    opacity: 0.85;
}

.M1T-doc-footer {
    margin-top: 18px;
    padding-top: 6px;
    border-top: 1px dashed #ccc;
    text-align: center;
    font-size: 10px;
}

.M1T-doc--watermarked {
    position: relative;
    overflow: hidden;
}

.M1T-doc-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 96pt;
    font-weight: 700;
    color: rgba(244, 67, 54, 0.16);
    pointer-events: none;
    user-select: none;
    z-index: 0;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.M1T-doc--watermarked > *:not(.M1T-doc-watermark) {
    position: relative;
    z-index: 1;
}

@media print {
    .M1T-doc-watermark {
        color: rgba(244, 67, 54, 0.20);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

.M1T-doc-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}

.M1T-doc-meta > div {
    border: 1px solid #ddd;
    padding: 6px 8px;
}

.M1T-doc-meta label,
.M1T-doc-totals label,
.M1T-doc-note label,
.M1T-doc-signatures label,
.M1T-doc-parties .label {
    display: block;
    font-size: 10px;
    color: #777;
    margin-bottom: 2px;
}

.M1T-doc-meta span {
    font-weight: 700;
    font-size: 13px;
}

.M1T-doc-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.M1T-doc-parties .party {
    border: 1px solid #ddd;
    padding: 10px;
}

.M1T-doc-parties .party-body .name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.M1T-doc-parties .party-body div {
    font-size: 11px;
    line-height: 1.4;
}

.M1T-doc-parties .party-body label {
    display: inline;
    color: #777;
    font-size: 10px;
}

.M1T-doc-lines {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.M1T-doc-lines th {
    background: #f3f3f3;
    border: 1px solid #ccc;
    padding: 6px;
    font-size: 11px;
    text-align: left;
}

.M1T-doc-lines th.num,
.M1T-doc-lines td.num {
    text-align: right;
}

.M1T-doc-lines th.center,
.M1T-doc-lines td.center {
    text-align: center;
}

.M1T-doc-lines td {
    border: 1px solid #ddd;
    padding: 5px 6px;
    font-size: 11px;
    vertical-align: top;
}

.M1T-doc-lines td .muted {
    font-size: 10px;
    color: #777;
}

.M1T-doc-totals {
    margin-left: auto;
    width: 320px;
    margin-bottom: 18px;
}

.M1T-doc-totals > div {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
}

.M1T-doc-totals > div.grand {
    border-top: 1px solid #999;
    padding-top: 6px;
    font-weight: 700;
    font-size: 13px;
}

.M1T-doc-note {
    background: #fafafa;
    border: 1px solid #eee;
    padding: 10px;
    margin-bottom: 18px;
    font-size: 11px;
}

.M1T-doc-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 32px;
}

.M1T-doc-signatures .line {
    height: 36px;
    border-bottom: 1px solid #999;
}

.M1T-doc-signatures .muted {
    color: #777;
    font-size: 10px;
    text-align: center;
    display: block;
    margin-top: 4px;
}

/* Print-only adjustments — hide the toolbar, drop chrome, force A4 portrait */
@media print {
    .M1T-print-toolbar { display: none; }
    .M1T-print-shell { padding: 0; min-height: auto; }
    @page { size: A4 portrait; margin: 12mm; }
}

/* ────────────────────────────────────────────────────────────────────────
   Tablet UI (/tablet/*) — operator-facing factory layout

   Baseline target: 10" tablet, 1280×800 (Chrome / Edge), touch-primary.
   Senior-friendly per AGENTS.md §5: ≥56 px hit targets, ≥1.4 rem body,
   max-3-step wizards, no dense data tables.

   These utility classes are consumed by Components/Tablet/* building
   blocks (BigButton, NumPadInput, PickCard, StepWizard) and the
   /tablet/* page set. Inline styles inside individual razor files
   should migrate to these classes as we audit each page.
   ──────────────────────────────────────────────────────────────────────── */

:root {
    /* Component-tier sizes — pick from these instead of hard-coding pixels */
    --M1T-tablet-touch-min: 56px;          /* WCAG-style minimum hit target */
    --M1T-tablet-button-height: 80px;      /* Standard primary action */
    --M1T-tablet-button-height-xl: 96px;   /* Grade picker, finish actions */
    --M1T-tablet-radius: 16px;
    --M1T-tablet-gap: 16px;
    --M1T-tablet-pad: 20px;
    --M1T-tablet-font-body: 1.15rem;       /* base body text */
    --M1T-tablet-font-button: 1.4rem;      /* primary buttons */
    --M1T-tablet-font-button-xl: 1.8rem;   /* grade letters */
    --M1T-tablet-font-h1: 2rem;
    --M1T-tablet-font-h2: 1.5rem;
}

/* ─── Layout shell ─── */

.M1T-tablet-shell {
    /* Drawer-less full-bleed layout. Top breadcrumb, optional bottom
       action bar, large body padding so finger taps don't hit chrome.
       Dark mode swaps the gradient + bg via the .mud-theme-dark block. */
    background:
        radial-gradient(1400px 480px at 60% -10%, rgba(8, 145, 178, 0.05), transparent 60%),
        var(--M1T-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: var(--M1T-tablet-font-body);
    color: var(--M1T-text);
}

.M1T-tablet-shell .mud-input > input.mud-input-root,
.M1T-tablet-shell div.mud-input-slot.mud-input-root {
    /* Bigger fields so on-screen keyboards don't crowd the layout */
    font-size: 1.25rem;
}

.M1T-tablet-appbar {
    background: var(--M1T-slate-900) !important;
    color: #fff;
    height: 64px;
}

.M1T-tablet-appbar .mud-icon-button {
    color: #fff;
}

.M1T-tablet-body {
    flex: 1 1 auto;
    padding: var(--M1T-tablet-pad);
    max-width: 1100px;        /* Optimised for 1280-px tablet width */
    width: 100%;
    margin: 0 auto;
}

.M1T-tablet-actionbar {
    /* Optional sticky footer — primary CTA(s) live here so the operator
       can find "Save / Confirm" by reaching, not scrolling. */
    background: var(--M1T-bg-elevated);
    border-top: 1px solid var(--M1T-border);
    padding: 12px 20px;
    display: flex;
    gap: var(--M1T-tablet-gap);
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    z-index: 5;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

/* ─── BigButton ─── */

.M1T-big-button {
    min-height: var(--M1T-tablet-button-height) !important;
    font-size: var(--M1T-tablet-font-button) !important;
    border-radius: var(--M1T-tablet-radius) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: 12px 24px !important;
    font-weight: 600;
}

.M1T-big-button.M1T-big-button--xl {
    min-height: var(--M1T-tablet-button-height-xl) !important;
    font-size: var(--M1T-tablet-font-button-xl) !important;
}

.M1T-big-button.M1T-big-button--block {
    width: 100%;
}

/* ─── NumPadInput ─── */

.M1T-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 360px;
}

.M1T-numpad-display {
    grid-column: 1 / -1;
    background: var(--M1T-surface-soft);
    border: 1px solid var(--M1T-border);
    border-radius: var(--M1T-tablet-radius);
    padding: 12px 16px;
    font-size: 2rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--M1T-text);
}

.M1T-numpad-display--invalid {
    border-color: var(--M1T-error);
    color: var(--M1T-error);
}

.M1T-numpad-key {
    min-height: var(--M1T-tablet-touch-min) !important;
    height: 64px !important;
    font-size: 1.6rem !important;
    border-radius: 12px !important;
    background: var(--M1T-surface) !important;
    border: 1px solid var(--M1T-border) !important;
    color: var(--M1T-text) !important;
    font-weight: 600 !important;
    text-transform: none !important;
}

.M1T-numpad-key:hover {
    background: var(--M1T-surface-soft) !important;
}

.M1T-numpad-key.M1T-numpad-key--accent {
    background: var(--M1T-amber) !important;
    color: var(--M1T-slate-900) !important;
    border-color: var(--M1T-amber-dark) !important;
}

.M1T-numpad-key.M1T-numpad-key--danger {
    background: var(--M1T-surface) !important;
    color: var(--M1T-error) !important;
    border-color: var(--M1T-error) !important;
}

/* ─── PickCard / PickList ─── */

.M1T-picklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--M1T-tablet-gap);
}

.M1T-pickcard {
    background: var(--M1T-surface);
    border: 2px solid var(--M1T-border);
    border-radius: var(--M1T-tablet-radius);
    padding: 16px 18px;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    text-align: left;
    transition: transform 80ms ease, border-color 120ms ease, box-shadow 120ms ease;
    width: 100%;
    font-family: inherit;
    color: var(--M1T-text);
}

.M1T-pickcard:hover {
    border-color: var(--M1T-emerald);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.10);
}

.M1T-pickcard:active {
    transform: scale(0.98);
}

.M1T-pickcard--selected {
    border-color: var(--M1T-emerald-dark);
    background: linear-gradient(180deg, rgba(8, 145, 178, 0.07), rgba(8, 145, 178, 0.02));
    box-shadow: 0 6px 18px rgba(8, 145, 178, 0.15);
}

.M1T-pickcard__title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.M1T-pickcard__subtitle {
    font-size: 0.95rem;
    color: var(--M1T-muted);
}

.M1T-pickcard__badge {
    align-self: flex-start;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--M1T-surface-soft);
    color: var(--M1T-text);
    border: 1px solid var(--M1T-border);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 4px;
}

/* ─── StepWizard ─── */

.M1T-stepwizard {
    background: var(--M1T-surface);
    border: 1px solid var(--M1T-border);
    border-radius: var(--M1T-tablet-radius);
    padding: 24px;
    box-shadow: var(--M1T-shadow-card);
    color: var(--M1T-text);
}

.M1T-stepwizard__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.M1T-stepwizard__title {
    font-size: var(--M1T-tablet-font-h2);
    font-weight: 700;
    color: var(--M1T-text);
}

.M1T-stepwizard__dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.M1T-stepwizard__dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--M1T-slate-300);
    transition: background 120ms ease, transform 120ms ease;
}

.M1T-stepwizard__dot--active {
    background: var(--M1T-emerald);
    transform: scale(1.25);
}

.M1T-stepwizard__dot--complete {
    background: var(--M1T-emerald-dark);
}

.M1T-stepwizard__body {
    min-height: 240px;
}

.M1T-stepwizard__footer {
    margin-top: 24px;
    display: flex;
    gap: var(--M1T-tablet-gap);
    justify-content: space-between;
}

/* ─── Tablet "no-go" hint when used on a desktop monitor ─── */

@media (min-width: 1500px) {
    .M1T-tablet-shell::after {
        content: "";   /* placeholder hook in case we want a notice */
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   Dark theme overrides
   ─────────────────────────────────────────────────────────────────────────
   MudBlazor 8 sets `mud-theme-dark` on <body> when IsDarkMode = true. We
   re-bind every theme-aware token from :root so each component CSS rule
   above (which already consumes these tokens) flips automatically.

   Design intent for dark:
     * Deep navy (slate-950) base + slate-800 surfaces — calm, not pure
       black, so eye fatigue is lower than tonal-grey alternatives.
     * Emerald primary stays the same hue but is bumped one shade lighter
       (#34d399) for AA contrast against slate-800.
     * Borders use rgba(255,255,255,0.08) instead of slate-200 so they
       hint at edges without "lifting" the surface visually.
     * Scrollbars + table hover get a green tint for continuity with the
       primary.

   Print routes (`/print/*`) stay forced-light via PrintLayout.razor so
   the screen view always matches the QuestPDF-rendered PDF.
   ───────────────────────────────────────────────────────────────────────── */
.mud-theme-dark,
body.mud-theme-dark,
.M1T-dark {
    color-scheme: dark;

    --M1T-bg:           #0C0C0E;
    --M1T-bg-elevated:  #18181B;
    --M1T-surface:      #18181B;
    --M1T-surface-soft: #27272A;
    --M1T-border:       rgba(255, 255, 255, 0.10);
    --M1T-border-soft:  rgba(255, 255, 255, 0.06);
    --M1T-text:         #FAFAFA;
    --M1T-text-strong:  #FFFFFF;
    --M1T-muted:        #A1A1AA;
    --M1T-link:         #22D3EE;
    --M1T-success:      #4ADE80;
    --M1T-warning:      #FB923C;
    --M1T-error:        #F87171;
    --M1T-shadow-card:  0 1px 2px rgba(0, 0, 0, 0.34);
    --M1T-shadow-cta:   0 4px 14px rgba(34, 211, 238, 0.2);
    --M1T-bg-shell:
        linear-gradient(180deg, rgba(8, 145, 178, 0.08) 0%, transparent 30%),
        var(--M1T-bg);
    --M1T-row-hover:    rgba(34, 211, 238, 0.08);
}

body.mud-theme-dark {
    background: var(--M1T-bg) !important;
    color: var(--M1T-text);
}

.M1T-layout-shell.M1T-dark,
.mud-layout.M1T-layout-shell.M1T-dark {
    background: var(--M1T-bg-shell) !important;
    color: var(--M1T-text);
}

body.mud-theme-dark .M1T-layout-shell,
body.mud-theme-dark .mud-layout.M1T-layout-shell,
.mud-theme-dark .M1T-layout-shell,
.mud-theme-dark.mud-layout.M1T-layout-shell,
.M1T-dark .M1T-layout-shell,
.M1T-dark.mud-layout.M1T-layout-shell {
    background: var(--M1T-bg-shell) !important;
    color: var(--M1T-text);
}

body.mud-theme-dark .M1T-main-content,
body.mud-theme-dark .mud-main-content,
.mud-theme-dark .M1T-main-content,
.mud-theme-dark .mud-main-content,
.M1T-dark .M1T-main-content,
.M1T-dark .mud-main-content {
    background: transparent !important;
    color: var(--M1T-text);
}

body.mud-theme-dark .M1T-main-content > .mud-container,
.mud-theme-dark .M1T-main-content > .mud-container,
.M1T-dark .M1T-main-content > .mud-container {
    background: transparent !important;
}

/* Appbar — pure slate-950 reads as a separate "chrome" plane in both
   modes; the dark version pairs nicely with the deep navy body. */
.mud-theme-dark .M1T-appbar,
.M1T-dark .M1T-appbar {
    background: #09090B !important;
    border-bottom: 2px solid var(--M1T-emerald);
}

/* Tablet appbar uses the same chrome treatment as desktop. */
.mud-theme-dark .M1T-tablet-appbar,
.M1T-dark .M1T-tablet-appbar {
    background: #0a0f0b !important;
}

/* Drawer — keep the slight elevation against the body so the nav is
   always identifiable, but on a dark surface that means "lighter than
   the background", not "darker". */
.mud-theme-dark .M1T-drawer,
body.mud-theme-dark .M1T-drawer,
.mud-theme-dark .mud-drawer.M1T-drawer,
body.mud-theme-dark .mud-drawer.M1T-drawer,
.M1T-dark .M1T-drawer,
.M1T-dark .mud-drawer.M1T-drawer {
    background: var(--M1T-bg-elevated) !important;
    border-right: 1px solid var(--M1T-border);
    color: var(--M1T-text);
}

.mud-theme-dark .M1T-drawer .mud-drawer-content,
body.mud-theme-dark .M1T-drawer .mud-drawer-content,
.M1T-dark .M1T-drawer .mud-drawer-content {
    background: var(--M1T-bg-elevated) !important;
    color: var(--M1T-text);
}

.mud-theme-dark .M1T-nav .mud-nav-link,
body.mud-theme-dark .M1T-nav .mud-nav-link,
.M1T-dark .M1T-nav .mud-nav-link {
    color: var(--M1T-text) !important;
}

/* Active nav-link — keep emerald accent visible on the dark drawer. */
.mud-theme-dark .M1T-nav .mud-nav-link.active-item,
.mud-theme-dark .M1T-nav .mud-nav-link.mud-nav-link-active,
.mud-theme-dark .M1T-nav .active,
.M1T-dark .M1T-nav .mud-nav-link.active-item,
.M1T-dark .M1T-nav .mud-nav-link.mud-nav-link-active,
.M1T-dark .M1T-nav .active {
    background: rgba(34, 211, 238, 0.12) !important;
    color: #67E8F9 !important;
}

/* MudPaper text colour follows the surface, not the body — without
   this, custom paper backgrounds keep the body's light text on a
   dark slab and we get "invisible" content for a frame. */
.mud-theme-dark .mud-paper,
body.mud-theme-dark .mud-paper,
.M1T-dark .mud-paper {
    background-color: var(--M1T-surface) !important;
    color: var(--M1T-text);
}

.M1T-dark .mud-table,
.M1T-dark .mud-table-container,
.M1T-dark .mud-table-root,
.M1T-dark .mud-table-head,
.M1T-dark .mud-table-body,
.M1T-dark .mud-table-foot {
    background: var(--M1T-surface) !important;
    color: var(--M1T-text) !important;
}

.M1T-dark .mud-table-row,
.M1T-dark .mud-table-cell {
    background: transparent !important;
    color: var(--M1T-text) !important;
    border-color: var(--M1T-border-soft) !important;
}

.M1T-dark .mud-table-striped .mud-table-body .mud-table-row:nth-child(odd),
.M1T-dark .mud-table-striped .mud-table-row:nth-child(odd) {
    background: rgba(230, 236, 223, 0.025) !important;
}

.M1T-dark .mud-table-hover .mud-table-body .mud-table-row:hover,
.M1T-dark .mud-table-row:hover {
    background: var(--M1T-row-hover) !important;
}

/* Table head was using uppercase muted text with a fixed colour — point
   it at the token so dark mode picks up #94a3b8 automatically. */
.mud-theme-dark .mud-table-head .mud-table-cell,
.M1T-dark .mud-table-head .mud-table-cell {
    color: var(--M1T-muted);
}

.M1T-dark .mud-input.mud-input-outlined {
    background: var(--M1T-surface-soft) !important;
    border-radius: 12px;
    color: var(--M1T-text);
}

.M1T-dark .mud-input > input.mud-input-root,
.M1T-dark div.mud-input-slot.mud-input-root,
.M1T-dark .mud-input-control > .mud-input-control-input-container {
    color: var(--M1T-text) !important;
}

.M1T-dark .mud-input-label,
.M1T-dark .mud-input-adornment,
.M1T-dark .mud-select-input {
    color: var(--M1T-muted) !important;
}

.M1T-dark .mud-button-root.mud-button-outlined {
    background: rgba(230, 236, 223, 0.03) !important;
    border-color: var(--M1T-border) !important;
    color: var(--M1T-text) !important;
}

.M1T-dark .mud-button-root.mud-button-outlined:disabled,
.M1T-dark .mud-button-root.mud-disabled {
    background: rgba(230, 236, 223, 0.025) !important;
    border-color: var(--M1T-border-soft) !important;
    color: rgba(230, 236, 223, 0.38) !important;
}

/* Tabs / chips / outline-buttons — pull a couple of stubborn light
   colours into the dark token system. MudBlazor handles most of this
   already via PaletteDark, but a few of our custom Mud overrides
   above use literal slate values that need help in dark. */
.mud-theme-dark .badge-outline-success { color: var(--M1T-success); border-color: var(--M1T-success); }
.mud-theme-dark .badge-outline-warning { color: var(--M1T-warning); border-color: var(--M1T-warning); }
.mud-theme-dark .badge-outline-danger  { color: var(--M1T-error);   border-color: var(--M1T-error); }
.mud-theme-dark .badge-outline-primary { color: #9cebb4;              border-color: var(--M1T-success); }

/* Header-area chips on the AppBar share the slate-950 chrome, so the
   "white-on-slate" overrides we applied for the company switcher pill
   stay correct. The pill itself uses rgba/white so no change needed. */

/* Error banner — the pale yellow bar made for the light theme is
   readable but visually loud on a dark UI; switch to a low-key
   semi-transparent amber. */
.mud-theme-dark #blazor-error-ui {
    background: rgba(245, 158, 11, 0.16);
    color: var(--M1T-text);
    border-top: 3px solid var(--M1T-warning);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.40);
}

/* Buttons — primary CTA uses a brighter emerald gradient on dark so the
   contrast against the deep navy is high enough for AA. */
.mud-theme-dark .mud-button-root.mud-button-filled.mud-button-filled-primary {
    background: var(--M1T-emerald);
    color: #fff !important;
    box-shadow: none;
}

/* Input outlines — blend with the dark surface instead of the bright
   slate-200 border that bled through. */
.mud-theme-dark .mud-input-outlined-border {
    border-color: var(--M1T-border) !important;
}

/* Scrollbar tweaks — match the surface tones in dark mode. */
body.mud-theme-dark::-webkit-scrollbar-track,
body.mud-theme-dark *::-webkit-scrollbar-track { background: var(--M1T-bg-elevated); }
body.mud-theme-dark::-webkit-scrollbar-thumb,
body.mud-theme-dark *::-webkit-scrollbar-thumb { background: rgba(230, 236, 223, 0.16); }
body.mud-theme-dark::-webkit-scrollbar-thumb:hover,
body.mud-theme-dark *::-webkit-scrollbar-thumb:hover { background: rgba(230, 236, 223, 0.26); }

/* Print layout always renders white-on-black ink regardless of toggle. */
.M1T-print-shell { color-scheme: light; }
