/* =====================================================================
   TMA Projects ERP — workspace stylesheet (single source of truth)
   Sections: 1 tokens · 2 base/layout chrome · 3 Bootstrap overrides ·
             4 components (page-header, kpi, panel, field, status, empty,
             help, table, bar-list, chart) · 5 responsive/print
   Design rules: sharp corners everywhere, navy/gold/steel are brand chrome,
   data series come from --series-1..6, status colours only mean status.
   See docs/UI-GUIDE.md.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
.tma-workspace {
    /* brand chrome */
    --navy: #08152f;
    --navy-2: #17345d;
    --gold: #efbd55;
    --gold-2: #e3ac39;
    --steel: #76a4d2;
    --steel-2: #335d88;
    --red: #b3212b;
    /* surfaces */
    --bg: #f3f5f9;
    --surface: #ffffff;
    --surface-2: #fafbfd;
    --surface-3: #f6f8fb;
    --border: #e0e7f0;
    --border-2: #dfe6ef;
    /* text */
    --ink: #08152f;
    --ink-2: #26364b;
    --ink-muted: #64748b;
    --ink-faint: #a9b6c6;
    /* status (meaning only, never decoration) */
    --status-good: #236b51;      --status-good-bg: #edf7f2;   --status-good-line: #d9ecdf;
    --status-warn: #815a18;      --status-warn-bg: #fff6e3;   --status-warn-line: #f3e5c3;
    --status-serious: #a5490f;   --status-serious-bg: #fff1e8; --status-serious-line: #f6d9c4;
    --status-critical: #a93036;  --status-critical-bg: #fff0ef; --status-critical-line: #f5dedf;
    --status-info: #285c8a;      --status-info-bg: #edf3fa;   --status-info-line: #dce7f3;
    --status-neutral: #5d6c80;   --status-neutral-bg: #eff2f6; --status-neutral-line: #e0e6ed;
    /* chart series — fixed order, colour-blind-safe */
    --series-1: #2a78d6;
    --series-2: #eb6834;
    --series-3: #1baf7a;
    --series-4: #eda100;
    --series-5: #e87ba4;
    --series-6: #4a3aa7;
    --grid-line: #e8edf4;
    /* spacing scale */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;
    /* type scale */
    --fs-eyebrow: 10px; --fs-xs: 11px; --fs-sm: 12px; --fs-base: 13px; --fs-md: 14px; --fs-lg: 15px;
    --fs-h1: clamp(24px, 2.4vw, 34px); --fs-kpi: clamp(17px, 1.45vw, 26px);
    --track: .12em;
    --shadow-card: 0 3px 14px #17345d04;
    /* Bootstrap bridge */
    --bs-primary: #17345d;
    --bs-primary-rgb: 23, 52, 93;
    --bs-link-color: #285c8a;
    --bs-link-hover-color: #08152f;
    --bs-border-color: #e1e7ef;
    --bs-body-color: #26364b;
    /* legacy aliases still referenced by module views */
    --k9-navy: var(--navy); --k9-navy-2: var(--navy-2); --k9-gold: var(--gold);
    --k9-red: var(--red); --k9-steel: var(--steel); --k9-bg: var(--bg);
}

/* ---------- 2. Base + layout chrome (moved from layouts/app.blade.php) ---------- */
* { border-radius: 0 !important; }
body {
    font-family: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    background: var(--k9-bg, #f3f5f9);
    min-height: 100vh;
}
html { scrollbar-width: thin; scrollbar-color: #b9c2d0 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #b9c2d0; }
::-webkit-scrollbar-thumb:hover { background: #8d99ab; }
.k9-sidebar { background: #08152f; color: #fff; width: 240px; min-height: 100vh; position: fixed; top: 0; left: 0; bottom: 0; z-index: 1030; display: flex; flex-direction: column; transition: transform .2s ease; }
.k9-sidebar .brand { padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.k9-nav { flex: 1; overflow-y: auto; padding: 12px 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
.k9-nav::-webkit-scrollbar { width: 5px; }
.k9-nav::-webkit-scrollbar-track { background: transparent; }
.k9-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); }
.k9-nav::-webkit-scrollbar-thumb:hover { background: #efbd55; }
.k9-nav .nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.4); padding: 14px 18px 6px; }
.k9-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: rgba(255,255,255,.78); text-decoration: none; font-size: 14px; font-weight: 500; border-left: 3px solid transparent; }
.k9-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.k9-nav a.active { color: #fff; background: rgba(239,189,85,.14); border-left-color: #efbd55; }
.k9-nav a .bi { font-size: 15px; width: 18px; text-align: center; color: #efbd55; }
.k9-sidebar .user-box { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.k9-main { margin-left: 240px; padding: 24px; min-height: 100vh; }
.page-title { font-size: 22px; font-weight: 800; color: #08152f; margin: 0; letter-spacing: -.01em; }
.page-sub { font-size: 13px; color: #6b7280; margin: 2px 0 0; }
.k9-card { border: 1px solid #e3e8f0; box-shadow: 0 1px 2px rgba(14,31,61,.05); }
.k9-card .card-header { background: #fff; border-bottom: 1px solid #e9edf3; font-weight: 700; color: #08152f; }
.btn-k9 { background: #efbd55; color: #08152f; font-weight: 700; border: 1px solid #efbd55; }
.btn-k9:hover { background: #e6ad00; border-color: #e6ad00; color: #08152f; }
.btn-outline-k9 { border: 1px solid #08152f; color: #08152f; font-weight: 600; }
.btn-outline-k9:hover { background: #08152f; color: #fff; }
.btn-navy { background: #08152f; color: #fff; font-weight: 600; border: 1px solid #08152f; }
.btn-navy:hover { background: #17345d; color: #fff; }
.table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; border-bottom-width: 1px; font-weight: 700; }
.table td { font-size: 14px; }
a { color: #1f4396; }
.kpi-tile { border: 1px solid #e3e8f0; background: #fff; padding: 18px; height: 100%; }
.kpi-tile .kpi-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6b7280; }
.kpi-tile .kpi-value { font-size: 28px; font-weight: 800; color: #08152f; line-height: 1.15; }
.kpi-tile .kpi-note { font-size: 12.5px; color: #6b7280; }
.kpi-tile.kpi-navy { background: #08152f; border-color: #08152f; }
.kpi-tile.kpi-navy .kpi-label { color: rgba(255,255,255,.6); }
.kpi-tile.kpi-navy .kpi-value { color: #fff; }
.kpi-tile.kpi-navy .kpi-note { color: #efbd55; }
.form-label { font-weight: 600; font-size: 13.5px; color: #08152f; }
.form-control:focus, .form-select:focus { border-color: #efbd55; box-shadow: 0 0 0 .2rem rgba(239,189,85,.2); }
.k9-topbar { display: none; }
@media (max-width: 991.98px) {
    .k9-sidebar { transform: translateX(-100%); }
    .k9-sidebar.open { transform: translateX(0); }
    .k9-main { margin-left: 0; padding: 16px; }
    .k9-topbar { display: flex; align-items: center; justify-content: space-between; background: #08152f; padding: 10px 16px; margin: -16px -16px 16px; position: sticky; top: 0; z-index: 1020; }
}
@media print {
    .k9-sidebar, .k9-topbar, .no-print { display: none !important; }
    .k9-main { margin: 0; padding: 0; }
    body { background: #fff; }
}

/* ---------- 3. Workspace overrides of Bootstrap defaults ---------- */
.tma-workspace { color: var(--ink-2); background: var(--bg); font-size: 14px; -webkit-font-smoothing: antialiased; }
.tma-workspace .k9-main { padding: 24px 30px; }
.workspace-context { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1px solid #dfe6ef; }
.workspace-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 11px; }
.workspace-breadcrumb a { color: #64748b; text-decoration: none; }
.workspace-breadcrumb [aria-current] { color: #17345d; font-weight: 650; }
.workspace-breadcrumb > span:not([aria-current]) { color: #a9b6c6; }
.workspace-date { color: #64748b; font-size: 11px; white-space: nowrap; }
.tma-workspace .k9-sidebar { background: linear-gradient(165deg, #08152f, #112745); border-right: 1px solid #233953; }
.tma-workspace .k9-sidebar .brand { padding: 22px 18px; background: #ffffff03; }
.tma-workspace .k9-nav { padding: 14px 10px; }
.tma-workspace .k9-nav .nav-label { padding: 22px 12px 9px; color: #94a9c4; font-size: 9px; letter-spacing: .15em; }
.tma-workspace .k9-nav a { padding: 10px 12px; margin-bottom: 3px; font-size: 12px; gap: 12px; color: #c5d2e3; transition: background-color .15s, color .15s; }
.tma-workspace .k9-nav a .bi { color: #90accd; }
.tma-workspace .k9-nav a.active { background: #efbd5517; color: #ffe0a2; border-left-color: #efbd55; }
.tma-workspace .k9-nav a.active .bi { color: #efbd55; }
.tma-workspace .k9-nav a:hover { background: #ffffff09; color: #fff; }
.tma-workspace .k9-sidebar .user-box { padding: 18px; background: #06102666; }
.tma-workspace .page-title { font-size: clamp(24px, 2.1vw, 30px); font-weight: 750; letter-spacing: -.035em; line-height: 1.25; }
.tma-workspace .page-sub { color: #697c93; font-size: 12px; margin-top: 7px; line-height: 1.6; }
.tma-workspace .k9-card { border: 1px solid #e0e7f0; box-shadow: 0 3px 14px #17345d04; background: #fff; }
.tma-workspace .k9-card .card-header { background: #fff; padding: 17px 20px; font-size: 14px; font-weight: 650; border-bottom: 1px solid #e7ecf3; position: relative; }
.tma-workspace .k9-card .card-header::before { content: ''; display: block; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; background: #efbd55; }
.tma-workspace .k9-card .card-body { padding: 22px; }
.tma-workspace .k9-card .card-footer { padding: 16px 22px; background: #fafbfd; border-color: #e7ecf3; }
.tma-workspace .kpi-tile { padding: 22px; border-color: #e0e7f0; border-top: 3px solid #76a4d2; }
.tma-workspace .kpi-label { font-size: 10px; letter-spacing: .1em; color: #687b91; }
.tma-workspace .kpi-value { margin: 8px 0 5px; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.tma-workspace .kpi-note { font-size: 11px; }
.tma-workspace .kpi-navy { background: linear-gradient(110deg, #08152f, #17345d); border-top-color: #efbd55; }
.tma-workspace .table { --bs-table-bg: transparent; --bs-table-hover-bg: #f5f8fc; --bs-table-hover-color: #17345d; --bs-table-border-color: #e8edf4; color: #304158; }
.tma-workspace .table thead th { background: #f6f8fb; color: #657991; padding: 13px 16px; font-size: 10px; letter-spacing: .09em; font-weight: 700; white-space: nowrap; border-bottom: 1px solid #dfe6ef; }
.tma-workspace .table td { padding: 15px 16px; font-size: 12px; line-height: 1.65; vertical-align: middle; }
.tma-workspace .table-sm td { padding: 11px 14px; }
.tma-workspace .table td.text-end { font-variant-numeric: tabular-nums; }
.tma-workspace .table td a:not(.btn) { color: #285c8a; text-decoration: none; }
.tma-workspace .table td a:not(.btn):hover { color: #08152f; text-decoration: underline; }
.tma-workspace .table td small, .tma-workspace .table td .small { font-size: 10.5px; color: #728299; }
.tma-workspace .table td[colspan].text-center { background: #fafbfd; font-size: 13px; padding-top: 38px !important; padding-bottom: 38px !important; }
.tma-workspace .table-responsive { scrollbar-width: thin; }
.tma-workspace .badge { font-weight: 600; font-size: 10px; padding: 6px 9px; letter-spacing: .01em; border: 1px solid transparent; }
.tma-workspace .badge.text-bg-primary, .tma-workspace .badge.bg-primary { background: #edf3fa !important; color: #285c8a !important; border-color: #dce7f3; }
.tma-workspace .badge.text-bg-success, .tma-workspace .badge.bg-success { background: #edf7f2 !important; color: #236b51 !important; border-color: #d9ecdf; }
.tma-workspace .badge.text-bg-danger, .tma-workspace .badge.bg-danger { background: #fff0ef !important; color: #a93036 !important; border-color: #f5dedf; }
.tma-workspace .badge.text-bg-warning, .tma-workspace .badge.bg-warning { background: #fff6e3 !important; color: #815a18 !important; border-color: #f3e5c3; }
.tma-workspace .badge.text-bg-info, .tma-workspace .badge.bg-info { background: #ecf5f8 !important; color: #286379 !important; border-color: #d6eaf0; }
.tma-workspace .badge.text-bg-secondary, .tma-workspace .badge.bg-secondary { background: #eff2f6 !important; color: #5d6c80 !important; border-color: #e0e6ed; }
.tma-workspace .btn { font-size: 12px; padding: 10px 15px; font-weight: 650; transition: background-color .15s, border-color .15s; }
.tma-workspace .btn-sm { padding: 6px 10px; font-size: 11px; }
.tma-workspace .btn-k9 { background: #efbd55; border-color: #efbd55; color: #08152f; box-shadow: 0 2px 3px #9761190d; }
.tma-workspace .btn-k9:hover { background: #e3ac39; border-color: #e3ac39; }
.tma-workspace .btn-outline-k9 { background: #fff; border-color: #cad5e2; color: #17345d; }
.tma-workspace .btn-outline-k9:hover { background: #edf3fa; border-color: #76a4d2; }
.tma-workspace .btn-navy { background: #17345d; border-color: #17345d; }
.tma-workspace .btn:focus-visible, .tma-workspace a:focus-visible { outline: 3px solid #76a4d2; outline-offset: 3px; }
.tma-workspace .form-label { color: #3d526b; font-size: 12px; margin-bottom: 7px; font-weight: 600; }
.tma-workspace .form-control, .tma-workspace .form-select { color: #263b55; font-size: 12px; min-height: 40px; border: 1px solid #d4deea; background-color: #fcfdff; padding: 9px 12px; }
.tma-workspace .form-select { padding-right: 34px; }
.tma-workspace .form-control-sm, .tma-workspace .form-select-sm { min-height: 33px; padding-top: 6px; padding-bottom: 6px; font-size: 11px; }
.tma-workspace .form-control::placeholder { color: #8190a3; }
.tma-workspace .form-control:focus, .tma-workspace .form-select:focus { background-color: white; border-color: #76a4d2; box-shadow: 0 0 0 3px #76a4d21a; }
.tma-workspace .form-control:disabled, .tma-workspace .form-select:disabled { background: #edf1f6; color: #738196; }
.tma-workspace .form-check-input:checked { background-color: #17345d; border-color: #17345d; }
.tma-workspace .form-text { color: #718298; font-size: 11px; }
.tma-workspace form.row.mb-3:not([method="POST"]):not([method="post"]) { background: #f6f8fb; padding: 12px; margin: 0 0 22px !important; border: 1px solid #e6ecf3; }
.tma-workspace .progress { background: #e9eef5; }
.tma-workspace .progress-bar { background: #527da5; }
.tma-workspace .nav-tabs { border-color: #dfe6ef; gap: 6px; }
.tma-workspace .nav-tabs .nav-link { color: #63758c; font-size: 12px; padding: 12px 18px; border: 0; border-bottom: 2px solid transparent; }
.tma-workspace .nav-tabs .nav-link.active { color: #17345d; background: transparent; border-bottom-color: #efbd55; font-weight: 700; }
.tma-workspace .page-link { color: #335d88; font-size: 12px; border-color: #e0e7ef; padding: 8px 13px; }
.tma-workspace .active > .page-link { background: #17345d; border-color: #17345d; color: white; }
.tma-workspace .alert { border: 1px solid #dfe6ef; border-left-width: 3px; padding: 14px 18px; font-size: 12px; }
.tma-workspace .alert-success { background: #eff8f3; color: #236b51; border-left-color: #368565; }
.tma-workspace .alert-danger { background: #fff2f1; color: #a93036; border-left-color: #b3212b; }
.tma-workspace .alert-warning { background: #fff8e9; color: #815a18; border-left-color: #efbd55; }
.tma-workspace .modal-content { border: 1px solid #dfe6ef; box-shadow: 0 24px 70px #08152f26; }
.tma-workspace .modal-header, .tma-workspace .modal-footer { padding: 18px 24px; border-color: #e7ecf3; }
.tma-workspace .modal-body { padding: 24px; }
@media (prefers-reduced-motion: reduce) { .tma-workspace *, .tma-workspace *::before, .tma-workspace *::after { transition: none !important; } }
@media (max-width: 991.98px) { .tma-workspace .k9-main { padding: 16px; } .tma-workspace .k9-topbar { margin: -16px -16px 18px; } .workspace-context { margin-bottom: 20px; } }
@media (max-width: 575.98px) { .workspace-date { display: none; } .tma-workspace .k9-card .card-body { padding: 16px; } .tma-workspace .table td, .tma-workspace .table thead th { padding-left: 12px; padding-right: 12px; } .tma-workspace .k9-main > .d-flex > .d-flex.gap-2 { flex-wrap: wrap; } }
@media print { .tma-workspace { background: white; } .tma-workspace .k9-main { margin: 0; padding: 0; } .tma-workspace .k9-card { box-shadow: none; } }

/* ---------- 4. Components ---------- */
/* 4.1 x-page-header */
.tma-page-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: var(--sp-6); }
.tma-page-header > div { min-width: 0; }
.tma-eyebrow { font-size: var(--fs-eyebrow); font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-muted); }
.tma-page-header h1 { font-size: var(--fs-h1); letter-spacing: -.045em; font-weight: 750; margin: 6px 0; color: var(--ink); line-height: 1.15; }
.tma-page-header p { color: var(--ink-muted); font-size: var(--fs-sm); margin: 0; }
.tma-page-actions { display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.tma-page-actions .btn { padding: 10px 15px; font-size: var(--fs-sm); }

/* 4.2 x-kpi + grid */
.tma-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.tma-kpi { background: var(--surface); border: 1px solid var(--border); padding: var(--sp-5); min-width: 0; height: 100%; display: flex; flex-direction: column; }
.tma-kpi-label { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-muted); }
.tma-kpi-icon { display: grid; place-items: center; width: 30px; height: 30px; background: var(--status-info-bg); color: var(--steel-2); flex-shrink: 0; }
.tma-kpi-value { font-size: var(--fs-kpi); font-weight: 700; letter-spacing: -.04em; margin: 9px 0 5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow-wrap: anywhere; color: var(--ink); line-height: 1.15; }
@media (max-width: 1500px) { .tma-kpi-value { letter-spacing: -.05em; } }
.tma-kpi-value small { font-size: var(--fs-sm); letter-spacing: 0; font-weight: 500; color: var(--ink-muted); }
.tma-kpi-note { font-size: var(--fs-xs); color: var(--ink-muted); margin: 0; }
.tma-kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 650; margin-top: auto; padding-top: 6px; font-variant-numeric: tabular-nums; }
.tma-kpi-delta.up { color: var(--status-good); }
.tma-kpi-delta.down { color: var(--status-critical); }
.tma-kpi-delta.flat { color: var(--ink-muted); }
.tma-kpi--good { border-top: 3px solid var(--status-good); }
.tma-kpi--warn { border-top: 3px solid var(--gold); }
.tma-kpi--serious { border-top: 3px solid var(--red); }
.tma-kpi--good .tma-kpi-icon { background: var(--status-good-bg); color: var(--status-good); }
.tma-kpi--warn .tma-kpi-icon { background: var(--status-warn-bg); color: var(--status-warn); }
.tma-kpi--serious .tma-kpi-icon { background: var(--status-critical-bg); color: var(--status-critical); }
.tma-kpi--navy { background: linear-gradient(110deg, var(--navy), var(--navy-2)); border-color: var(--navy); }
.tma-kpi--navy .tma-kpi-label, .tma-kpi--navy .tma-kpi-note, .tma-kpi--navy .tma-kpi-value small { color: #b6c7df; }
.tma-kpi--navy .tma-kpi-value { color: #fff; }
.tma-kpi--navy .tma-kpi-icon { background: #ffffff18; color: var(--gold); }
.tma-kpi--navy .tma-kpi-delta.up { color: #7fd4ad; }
.tma-kpi--navy .tma-kpi-delta.down { color: #ffa7a7; }

/* 4.3 x-panel */
.tma-panel { background: var(--surface); border: 1px solid var(--border); min-width: 0; margin-bottom: var(--sp-5); display: flex; flex-direction: column; }
.tma-panel-head { padding: var(--sp-5) 22px; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); border-bottom: 1px solid var(--border); }
.tma-panel-head h2 { font-size: var(--fs-lg); font-weight: 700; margin: 0; letter-spacing: -.02em; color: var(--ink); }
.tma-panel-head p { color: var(--ink-muted); font-size: var(--fs-sm); margin: 4px 0 0; }
.tma-panel-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.tma-panel-actions a:not(.btn) { font-size: var(--fs-sm); font-weight: 600; color: var(--steel-2); white-space: nowrap; text-decoration: none; }
.tma-panel-body { padding: 22px; }
.tma-panel-body.flush { padding: 0; }
.tma-panel-foot { border-top: 1px solid var(--border); background: var(--surface-2); padding: 13px 22px; display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--ink-muted); }
.tma-panel > .tma-table-wrap, .tma-panel > .table-responsive { margin: 0; }
.tma-panel-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: var(--sp-5); align-items: start; }
.tma-panel-grid > .tma-panel { margin-bottom: 0; }
.tma-panel-grid--even { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.tma-stack { display: grid; gap: var(--sp-5); }
/* collapsible form panel */
.tma-panel details > summary { list-style: none; cursor: pointer; }
.tma-panel details > summary::-webkit-details-marker { display: none; }
.tma-panel details > summary .tma-panel-head { border-bottom: 0; }
.tma-panel details[open] > summary .tma-panel-head { border-bottom: 1px solid var(--border); }
.tma-panel details > summary .bi-chevron-down { transition: transform .15s; color: var(--ink-muted); }
.tma-panel details[open] > summary .bi-chevron-down { transform: rotate(180deg); }

/* 4.4 x-field */
.tma-field { margin-bottom: 0; min-width: 0; }
.tma-field .form-label { display: block; }
.tma-field .req { color: var(--red); margin-left: 2px; }
.tma-field .input-group-text { font-size: var(--fs-sm); background: var(--surface-3); border-color: #d4deea; color: var(--ink-muted); font-weight: 650; }
.tma-field .form-text { display: block; margin-top: 5px; }
.tma-field .invalid-feedback { font-size: var(--fs-xs); display: block; }
.tma-field .num { text-align: right; font-variant-numeric: tabular-nums; }
.tma-form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-3); }
.tma-form-grid > * { grid-column: span 12; }
.tma-form-grid .span-2 { grid-column: span 2; } .tma-form-grid .span-3 { grid-column: span 3; }
.tma-form-grid .span-4 { grid-column: span 4; } .tma-form-grid .span-6 { grid-column: span 6; }
.tma-form-grid .span-8 { grid-column: span 8; }
.tma-form-actions { grid-column: span 12; display: flex; gap: var(--sp-2); justify-content: flex-end; align-items: center; flex-wrap: wrap; padding-top: var(--sp-1); }
.tma-form-actions .form-text { margin-right: auto; }
.tma-form-section { grid-column: span 12; font-size: var(--fs-eyebrow); font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); padding-top: var(--sp-2); border-top: 1px solid var(--border); }
.tma-form-section:first-child { border-top: 0; padding-top: 0; }
.tma-inline-form { display: flex; gap: var(--sp-2); align-items: flex-end; flex-wrap: wrap; }
.tma-inline-form .tma-field { flex: 1 1 120px; }

/* 4.5 x-status */
.tma-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-eyebrow); font-weight: 650; padding: 5px 8px; white-space: nowrap; border: 1px solid transparent; letter-spacing: .01em; line-height: 1.2; }
.tma-status .bi { font-size: 10px; line-height: 1; }
.tma-status--good { background: var(--status-good-bg); color: var(--status-good); border-color: var(--status-good-line); }
.tma-status--warn { background: var(--status-warn-bg); color: var(--status-warn); border-color: var(--status-warn-line); }
.tma-status--serious { background: var(--status-serious-bg); color: var(--status-serious); border-color: var(--status-serious-line); }
.tma-status--critical { background: var(--status-critical-bg); color: var(--status-critical); border-color: var(--status-critical-line); }
.tma-status--info { background: var(--status-info-bg); color: var(--status-info); border-color: var(--status-info-line); }
.tma-status--neutral { background: var(--status-neutral-bg); color: var(--status-neutral); border-color: var(--status-neutral-line); }

/* 4.6 x-empty */
.tma-empty { text-align: center; padding: 44px 24px; color: var(--ink-muted); }
.tma-empty .bi { font-size: 28px; color: var(--ink-faint); display: block; margin-bottom: 10px; }
.tma-empty strong { display: block; color: var(--ink-2); font-size: var(--fs-md); margin-bottom: 4px; }
.tma-empty p { font-size: var(--fs-sm); margin: 0 auto; max-width: 420px; }
.tma-empty .btn { margin-top: 14px; }

/* 4.7 x-help */
.tma-help { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-3); border: 1px solid var(--border); border-left: 3px solid var(--steel); padding: 12px 16px; margin-bottom: var(--sp-5); font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.6; }
.tma-help .bi { color: var(--steel-2); font-size: 14px; flex-shrink: 0; margin-top: 2px; }
.tma-help strong { color: var(--ink); }
.tma-help a { color: var(--steel-2); }
.tma-help--warn { border-left-color: var(--gold); background: #fffaf0; }
.tma-help--warn .bi { color: var(--status-warn); }

/* 4.8 tables */
.tma-table-wrap { overflow: auto; max-width: 100%; scrollbar-width: thin; }
.tma-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0; }
.tma-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-3); color: #657991; padding: 12px 16px; font-size: var(--fs-eyebrow); letter-spacing: .09em; font-weight: 700; text-transform: uppercase; white-space: nowrap; border-bottom: 1px solid var(--border-2); text-align: left; }
.tma-table td { padding: 13px 16px; font-size: var(--fs-sm); line-height: 1.55; vertical-align: middle; border-top: 1px solid var(--grid-line); color: #304158; }
.tma-table tbody tr:first-child td { border-top: 0; }
.tma-table tbody tr:hover td { background: var(--surface-2); }
.tma-table td small, .tma-table .sub { display: block; font-size: 10.5px; color: #728299; }
.tma-table .num, .tma-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tma-table td.num { font-weight: 600; color: var(--ink); }
.tma-table .num.neg { color: var(--status-critical); }
.tma-table .num.pos { color: var(--status-good); }
.tma-table .primary { color: var(--ink); font-weight: 650; }
.tma-table .primary a { color: var(--ink); text-decoration: none; }
.tma-table .primary a:hover { color: var(--steel-2); text-decoration: underline; }
.tma-table .actions { text-align: right; white-space: nowrap; }
.tma-table tfoot td { background: var(--surface-2); font-weight: 650; border-top: 2px solid var(--border-2); }
.tma-table.compact td { padding: 9px 14px; }
.num { font-variant-numeric: tabular-nums; }

/* 4.9 x-bar-list */
.tma-bar-list { padding: 22px; }
.tma-bar-row { display: grid; grid-template-columns: minmax(110px, 150px) minmax(30px, 1fr) minmax(90px, 140px); align-items: center; gap: var(--sp-4); margin-bottom: 18px; font-size: var(--fs-sm); }
.tma-bar-row:last-child { margin-bottom: 0; }
.tma-bar-row .lbl { color: var(--ink-2); min-width: 0; }
.tma-bar-row .lbl small { display: block; color: var(--ink-muted); font-size: 10.5px; }
.tma-bar-track { height: 12px; background: #f0f4f8; overflow: hidden; }
.tma-bar-track > div { height: 100%; background: var(--series-1); }
.tma-bar-row strong { text-align: right; font-size: var(--fs-sm); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 4.10 x-chart */
.tma-chart { position: relative; width: 100%; }
.tma-chart canvas { width: 100% !important; }
.tma-chart-note { font-size: var(--fs-xs); color: var(--ink-muted); margin: 8px 0 0; }

/* ---------- 5. Responsive tweaks for components ---------- */
@media (max-width: 1200px) { .tma-panel-grid { grid-template-columns: 1fr; } .tma-bar-row { grid-template-columns: 100px minmax(25px, 1fr) 100px; gap: 10px; } }
@media (max-width: 767.98px) {
    .tma-page-header { align-items: flex-start; flex-direction: column; }
    .tma-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
    .tma-form-grid .span-2, .tma-form-grid .span-3, .tma-form-grid .span-4 { grid-column: span 6; }
    .tma-form-grid .span-6, .tma-form-grid .span-8 { grid-column: span 12; }
    .tma-panel-head, .tma-panel-body, .tma-bar-list { padding: 16px; }
    .tma-bar-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .tma-bar-row .tma-bar-track { grid-row: 2; grid-column: 1 / -1; }
    .tma-bar-row strong { grid-column: 2; grid-row: 1; }
}

/* finance pass — all classes namespaced tma-fin-* / fin-* to avoid collisions */
/* Filter bar: one GET form in a row above a table */
.tma-fin-filter { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tma-fin-filter .tma-field { flex: 1 1 140px; min-width: 120px; }
.tma-fin-filter .tma-field.grow { flex: 2 1 220px; }
.tma-fin-filter .tma-field.narrow { flex: 0 1 110px; }
.tma-fin-filter .btn { white-space: nowrap; }
/* Status pipeline stepper (expenses draft → pending → approved → paid) */
.tma-fin-stepper { display: flex; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.tma-fin-stepper li { flex: 1 1 0; min-width: 0; position: relative; padding: 0 var(--sp-3) 0 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); color: var(--ink-muted); }
.tma-fin-stepper li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 26px; height: 26px; font-size: var(--fs-xs); font-weight: 700; background: var(--surface-3); border: 1px solid var(--border-2); color: var(--ink-muted); z-index: 1; }
.tma-fin-stepper li::after { content: ""; position: absolute; top: 13px; left: 26px; right: var(--sp-3); height: 1px; background: var(--border-2); }
.tma-fin-stepper li:last-child::after { display: none; }
.tma-fin-stepper li.done::before { background: var(--status-good); border-color: var(--status-good); color: #fff; content: "\2713"; }
.tma-fin-stepper li.done::after { background: var(--status-good); }
.tma-fin-stepper li.current { color: var(--ink); font-weight: 650; }
.tma-fin-stepper li.current::before { background: var(--navy); border-color: var(--navy); color: var(--gold); }
.tma-fin-stepper li.halted::before { background: var(--status-critical-bg); border-color: var(--status-critical-line); color: var(--status-critical); content: "\00d7"; }
.tma-fin-stepper li small { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--ink-muted); }
/* Rows that are greyed out (reversed payments, cancelled) and highlighted (low stock) */
.tma-table tr.fin-muted td { color: var(--ink-faint); background: var(--surface-2); }
.tma-table tr.fin-muted td.num { color: var(--ink-faint); font-weight: 500; text-decoration: line-through; }
.tma-table tr.fin-low td { background: var(--status-warn-bg); }
.tma-table tr.fin-low td:first-child { box-shadow: inset 3px 0 0 var(--status-warn); }
/* Definition list for record details (invoice, contract show pages) */
.tma-fin-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-5); margin: 0; }
.tma-fin-dl > div { min-width: 0; }
.tma-fin-dl dt { font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 3px; }
.tma-fin-dl dd { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.tma-fin-dl dd.num { font-variant-numeric: tabular-nums; }
.tma-fin-dl dd.pre { white-space: pre-line; font-weight: 400; font-size: var(--fs-base); }
.tma-fin-dl .wide { grid-column: 1 / -1; }
/* Action list: why a button is not shown */
.tma-fin-note { font-size: var(--fs-xs); color: var(--ink-muted); display: inline-flex; align-items: center; gap: 5px; }
/* Link cards (import landing) */
.tma-fin-link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); }
.tma-fin-link-card { display: flex; gap: var(--sp-4); align-items: flex-start; background: var(--surface); border: 1px solid var(--border); padding: var(--sp-5); text-decoration: none; color: var(--ink); transition: border-color .12s; }
.tma-fin-link-card:hover { border-color: var(--steel); color: var(--ink); }
.tma-fin-link-card .bi { font-size: 22px; color: var(--gold-2, var(--gold)); background: var(--navy); width: 42px; height: 42px; display: grid; place-items: center; flex-shrink: 0; }
.tma-fin-link-card strong { display: block; font-size: var(--fs-md); margin-bottom: 3px; }
.tma-fin-link-card span { font-size: var(--fs-sm); color: var(--ink-muted); }
/* Per-row <details> whose summary is a button (issue PO, receive delivery) */
.tma-fin-details { text-align: left; display: inline-block; }
.tma-fin-details > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.tma-fin-details > summary::-webkit-details-marker { display: none; }
.tma-fin-details[open] > summary { margin-bottom: 4px; }
.tma-fin-details form { max-width: 100%; }
/* Inline status form: keep the label for screen readers only */
.tma-fin-hide-label .form-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tma-fin-status-form { flex-wrap: nowrap; }
.tma-fin-status-form .tma-field { flex: 0 0 150px; }
.tma-page-actions form { margin: 0; }
@media (max-width: 767.98px) {
    .tma-fin-stepper { flex-direction: column; gap: 12px; }
    .tma-fin-stepper li::after { display: none; }
    .tma-fin-filter { padding: 12px 16px; }
    .tma-fin-filter .tma-field, .tma-fin-filter .tma-field.grow, .tma-fin-filter .tma-field.narrow { flex: 1 1 45%; }
    .tma-fin-dl { grid-template-columns: 1fr 1fr; }
}

/* hr pass */
/* stepper: payroll two-person control */
.tma-ctrl-stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; counter-reset: step; }
.tma-ctrl-step { position: relative; padding: 18px 18px 18px 56px; border-right: 1px solid var(--border); min-width: 0; }
.tma-ctrl-step:last-child { border-right: 0; }
.tma-ctrl-step-num { position: absolute; left: 18px; top: 18px; width: 28px; height: 28px; display: grid; place-items: center; font-size: var(--fs-sm); font-weight: 750; border: 2px solid var(--border-2); color: var(--ink-muted); background: var(--surface); }
.tma-ctrl-step-title { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-muted); line-height: 1.3; }
.tma-ctrl-step-meta { font-size: var(--fs-xs); color: var(--ink-muted); margin-top: 4px; line-height: 1.45; overflow-wrap: anywhere; }
.tma-ctrl-step--done .tma-ctrl-step-num { background: var(--status-good); border-color: var(--status-good); color: #fff; }
.tma-ctrl-step--done .tma-ctrl-step-title { color: var(--status-good); }
.tma-ctrl-step--current { background: var(--status-warn-bg); }
.tma-ctrl-step--current .tma-ctrl-step-num { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.tma-ctrl-step--current .tma-ctrl-step-title { color: var(--ink); }
.tma-ctrl-step--blocked .tma-ctrl-step-num { border-style: dashed; }
@media (max-width: 991.98px) { .tma-ctrl-stepper { grid-template-columns: 1fr; } .tma-ctrl-step { border-right: 0; border-bottom: 1px solid var(--border); } .tma-ctrl-step:last-child { border-bottom: 0; } }
/* warning panel (rate deviations) */
.tma-panel--warn { border-color: var(--status-warn-line); border-left: 3px solid var(--gold); }
.tma-panel--warn > .tma-panel-head, .tma-panel--warn > details > summary .tma-panel-head { background: #fffaf0; }
.tma-panel--warn .tma-panel-head h2 { color: var(--status-warn); }
/* filter bar inside a flush panel, one row */
.tma-filter-bar { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tma-filter-bar .tma-field { flex: 1 1 160px; min-width: 140px; }
.tma-filter-bar .tma-field.grow { flex: 2 1 240px; }
.tma-filter-bar .btn { min-height: 40px; }
/* description list (record profile) */
.tma-dl { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px 14px; margin: 0; font-size: var(--fs-sm); }
.tma-dl dt { color: var(--ink-muted); font-weight: 600; }
.tma-dl dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
/* inline "why not" note next to disabled actions */
.tma-why { display: inline-block; font-size: var(--fs-xs); color: var(--ink-muted); max-width: 240px; white-space: normal; line-height: 1.4; text-align: right; }
/* role guide list on user forms */
.tma-role-list { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.tma-role-list li { display: grid; grid-template-columns: 140px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--grid-line); color: var(--ink-2); line-height: 1.5; }
.tma-role-list li:first-child { border-top: 0; padding-top: 0; }
.tma-role-list li strong { color: var(--ink); }
.tma-role-list li.is-current { background: var(--status-info-bg); margin: 0 -22px; padding: 9px 22px; border-top-color: transparent; }
/* per-row details form (record payment) */
.tma-row-form > summary { list-style: none; cursor: pointer; display: inline-block; }
.tma-row-form > summary::-webkit-details-marker { display: none; }
.tma-row-form .tma-inline-form { margin-top: 8px; justify-content: flex-end; }
.tma-row-form .tma-inline-form .tma-field { flex: 0 1 170px; text-align: left; }
/* simple checkbox row in tma-form-grid */
.tma-check { grid-column: span 12; display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.5; }
.tma-check input { margin-top: 3px; flex-shrink: 0; }
/* print letterhead (payslip / attendance) */
.tma-print-doc { font-family: "Segoe UI", Arial, sans-serif; color: #08152f; }

/* projects pass */
/* section tabs (HSE areas, project show sections) */
.tma-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border-2); margin-bottom: var(--sp-6); }
.tma-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 13px; color: #526980; font-size: var(--fs-sm); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tma-tabs a:hover, .tma-tabs a:focus-visible { color: var(--ink); background: var(--status-info-bg); }
.tma-tabs a.active { border-bottom-color: var(--gold); color: var(--ink); }
.tma-tabs a .bi { color: var(--steel-2); }
/* filter bar: one row of x-fields + button */
.tma-filter-bar { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; background: var(--surface-3); border: 1px solid var(--border); padding: 12px 16px; margin-bottom: var(--sp-5); }
.tma-filter-bar .tma-field { flex: 1 1 140px; min-width: 0; }
.tma-filter-bar .tma-field.grow { flex: 2 1 220px; }
.tma-filter-bar .tma-field.narrow { flex: 0 1 130px; }
.tma-filter-bar .btn { flex: 0 0 auto; min-height: 40px; }
.tma-filter-bar .form-text { flex-basis: 100%; margin: 0; }
/* thin progress meter */
.tma-meter { height: 6px; background: #e9eef5; overflow: hidden; min-width: 90px; }
.tma-meter > div { height: 100%; background: var(--steel-2); }
.tma-meter.is-critical > div { background: var(--status-critical); }
.tma-meter.is-good > div { background: var(--status-good); }
.tma-meter-label { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--ink-muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
/* definition list */
.tma-dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 11px 18px; font-size: var(--fs-sm); margin: 0; }
.tma-dl dt { color: #6a7e94; font-weight: 600; }
.tma-dl dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-2); }
/* milestone timeline */
.tma-timeline { list-style: none; margin: 0; padding: 4px 22px 10px; }
.tma-timeline li { position: relative; padding: 0 0 18px 26px; border-left: 2px solid var(--border-2); margin-left: 6px; }
.tma-timeline li:last-child { padding-bottom: 4px; }
.tma-timeline li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; background: var(--surface); border: 2px solid var(--status-neutral); }
.tma-timeline li.is-good::before { background: var(--status-good); border-color: var(--status-good); }
.tma-timeline li.is-info::before { background: var(--status-info); border-color: var(--status-info); }
.tma-timeline li.is-critical::before { background: var(--status-critical); border-color: var(--status-critical); }
.tma-timeline li.is-warn::before { background: var(--status-warn); border-color: var(--status-warn); }
.tma-timeline .tl-head { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: flex-start; flex-wrap: wrap; }
.tma-timeline .tl-head strong { font-size: var(--fs-base); color: var(--ink); }
.tma-timeline .tl-meta { font-size: var(--fs-xs); color: var(--ink-muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.tma-timeline .tl-actions { margin-top: 8px; }
/* status stepper (document control, incident lifecycle) */
.tma-stepper { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.tma-stepper li { flex: 1 1 0; min-width: 0; position: relative; padding: 0 12px 0 0; font-size: var(--fs-xs); color: var(--ink-muted); }
.tma-stepper li .dot { display: grid; place-items: center; width: 26px; height: 26px; background: var(--surface-3); border: 1px solid var(--border-2); color: var(--ink-muted); font-weight: 700; font-size: 11px; margin-bottom: 8px; position: relative; z-index: 1; }
.tma-stepper li::after { content: ''; position: absolute; top: 13px; left: 26px; right: 0; height: 1px; background: var(--border-2); }
.tma-stepper li:last-child::after { display: none; }
.tma-stepper li strong { display: block; color: var(--ink-2); font-size: var(--fs-sm); }
.tma-stepper li.is-done .dot { background: var(--status-good); border-color: var(--status-good); color: #fff; }
.tma-stepper li.is-done::after { background: var(--status-good); }
.tma-stepper li.is-current .dot { background: var(--navy); border-color: var(--navy); color: var(--gold); }
.tma-stepper li.is-current strong { color: var(--ink); }
.tma-stepper li.is-off .dot { background: var(--status-neutral-bg); border-style: dashed; }
/* allowed status transitions */
.tma-transitions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tma-transitions .tma-status.is-off { opacity: .45; text-decoration: line-through; }
/* read-only locked field group */
.tma-locked { position: relative; }
.tma-locked .form-control, .tma-locked .form-select { background: #edf1f6; color: #738196; }
/* attention groups */
.tma-severity-head { display: inline-flex; align-items: center; gap: 8px; }
.tma-stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--sp-3); }
.tma-stat-tile { border: 1px solid var(--border); border-top: 3px solid var(--status-neutral); padding: 12px 14px; background: var(--surface); min-width: 0; text-decoration: none; display: block; color: inherit; }
.tma-stat-tile:hover { background: var(--surface-2); color: inherit; }
.tma-stat-tile b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.tma-stat-tile span { font-size: var(--fs-xs); color: var(--ink-muted); }
.tma-stat-tile.t-good { border-top-color: var(--status-good); } .tma-stat-tile.t-info { border-top-color: var(--status-info); }
.tma-stat-tile.t-warn { border-top-color: var(--status-warn); } .tma-stat-tile.t-critical { border-top-color: var(--status-critical); }
.tma-stat-tile.t-serious { border-top-color: var(--status-serious); } .tma-stat-tile.t-neutral { border-top-color: var(--status-neutral); }
.tma-stat-tile.is-selected { outline: 2px solid var(--gold); outline-offset: -2px; }
/* text blocks (descriptions in show pages) */
.tma-prose { font-size: var(--fs-base); line-height: 1.7; white-space: pre-wrap; color: var(--ink-2); margin: 0; }
.tma-prose + .tma-prose-h, .tma-prose-h { font-size: var(--fs-eyebrow); font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 8px; }
.tma-prose-h ~ .tma-prose-h { margin-top: 18px; }
.tma-nowrap { white-space: nowrap; }
.tma-inline-actions { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tma-inline-actions form { display: inline; margin: 0; }
.tma-btn-danger { border: 1px solid #e3b7ba; color: var(--status-critical); background: #fff; }
.tma-btn-danger:hover { background: var(--status-critical-bg); color: var(--status-critical); border-color: var(--status-critical); }
.tma-chart-stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-5); }
.tma-chart-stack > .tma-panel { margin-bottom: 0; }
@media (max-width: 767.98px) { .tma-dl { grid-template-columns: 110px minmax(0, 1fr); } .tma-stepper { flex-direction: column; gap: 12px; } .tma-stepper li::after { display: none; } .tma-tabs { flex-wrap: nowrap; overflow-x: auto; } .tma-chart-stack { grid-template-columns: 1fr; } }
@media print { .tma-tabs, .tma-filter-bar { display: none !important; } }
.tma-inline-actions .tma-inline-form { display: flex; align-items: flex-end; gap: 6px; flex-wrap: nowrap; }
.tma-inline-actions .tma-inline-form .tma-field { flex: 0 1 160px; }
.tma-timeline .tl-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.tma-table td a:not(.btn) { color: var(--steel-2); text-decoration: none; }
.tma-table td a:not(.btn):hover { color: var(--ink); text-decoration: underline; }
/* per-row field whose column header already names it: keep the label for screen readers only */
.tma-field.visually-hidden-label > .form-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* two equal panels per row (tables need the width) */
.tma-panel-grid--2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); align-items: start; }
.tma-panel-grid--2 > .tma-panel { margin-bottom: 0; }
@media (max-width: 991.98px) { .tma-panel-grid--2 { grid-template-columns: 1fr; } }
.tma-panel-grid--2 + .tma-panel-grid--2, .tma-panel-grid--2 + .tma-panel, .tma-panel-grid + .tma-panel-grid--2 { margin-top: var(--sp-5); }
.tma-workspace .tma-panel-grid { margin-bottom: var(--sp-5); }
.tma-table td.primary a:not(.btn) { color: var(--ink); }

/* QA pass: let grid/flex children shrink so wide tables scroll inside their wrapper instead of widening the page */
.tma-panel-grid > *, .tma-stack > *, .tma-panel, .tma-panel-body { min-width: 0; }
@media (max-width: 575.98px) {
  .tma-panel-head { flex-wrap: wrap; }
  .tma-panel-actions { justify-content: flex-start; flex-shrink: 1; min-width: 0; }
  .tma-panel-actions .badge, .tma-panel-actions span { white-space: normal; }
}
/* keep visually-hidden labels inside their scroll container */
.tma-table-wrap, .table-responsive, .tma-field, .tma-fin-hide-label { position: relative; }
