/* THK identity (thk-theme.json): Night Ledger #052044, Cobalt Ink #243E86, Clear Current #53C0DB,
   Deep Fjord #00638C, Slate Steel #455362, surfaces from Dove Silver. */
:root { --qt-night: #052044; --qt-blue: #243E86; --qt-mid: #243E86; --qt-light: #53C0DB; --qt-bg: #F2F3F4;
        --qt-link: #00638C; --qt-tint: #EDF0F5; --qt-accent-tint: #EAF7FB; --qt-muted: #455362;
        --qt-success: #307087; --qt-danger: #B23163; --qt-highlight: #CD3281;
        --bs-primary: #243E86; --bs-primary-rgb: 36, 62, 134; --bs-link-color: #00638C; --bs-link-color-rgb: 0, 99, 140;
        --bs-link-hover-color: #19346F; --bs-link-hover-color-rgb: 25, 52, 111; --bs-body-color: #052044;
        --bs-secondary-color: #455362; --bs-danger: #B23163; --bs-danger-rgb: 178, 49, 99;
        --bs-success: #307087; --bs-success-rgb: 48, 112, 135; --bs-info: #53C0DB; --bs-info-rgb: 83, 192, 219;
        --bs-focus-ring-color: rgba(36, 62, 134, .25); }
.btn-primary { --bs-btn-bg: #243E86; --bs-btn-border-color: #243E86; --bs-btn-hover-bg: #19346F;
  --bs-btn-hover-border-color: #19346F; --bs-btn-active-bg: #052044; --bs-btn-active-border-color: #052044;
  --bs-btn-disabled-bg: #243E86; --bs-btn-disabled-border-color: #243E86; }
.btn-outline-primary { --bs-btn-color: #243E86; --bs-btn-border-color: #243E86; --bs-btn-hover-bg: #243E86;
  --bs-btn-hover-border-color: #243E86; --bs-btn-active-bg: #19346F; --bs-btn-active-border-color: #19346F; }
.text-bg-info { color: #052044 !important; }
.nav-pills { --bs-nav-pills-link-active-bg: #243E86; }
.page-item.active .page-link, .pagination { --bs-pagination-active-bg: #243E86; --bs-pagination-active-border-color: #243E86;
  --bs-pagination-color: #00638C; }
/* Compact scale: 14px base (Bootstrap sizes and spacing are rem, so everything follows). Percent keeps the
   user's browser font setting. */
html { font-size: 87.5%; }
body { background: var(--qt-bg); min-height: 100vh; }
.qt-side { width: 180px; font-size: .9rem; background: var(--qt-night); color: #fff; height: 100vh; position: sticky; top: 0;
           overflow-y: auto; flex: none; }  /* a long menu scrolls by itself instead of lengthening the page */
.qt-side a { color: #dce6f5; text-decoration: none; display: block; padding: .28rem .85rem; border-left: 3px solid transparent;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qt-side a:hover, .qt-side a.active { background: rgba(255,255,255,.08); color: #fff; border-left-color: var(--qt-light); }
.qt-side .section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; opacity: .6; padding: .65rem .85rem .15rem; }
.qt-side .foot { font-size: .68rem; opacity: .7; padding: .6rem .85rem; }
.qt-main { flex: 1; min-width: 0; }
.tile { border: 0; border-left: 4px solid var(--qt-mid); }
.tile .num { font-size: 1.5rem; font-weight: 600; color: var(--qt-blue); }
.status-badge { font-size: .75rem; }
.rich-view { background: #fff; border: 1px solid #dee2e6; border-radius: .375rem; padding: .5rem .75rem; min-height: 2.5rem; }
.rich-view table { border-collapse: collapse; } .rich-view td, .rich-view th { border: 1px solid #ccc; padding: 2px 6px; }
.event { border-left: 3px solid var(--qt-light); padding-left: .75rem; margin-bottom: 1rem; }
table.qt td, table.qt th { vertical-align: middle; }
@media (max-width: 768px) { .qt-side { width: 100%; height: auto; position: static; overflow: visible; } .qt-wrap { flex-direction: column; } }
.qt-brand .qt-firm { font-size: .75rem; opacity: .85; margin-top: .25rem; }
.qt-logo { max-width: 100%; max-height: 36px; display: block; }
.qt-logo-thk { max-height: 30px; width: auto; }
.qt-login-logo { max-height: 64px; max-width: 240px; }
.qt-login-card { border-top: 4px solid var(--qt-blue); }
.rich-editor { background: #fff; margin-bottom: .25rem; }
.rich-editor .ql-container { min-height: 7rem; font-family: inherit; font-size: .95rem; }
.rich-editor .ql-editor { min-height: 7rem; }
.rich-view p:last-child { margin-bottom: 0; }
/* Dashboard KPIs */
.dash-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #5a6270; margin: 0 0 .5rem; }
.stat { border: 0; border-left: 4px solid var(--qt-mid); color: inherit; }
a.stat:hover { box-shadow: 0 0 0 1px var(--qt-light); }
.stat-alert { border-left-color: #d03b3b; }
.stat-label { font-size: .8rem; color: #5a6270; }
.stat-value { font-size: 1.5rem; font-weight: 600; color: var(--qt-blue); line-height: 1.2; }
.stat-alert .stat-value { color: #b42318; }
.stat-suffix { font-size: 1rem; margin-left: .1rem; }
.stat-note { font-size: .75rem; color: #6c757d; }
.hero { font-size: 2.5rem; font-weight: 600; color: var(--qt-blue); line-height: 1.1; }
.meter { height: .5rem; background: #d6e4f5; border-radius: 4px; overflow: hidden; }
.meter > div { height: 100%; background: var(--qt-mid); border-radius: 4px; min-width: 2px; }
.dash-table .num, .dash-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Control History */
@media (min-width: 992px) {
  .history-pane { display: flex; flex-direction: column; min-height: 0; }
  #history-list .history-list { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
  #history-list nav[aria-label=Pages] { flex: none; margin-bottom: 0; }
  .history-detail { overflow-y: auto; }
  .history-detail > .card { flex: none; }
}
.history-list .list-group-item { border-left: 3px solid transparent; }
.history-list .list-group-item.active { background: #eaf2fb; color: inherit; border-color: #dee2e6; border-left-color: var(--qt-mid); }
.history-list .hl-name { color: #495057; }
.history-list .hl-meta { color: #6c757d; }
.hd-stat { background: var(--qt-bg); border-radius: .375rem; padding: .5rem .75rem; height: 100%; }
.hd-val { font-size: 1.35rem; font-weight: 600; color: var(--qt-blue); }
.hd-val.hd-small { font-size: .95rem; }
/* Imported SharePoint history */
.legacy-timeline { border-left: 2px solid #d6e4f5; padding-left: 1rem; }
.lt-entry { position: relative; background: #fff; border: 1px solid #e3e8ef; border-radius: .375rem; padding: .5rem .75rem; margin-bottom: .6rem; }
.lt-entry::before { content: ""; position: absolute; left: calc(-1rem - 6px); top: .85rem; width: 10px; height: 10px; border-radius: 50%; background: var(--qt-mid); }
.lt-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; }
.lt-title { font-weight: 600; color: var(--qt-blue); }
.lt-meta { font-size: .8rem; color: #6c757d; }
.lt-note { font-size: .875rem; margin-top: .25rem; }
.lt-note p:last-child { margin-bottom: 0; }
.lt-table { margin-top: .4rem; font-size: .85rem; }
.lt-table th[scope=row] { width: 32%; font-weight: 600; color: #495057; background: #f8fafc; }
.lt-table td p:last-child, .lt-table td ol:last-child, .lt-table td ul:last-child { margin-bottom: 0; }
.legacy-timeline.compact .lt-entry { padding: .35rem .6rem; margin-bottom: .4rem; }
.legacy-timeline.compact .lt-title { font-size: .85rem; }
.lt-raw summary { cursor: pointer; color: #6c757d; }
/* File lists */
.file-row { display: flex; align-items: center; gap: .65rem; padding: .45rem .25rem; border-bottom: 1px solid #eef1f5; }
.file-row:last-child { border-bottom: 0; }
.file-icon { font-size: 1.35rem; width: 1.75rem; text-align: center; flex: none; }
.file-main { flex: 1; min-width: 0; }
.file-name { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: .75rem; color: #6c757d; }
.file-actions { flex: none; display: flex; gap: .35rem; }
@media (max-width: 576px) { .file-actions .btn-outline-secondary { display: none; } }
/* Printing: only the page content (the report), none of the app's navigation or buttons */
.print-only { display: none; }
@media print {
  @page { margin: 14mm 12mm; }
  body { background: #fff !important; }
  .qt-side, .no-print, .alert, .file-actions, .lt-raw, .btn { display: none !important; }
  .qt-wrap { display: block !important; }
  .qt-main { padding: 0 !important; }
  .print-only { display: block !important; }
  .print-banner { font-size: .75rem; color: #555; margin-bottom: .5rem; }
  .card, .lt-entry { border: 1px solid #bbb !important; box-shadow: none !important; }
  .lt-entry, .file-row, .report-summary { break-inside: avoid; }
  .legacy-timeline { border-left-color: #999; }
  .lt-entry::before { background: #666 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit !important; text-decoration: none !important; }
  h2.h6 { break-after: avoid; }
}
/* One content width for every page */
.qt-content { max-width: 1440px; }
.form-actions { display: flex; gap: .5rem; align-items: center; margin-top: .25rem; }
/* Dashboard work queue */
.work-queue td, .work-queue th { padding-left: .75rem; padding-right: .75rem; }
.work-queue .wq-name { max-width: 22rem; }
.work-queue tr.wq-overdue td:first-child { box-shadow: inset 4px 0 0 #d03b3b; }
.work-queue tr.wq-soon td:first-child { box-shadow: inset 4px 0 0 #fab219; }
.wq-kind { font-size: .8rem; padding: .1rem .45rem; border-radius: .25rem; background: #eef2f7; white-space: nowrap; }
.wq-returned { background: #fde8e8; color: #8a1c1c; }
.wq-review, .wq-test, .wq-decide { background: #e7f0fb; color: #0b3d7a; }

/* Dashboard: decisions and trend chart */
.decision { padding: .6rem 0; border-top: 1px solid #e5e8ec; }
.decision:first-of-type { border-top: 0; }
.trend-chart { width: 100%; height: auto; display: block; overflow: visible; }
.trend-grid { stroke: #e5e8ec; stroke-width: 1; }
.trend-axis { font-size: 11px; fill: #6c757d; }
.trend-due { fill: none; stroke: #8a94a3; stroke-width: 2; stroke-dasharray: 5 4; }
.trend-done { fill: none; stroke: #005EB8; stroke-width: 2; }
.trend-dot-due { fill: #8a94a3; stroke: #fff; stroke-width: 2; }
.trend-dot-done { fill: #005EB8; stroke: #fff; stroke-width: 2; }
.trend-hit { fill: transparent; }
.trend-end { font-size: 11px; font-weight: 600; fill: #343a40; }
.trend-key { display: inline-block; width: 18px; height: 0; vertical-align: middle; border-top: 2px solid #005EB8; }
.trend-key-due { border-top: 2px dashed #8a94a3; }

/* Compact main area: tighter cards, tables, forms and vertical rhythm on every page */
.qt-main .card { --bs-card-spacer-y: .65rem; --bs-card-spacer-x: .85rem; --bs-card-cap-padding-y: .4rem;
                 --bs-card-cap-padding-x: .85rem; }
.qt-main .table { --bs-table-cell-padding-y: .35rem; --bs-table-cell-padding-x: .5rem; }
.qt-main .table-sm { --bs-table-cell-padding-y: .2rem; --bs-table-cell-padding-x: .4rem; }
.qt-main .table { margin-bottom: .75rem; }
.qt-main .form-control, .qt-main .form-select { padding-top: .3rem; padding-bottom: .3rem; }
.qt-main .form-label { margin-bottom: .2rem; }
.qt-main .btn:not(.btn-sm):not(.btn-lg):not(.btn-link) { --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .7rem; }
.qt-main .alert { --bs-alert-padding-y: .5rem; --bs-alert-margin-bottom: .75rem; }
.qt-main .mb-4 { margin-bottom: 1rem !important; }
.qt-main .mb-3 { margin-bottom: .75rem !important; }
.qt-main .mt-4 { margin-top: 1rem !important; }
.qt-main .g-4 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
.qt-main .g-3 { --bs-gutter-x: .75rem; --bs-gutter-y: .75rem; }
.qt-main h2, .qt-main .h5 { margin-bottom: .4rem; }

/* Header user menu */
.qt-user { display: flex; align-items: center; gap: .5rem; padding: .15rem .35rem; color: inherit; border-radius: .5rem; }
.qt-user:hover, .qt-user[aria-expanded="true"] { background: #e9eef6; }
.qt-avatar { width: 2rem; height: 2rem; border-radius: 50%; background: var(--qt-blue); color: #fff; font-size: .75rem;
             font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.qt-user-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.qt-user-name { font-weight: 600; font-size: .85rem; color: #212529; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qt-user-role { font-size: .72rem; color: #6c757d; }
.qt-user-menu { min-width: 16rem; }
@media (max-width: 576px) { .qt-user-text { display: none; } }

/* Master "View as" (read-only): forms stay visible but cannot be submitted; the server refuses them too. */
.view-as .qt-main form[method="post" i]:not(.qt-view-as) button:not([type="button"]),
.view-as .qt-main form[method="post" i]:not(.qt-view-as) input[type="submit"] { pointer-events: none; opacity: .45; }
.qt-view-as .dropdown-item.active { background: var(--qt-tint, #edf0f5); color: inherit; font-weight: 600; }

/* Audit trail: who each step went to, and returns highlighted (UAT remark) */
.lt-assigned { font-size: .8rem; color: var(--qt-muted, #455362); }
.lt-return { background: #fbeef3; border-radius: .375rem; }
.lt-return .lt-title, .lt-return .lt-assigned strong { color: #b23163; }
.lt-return::before { background: #b23163 !important; }
