/* Trinity Dashboard — page styling. Component colours come from TrinityTheme.cs. */

:root {
    /* Brand colours from the Trinity Group logo (trinitytt.com) */
    --td-navy: #231F20;      /* logo charcoal */
    --td-navy-2: #1B60A9;    /* logo blue */
    --td-amber: #1B60A9;
    --td-amber-soft: #E6EFF8;
    --td-ink: #231F20;
    --td-ink-2: #56636F;
    --td-line: #DCE1E5;
    --td-bg: #F2F4F5;
    --td-surface: #FFFFFF;
    --td-ok: #2E7D4F;
    --td-display: "Raleway", "Helvetica Neue", Arial, sans-serif;
    --td-body: "Open Sans", "Helvetica Neue", Arial, sans-serif;
}

html, body {
    background: var(--td-bg);
    color: var(--td-ink);
    font-family: var(--td-body);
    font-size: 15px;
}

.mud-typography, .mud-button-label, .mud-nav-link, .mud-table, .mud-input, .mud-menu-item {
    font-family: var(--td-body);
}

a { color: var(--td-navy-2); }

:focus-visible {
    outline: 2px solid var(--td-amber);
    outline-offset: 2px;
}

/* ---------- Type ---------- */
.td-h1, .td-h2, .td-h3 {
    font-family: var(--td-display);
    color: var(--td-ink);
    margin: 0;
    letter-spacing: 0.005em;
}
.td-h1 { font-size: 2rem; font-weight: 700; line-height: 1.15; }
.td-h2 { font-size: 1.35rem; font-weight: 600; line-height: 1.25; margin-bottom: 12px; }
.td-h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.3; margin-bottom: 10px; }
.td-lede { color: var(--td-ink-2); font-size: 1.05rem; margin: 6px 0 0; max-width: 68ch; }
.td-muted { color: var(--td-ink-2); }
.td-small { font-size: 0.85rem; }
.td-pad { padding: 24px; }
.td-nowrap { white-space: nowrap; }
.td-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- App bar ---------- */
.td-appbar.mud-appbar {
    border-bottom: 3px solid var(--td-navy-2);
    box-shadow: 0 1px 0 var(--td-line);
}
.td-logo { height: 36px; width: auto; display: block; }
.td-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 8px;
    text-decoration: none;
    color: inherit;
}
.td-brand-mark {
    width: 22px;
    height: 22px;
    background:
        linear-gradient(var(--td-amber), var(--td-amber)) 0 0 / 100% 7px no-repeat,
        linear-gradient(var(--td-amber), var(--td-amber)) 50% 0 / 7px 100% no-repeat;
}
.td-brand-name {
    font-family: var(--td-display);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--td-ink-2);
    padding-left: 12px;
    border-left: 1px solid var(--td-line);
}
.td-env {
    margin-left: 14px;
    padding: 2px 8px;
    border: 1px solid rgba(27, 96, 169, 0.45);
    color: var(--td-navy-2);
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}
.td-account {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}
.td-account:hover { background: var(--td-amber-soft); }
.td-account-name { font-weight: 600; }
.td-avatar {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--td-navy-2);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 0.85rem;
    flex: none;
}
.td-avatar-lg { width: 40px; height: 40px; font-size: 0.95rem; }
.td-menu-head {
    display: flex;
    flex-direction: column;
    padding: 10px 16px 8px;
    min-width: 220px;
}
.td-menu-head span { color: var(--td-ink-2); font-size: 0.85rem; }

/* ---------- Navigation ---------- */
.td-drawer { border-right: 1px solid var(--td-line); }
.td-nav { padding: 12px 8px; }
.td-nav .mud-nav-link { border-radius: 6px; margin: 1px 0; }
.td-nav .mud-nav-link.active {
    background: var(--td-amber-soft);
    color: var(--td-navy);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--td-amber);
}
.td-nav-section {
    margin: 18px 12px 6px;
    color: var(--td-ink-2);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---------- Page ---------- */
.td-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 32px 48px;
}
.td-section { margin-top: 32px; }

.td-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--td-line);
}
.td-scope { display: flex; flex-direction: column; gap: 8px; }
.td-scope-label { color: var(--td-ink-2); font-size: 0.9rem; }
.td-scope-codes { display: flex; flex-wrap: wrap; gap: 6px; }

.td-code {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 4px;
    border: 1px solid var(--td-navy-2);
    border-radius: 4px;
    color: var(--td-navy-2);
    font-family: var(--td-display);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    background: var(--td-surface);
}

.td-pagehead {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}
.td-pagehead-icon.mud-icon-root {
    font-size: 2.2rem;
    color: var(--td-amber);
    margin-top: 2px;
}

/* Module directory */
.td-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1px;
    background: var(--td-line);
    border: 1px solid var(--td-line);
    border-radius: 8px;
    overflow: hidden;
}
.td-module {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 18px 18px 20px;
    background: var(--td-surface);
    color: var(--td-ink);
    text-decoration: none;
}
.td-module:hover { background: #FAFBFB; }
.td-module:hover .td-module-name { text-decoration: underline; text-decoration-color: var(--td-amber); text-underline-offset: 4px; }
.td-module-icon.mud-icon-root { color: var(--td-navy-2); font-size: 1.6rem; }
.td-module-text { display: flex; flex-direction: column; gap: 3px; }
.td-module-name { font-family: var(--td-display); font-weight: 600; font-size: 1.15rem; }
.td-module-summary { color: var(--td-ink-2); font-size: 0.92rem; line-height: 1.35; }
.td-phase {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--td-ink-2);
    white-space: nowrap;
    padding-top: 3px;
}

/* Panels */
.td-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}
.td-panel {
    background: var(--td-surface);
    border: 1px solid var(--td-line);
    border-radius: 8px;
    padding: 20px 22px;
}
.td-panel-flush { padding: 0; overflow-x: auto; }

.td-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 18px;
    margin: 0;
}
.td-facts dt { color: var(--td-ink-2); }
.td-facts dd { margin: 0; }

.td-checklist { list-style: none; margin: 0; padding: 0; }
.td-checklist li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid #EEF1F3;
}
.td-checklist li:last-child { border-bottom: 0; }
.td-checklist .is-done .mud-icon-root { color: var(--td-ok); }
.td-checklist .is-next .mud-icon-root { color: var(--td-ink-2); }
.td-checklist .is-next span:nth-child(2) { color: var(--td-ink-2); }
.td-checklist-state { font-size: 0.8rem; color: var(--td-ink-2); }

.td-empty {
    background: var(--td-surface);
    border: 1px dashed #C5CDD4;
    border-radius: 8px;
    padding: 24px 26px;
    max-width: 760px;
}
.td-empty p { margin: 0 0 8px; }
.td-featurelist { margin: 8px 0 0; padding-left: 20px; }
.td-featurelist li { margin: 4px 0; }

/* Tables */
.td-table.mud-table { box-shadow: none; background: transparent; }
.td-table th {
    font-weight: 600 !important;
    color: var(--td-ink-2) !important;
    background: #F7F8F9;
}
.td-status { font-size: 0.85rem; font-weight: 600; }
.td-status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: 1px;
    background: currentColor;
}
.td-status.is-ok { color: var(--td-ok); }
.td-status.is-muted { color: var(--td-ink-2); }
.td-changes {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.8rem;
    max-width: 520px;
    margin: 6px 0 0;
}
details summary { cursor: pointer; color: var(--td-navy-2); }

/* ---------- Sign-in ---------- */
.td-login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 5fr) 7fr;
}
.td-login-brand {
    background:
        linear-gradient(180deg, rgba(20, 30, 45, 0.55) 0%, rgba(20, 24, 30, 0.88) 70%),
        url("brand/liftboat.jpg") center / cover no-repeat,
        var(--td-navy);
    color: #E8EDF1;
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 4px solid var(--td-navy-2);
}
.td-login-logo {
    align-self: flex-start;
    background: #FFFFFF;
    border-radius: 8px;
    padding: 12px 16px;
}
.td-login-logo img { height: 48px; width: auto; display: block; }
.td-login-title {
    border: 0;
    padding: 0;
    color: #FFFFFF;
    font-size: 1.9rem;
    font-weight: 700;
}
.td-login-intro { font-size: 1.05rem; line-height: 1.55; max-width: 40ch; margin: 0; color: #E3E8EC; }
.td-login-companies { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-direction: column; gap: 10px; }
.td-login-companies li { color: #E3E8EC; display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 10px; }
.td-login-companies .td-code {
    background: transparent;
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-right: 0;
}
.td-login-panel {
    padding: 56px 48px;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.td-userlist {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--td-line);
    border-radius: 8px;
    background: var(--td-surface);
    overflow: hidden;
}
.td-userrow {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--td-ink);
    border-bottom: 1px solid var(--td-line);
}
.td-userrow:last-child { border-bottom: 0; }
.td-userrow:hover { background: var(--td-amber-soft); }
.td-userrow-text { display: flex; flex-direction: column; gap: 1px; }
.td-userrow-text span { color: var(--td-ink-2); font-size: 0.9rem; }
.td-userrow-text .td-userrow-scope { color: var(--td-navy-2); font-weight: 600; }

/* ---------- HR module ---------- */
.td-grow { flex: 1 1 auto; min-width: 0; }
.td-prewrap { white-space: pre-line; }
.td-wrap { max-width: 320px; }
.td-bad { color: #B3261E; }
.td-past { opacity: 0.55; }
.td-pagehead { align-items: center; flex-wrap: wrap; }
.td-pagehead .td-lede { margin-top: 4px; }
.td-avatar-xl { width: 56px; height: 56px; font-size: 1.25rem; }

.td-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
}
.td-toolbar .mud-select, .td-toolbar .mud-input-control { flex: 0 0 auto; width: auto; min-width: 170px; margin: 0; }
.td-toolbar .td-search { min-width: 240px; }
.td-month { margin: 0 4px; min-width: 190px; text-align: center; }

.td-quick { display: flex; flex-wrap: wrap; gap: 4px; margin: -8px 0 18px; }

/* Stat tiles */
.td-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}
.td-stats-tight { margin-bottom: 18px; }
.td-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    background: var(--td-surface);
    border: 1px solid var(--td-line);
    border-left: 4px solid var(--td-navy-2);
    border-radius: 8px;
    color: var(--td-ink);
    text-decoration: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
button.td-stat { width: 100%; }
.td-stat:hover { background: #FAFBFB; }
.td-stat.is-warn { border-left-color: #B87700; }
.td-stat.is-bad { border-left-color: #B3261E; }
.td-stat-value { font-family: var(--td-display); font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.td-stat-value small { font-size: 1.1rem; color: var(--td-ink-2); font-weight: 600; }
.td-stat-label { color: var(--td-ink-2); font-size: 0.88rem; line-height: 1.3; }

/* Lists in panels */
.td-list { list-style: none; margin: 0; padding: 0; }
.td-list li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    padding: 8px 0;
    border-bottom: 1px solid #EEF1F3;
}
.td-list li:last-child { border-bottom: 0; }

/* Status tags */
.td-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
.td-tag.is-ok { background: #E7F3EC; color: #1F6340; border-color: #C3E0CE; }
.td-tag.is-warn { background: #FFF4DD; color: #8A5A00; border-color: #F1D9A3; }
.td-tag.is-bad { background: #FBE9E7; color: #9C2119; border-color: #F2C4BF; }
.td-tag.is-info { background: var(--td-amber-soft); color: var(--td-navy-2); border-color: #C6D9EE; }
.td-tag.is-muted { background: #EEF1F3; color: var(--td-ink-2); border-color: #DCE1E5; }

/* Tables */
.td-rowlink { cursor: pointer; }
.td-rowlink a { text-decoration: none; color: inherit; }
.td-rowlink:hover a { color: var(--td-navy-2); text-decoration: underline; }
.td-rowactions { text-align: right; }
.td-table td { vertical-align: top; }

/* Tabs */
.td-tabs { background: var(--td-surface); border: 1px solid var(--td-line); border-radius: 8px; overflow: hidden; }
.td-tabpanel { overflow-x: auto; }

/* Leave balance */
.td-balance { display: grid; gap: 18px; }
.td-balance-value { font-family: var(--td-display); font-size: 1.7rem; font-weight: 700; margin-right: 6px; }
.td-balance-label { color: var(--td-ink-2); }

/* Forms */
.td-form { display: flex; flex-direction: column; gap: 18px; max-width: 980px; }
.td-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 4px 16px;
    align-items: start;
}
.td-fields-1 { grid-template-columns: 1fr; gap: 10px; }
.td-fields-add { grid-template-columns: 180px 1fr auto; align-items: center; margin-bottom: 12px; }
.td-span2 { grid-column: span 2; }
.td-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.td-actions-panel .td-actions { margin-top: 0; }
.td-callout {
    padding: 10px 12px;
    background: var(--td-amber-soft);
    border-radius: 6px;
}
.td-readonly { display: flex; flex-direction: column; padding: 6px 0; }
.td-readonly span { color: var(--td-ink-2); font-size: 0.8rem; }
.td-scrollbox { max-height: 420px; overflow-y: auto; border: 1px solid var(--td-line); border-radius: 6px; }

/* Approval history */
.td-history { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--td-line); }
.td-history li { position: relative; padding: 4px 0 10px 10px; }
.td-history li::before {
    content: "";
    position: absolute;
    left: -21px;
    top: 9px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--td-navy-2);
    border: 2px solid var(--td-surface);
}
.td-history-action { font-weight: 600; margin-right: 6px; }
.td-history-comment { margin-top: 2px; color: var(--td-ink); font-style: italic; }

/* Review stages */
.td-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    counter-reset: step;
}
.td-steps li {
    counter-increment: step;
    padding: 10px 12px;
    background: var(--td-surface);
    border: 1px solid var(--td-line);
    border-radius: 6px;
    font-weight: 600;
}
.td-steps li::before { content: counter(step) ". "; color: var(--td-navy-2); }
.td-steps li span { display: block; font-weight: 400; color: var(--td-ink-2); font-size: 0.85rem; }

/* Ratings */
.td-score { float: right; font-family: var(--td-body); font-size: 0.95rem; color: var(--td-navy-2); }
.td-ratings { display: flex; flex-direction: column; }
.td-rating-row {
    display: grid;
    grid-template-columns: minmax(180px, 260px) auto 1fr;
    align-items: center;
    gap: 14px;
    padding: 6px 0;
    border-bottom: 1px solid #EEF1F3;
}
.td-rating-row:last-child { border-bottom: 0; }

/* Calendar */
.td-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.td-calendar-wrap { overflow-x: auto; border: 1px solid var(--td-line); border-radius: 8px; background: var(--td-line); }
.td-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 1px;
    min-width: 860px;
}
.td-cal-head { background: #F7F8F9; padding: 8px 10px; font-weight: 600; color: var(--td-ink-2); font-size: 0.85rem; }
.td-cal-day {
    background: var(--td-surface);
    min-height: 112px;
    padding: 6px 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.td-cal-day.is-weekend { background: #FAFBFB; }
.td-cal-day.is-outside { background: #F4F6F7; }
.td-cal-day.is-outside .td-cal-date { color: #A3ADB6; }
.td-cal-day.is-today .td-cal-date { background: var(--td-navy-2); color: #FFFFFF; }
.td-cal-date {
    align-self: flex-start;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
}
.td-chip {
    display: block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    border: 0;
    border-left: 3px solid transparent;
    text-align: left;
    font-family: inherit;
    cursor: default;
}
a.td-chip, button.td-chip { cursor: pointer; }
.td-legend .td-chip { display: inline-block; }
.td-chip.is-holiday { background: #FBE9E7; color: #8C1D16; border-left-color: #B3261E; font-weight: 600; }
.td-chip.is-leave { background: var(--td-amber-soft); color: #154C86; border-left-color: var(--td-navy-2); }
.td-chip.is-sick { background: #EDE7F6; color: #4A2C82; border-left-color: #6A43B5; }
.td-chip.is-pending { background: repeating-linear-gradient(135deg, #FFF8E8, #FFF8E8 6px, #FFF1D2 6px, #FFF1D2 12px); color: #7A5200; border-left-color: #B87700; }
.td-chip.is-cert { background: #FFF4DD; color: #7A5200; border-left-color: #E09A00; }
.td-chip.is-event { background: #E4F1EF; color: #1F5052; border-left-color: var(--td-ok); }

/* Certificate matrix */
.td-matrix { border-collapse: collapse; font-size: 0.85rem; min-width: 100%; }
.td-matrix th, .td-matrix td { border: 1px solid #E4E8EB; padding: 6px 8px; }
.td-matrix thead th { background: #F7F8F9; color: var(--td-ink-2); font-weight: 600; vertical-align: bottom; max-width: 90px; white-space: normal; }
.td-matrix tbody th { text-align: left; font-weight: 600; white-space: nowrap; background: var(--td-surface); }
.td-matrix td { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-matrix td.is-ok { background: #E7F3EC; color: #1F6340; }
.td-matrix td.is-warn { background: #FFF4DD; color: #8A5A00; font-weight: 600; }
.td-matrix td.is-bad { background: #FBE9E7; color: #9C2119; font-weight: 600; }
.td-matrix td.is-muted { background: #EEF1F3; }

/* Time sheet grid */
.td-timesheet { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.td-timesheet th, .td-timesheet td { padding: 6px 8px; border-bottom: 1px solid #E4E8EB; text-align: left; vertical-align: middle; }
.td-timesheet thead th { background: #F7F8F9; color: var(--td-ink-2); font-weight: 600; white-space: nowrap; }
.td-timesheet tfoot th { background: #F7F8F9; }
.td-timesheet .td-num { text-align: right; }
.td-timesheet tr.is-weekend td { background: #FAFBFB; }
.td-timesheet tr.is-holiday td { background: #FDF3F2; }
.td-input {
    font: inherit;
    width: 100%;
    min-width: 90px;
    padding: 5px 7px;
    border: 1px solid #C9D1D8;
    border-radius: 4px;
    background: var(--td-surface);
    color: var(--td-ink);
}
.td-input:focus { outline: 2px solid var(--td-navy-2); outline-offset: -1px; }
.td-input-num { width: 76px; min-width: 0; text-align: right; }

/* Letters */
.td-letter-preview {
    background: #FAFBFB;
    border: 1px solid var(--td-line);
    border-radius: 6px;
    padding: 14px 18px;
    font-size: 0.92rem;
}
.td-printbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 210mm;
    margin: 20px auto 12px;
    padding: 0 16px;
}
.td-letter {
    background: #FFFFFF;
    max-width: 210mm;
    min-height: 297mm;
    margin: 0 auto 40px;
    padding: 22mm 22mm 26mm;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    font-size: 11.5pt;
    line-height: 1.6;
    color: #1A1A1A;
}
.td-letter p { margin: 0 0 12px; }
.td-letterhead {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 14px;
    margin-bottom: 26px;
    border-bottom: 3px solid var(--td-navy-2);
}
.td-letterhead img { height: 58px; width: auto; }
.td-letterhead div { display: flex; flex-direction: column; text-align: right; font-size: 9.5pt; line-height: 1.45; color: #444; }
.td-letterhead strong { font-family: var(--td-display); font-size: 12pt; color: var(--td-ink); }
.td-letter-meta { display: flex; justify-content: space-between; margin-bottom: 20px; }
.td-letter-to { margin-bottom: 20px !important; }
.td-letter-subject { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.td-signature { display: flex; flex-direction: column; margin-top: 44px; }
.td-signature-line { width: 230px; border-bottom: 1px solid #333; margin-bottom: 6px; }

.td-printonly { display: none; }
.td-print-head { gap: 16px; align-items: center; margin-bottom: 14px; }
.td-print-head img { height: 40px; }
.td-print-head div { display: flex; flex-direction: column; }
.td-signoff { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 50px; }
.td-signoff span { border-top: 1px solid #333; padding-top: 4px; font-size: 0.85rem; }

@media print {
    @page { size: A4; margin: 12mm; }
    html, body { background: #FFFFFF !important; font-size: 12px; }
    .mud-appbar, .mud-drawer, .td-noprint, .td-printbar, .td-quick, .mud-snackbar-provider { display: none !important; }
    .mud-main-content { padding: 0 !important; margin: 0 !important; }
    .td-page { max-width: none; padding: 0; }
    .td-printonly { display: block; }
    .td-print-head { display: flex; }
    .td-panel { border: 0; padding: 0; }
    .td-letter { box-shadow: none; margin: 0; padding: 0; min-height: 0; max-width: none; }
    .td-review .mud-input-outlined-border { border-color: #CCC !important; }
    a { color: inherit; text-decoration: none; }
}

/* ---------- Sign-in and accounts ---------- */
.td-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 16px;
    border: 1px solid #C9D1D8;
    border-radius: 6px;
    background: var(--td-surface);
    color: var(--td-ink);
    font-weight: 600;
    text-decoration: none;
}
.td-google:hover { background: var(--td-amber-soft); }
.td-or { display: flex; align-items: center; gap: 12px; color: var(--td-ink-2); font-size: 0.85rem; }
.td-or::before, .td-or::after { content: ""; flex: 1; border-top: 1px solid var(--td-line); }
.td-login-form { display: flex; flex-direction: column; gap: 14px; }
.td-login-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 0.9rem; }
.td-input-lg { padding: 10px 12px; font-size: 1rem; }
.td-submit {
    font: inherit;
    font-weight: 600;
    padding: 11px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--td-navy-2);
    color: #FFFFFF;
    cursor: pointer;
}
.td-submit:hover { background: #154C86; }
.td-narrow { max-width: 520px; }
.td-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 12px; }
.td-temp-password { font-size: 1.15rem; letter-spacing: 0.06em; padding: 2px 8px; background: #FFFFFF; border-radius: 4px; }

/* ---------- Small screens ---------- */
@media (max-width: 960px) {
    .td-account-name { display: none; }
}
@media (max-width: 760px) {
    .td-brand-name { display: none; }
    .td-logo { height: 30px; }
    .td-page { padding: 20px 16px 40px; }
    .td-h1 { font-size: 1.6rem; }
    .td-env { display: none; }
    .td-login { grid-template-columns: 1fr; }
    .td-login-brand { padding: 32px 20px; border-right: 0; border-bottom: 4px solid var(--td-navy-2); }
    .td-login-companies { margin-top: 0; }
    .td-login-panel { padding: 28px 16px 40px; }
    .td-module-grid { grid-template-columns: 1fr; }
    .td-columns { grid-template-columns: 1fr; }
    .td-steps { grid-template-columns: 1fr 1fr; }
    .td-span2 { grid-column: auto; }
    .td-fields-add { grid-template-columns: 1fr; }
    .td-rating-row { grid-template-columns: 1fr; gap: 2px; }
    .td-toolbar .td-search, .td-toolbar .mud-select { min-width: 0; width: 100%; }
    .td-letter { padding: 20px 16px; min-height: 0; }
    .td-letterhead { flex-direction: column; }
    .td-letterhead div { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
