/* Techtix Finance Hub — application styles (Bootstrap 5.3 base).
   Brand colours are CSS variables so the official Techtix palette can be dropped in without code changes. */
:root {
  --tfh-accent: #1d3fd1;
  --tfh-accent-hover: #1733ab;
  --tfh-accent-soft: #eef1fd;
  --tfh-ink: #101828;
  --tfh-muted: #667085;
  --tfh-border: #e4e7ec;
  --tfh-bg: #f6f7f9;
  --tfh-surface: #ffffff;
  --tfh-sidebar-bg: #0e1726;
  --tfh-sidebar-fg: #c5cbd6;
  --tfh-sidebar-active: #1b2740;
  --tfh-positive: #067647;
  --tfh-negative: #b42318;
  --tfh-warning: #b54708;
  --tfh-forecast: #7a5af8;
  --tfh-radius: 6px;
  --tfh-sidebar-w: 248px;
  --tfh-sidebar-w-collapsed: 64px;
  --bs-body-font-family: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --bs-body-font-size: 0.875rem;
  --bs-body-color: var(--tfh-ink);
  --bs-body-bg: var(--tfh-bg);
  --bs-border-color: var(--tfh-border);
  --bs-border-radius: var(--tfh-radius);
  --bs-border-radius-sm: 4px;
  --bs-border-radius-lg: 8px;
  --bs-primary: var(--tfh-accent);
  --bs-primary-rgb: 29, 63, 209;
  --bs-link-color: var(--tfh-accent);
  --bs-link-color-rgb: 29, 63, 209;
  --bs-link-hover-color: var(--tfh-accent-hover);
  --bs-focus-ring-color: rgba(29, 63, 209, .25);
}
[data-bs-theme="dark"] {
  --tfh-ink: #e6e8ec;
  --tfh-muted: #98a2b3;
  --tfh-border: #263042;
  --tfh-bg: #0b111c;
  --tfh-surface: #111a29;
  --tfh-accent: #6d8cff;
  --tfh-accent-hover: #8aa3ff;
  --tfh-accent-soft: #18234a;
  --tfh-sidebar-bg: #080d16;
  --tfh-sidebar-active: #152038;
  --tfh-positive: #47cd89;
  --tfh-negative: #f97066;
  --tfh-warning: #fdb022;
  --bs-body-color: var(--tfh-ink);
  --bs-body-bg: var(--tfh-bg);
  --bs-border-color: var(--tfh-border);
  --bs-primary-rgb: 109, 140, 255;
  --bs-link-color: var(--tfh-accent);
  --bs-link-color-rgb: 109, 140, 255;
  --bs-secondary-bg: #18222f;
  --bs-tertiary-bg: #141d2b;
}

body { font-feature-settings: 'tnum' 1, 'cv11' 1; -webkit-font-smoothing: antialiased; }
h1, .h1 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; margin: 0; }
h2, .h2 { font-size: 1rem; font-weight: 600; }
h3, .h3 { font-size: .875rem; font-weight: 600; }
.icon { width: 16px; height: 16px; stroke-width: 1.9; vertical-align: -3px; flex-shrink: 0; }
.btn .icon { margin-right: 2px; }
.text-positive { color: var(--tfh-positive) !important; }
.text-negative { color: var(--tfh-negative) !important; }
.text-forecast { color: var(--tfh-forecast) !important; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: 8px; z-index: 2000; background: var(--tfh-surface); padding: 6px 10px; }

.btn { --bs-btn-font-size: .8125rem; --bs-btn-padding-y: .375rem; --bs-btn-padding-x: .75rem; font-weight: 500; }
.btn-sm { --bs-btn-font-size: .78rem; --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .55rem; }
.btn-primary { --bs-btn-bg: var(--tfh-accent); --bs-btn-border-color: var(--tfh-accent); --bs-btn-hover-bg: var(--tfh-accent-hover); --bs-btn-hover-border-color: var(--tfh-accent-hover); --bs-btn-active-bg: var(--tfh-accent-hover); --bs-btn-disabled-bg: var(--tfh-accent); --bs-btn-disabled-border-color: var(--tfh-accent); }
.btn-outline-primary { --bs-btn-color: var(--tfh-accent); --bs-btn-border-color: var(--tfh-accent); --bs-btn-hover-bg: var(--tfh-accent); --bs-btn-hover-border-color: var(--tfh-accent); }
.btn-light { --bs-btn-bg: var(--tfh-surface); --bs-btn-border-color: var(--tfh-border); --bs-btn-hover-bg: var(--bs-tertiary-bg); --bs-btn-color: var(--tfh-ink); --bs-btn-hover-color: var(--tfh-ink); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--tfh-radius); color: var(--tfh-muted); background: transparent; }
.btn-icon:hover { background: var(--bs-tertiary-bg); color: var(--tfh-ink); }
.btn-icon .icon { width: 18px; height: 18px; margin: 0; }
.form-control, .form-select { font-size: .8125rem; border-color: var(--tfh-border); }
.form-label { font-size: .78rem; font-weight: 550; color: var(--tfh-muted); margin-bottom: .25rem; }
.form-text { font-size: .75rem; }
.invalid-feedback { font-size: .75rem; }

/* ---- Shell ---- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--tfh-sidebar-w); background: var(--tfh-sidebar-bg); color: var(--tfh-sidebar-fg); display: flex; flex-direction: column; flex-shrink: 0; }
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; visibility: visible !important; transform: none !important; }
  .sidebar-collapsed .sidebar { width: var(--tfh-sidebar-w-collapsed); }
  .sidebar-collapsed .nav-label, .sidebar-collapsed .nav-section-title, .sidebar-collapsed .brand-sub, .sidebar-collapsed .ws-name, .sidebar-collapsed .ws-ccy, .sidebar-collapsed .ws-button .icon { display: none; }
  .sidebar-collapsed .brand-wordmark { font-size: 0; }
  .sidebar-collapsed .brand-wordmark::first-letter { font-size: 1.1rem; }
  .sidebar-collapsed .nav-item { justify-content: center; padding: .5rem; }
  .sidebar-collapsed .ws-button { justify-content: center; }
}
@media (max-width: 991.98px) { .sidebar { --bs-offcanvas-bg: var(--tfh-sidebar-bg); --bs-offcanvas-width: 280px; } }
.sidebar-brand { display: flex; align-items: center; padding: 1rem 1rem .75rem; }
.brand-link { display: flex; align-items: baseline; gap: .4rem; text-decoration: none; color: #fff; }
.brand-wordmark { font-weight: 750; font-size: 1.1rem; letter-spacing: -0.02em; color: #fff; }
.brand-sub { font-size: .75rem; color: #8b95a7; font-weight: 500; }
.brand-logo { height: 26px; width: auto; }
.sidebar .btn-close { filter: invert(1); margin-left: auto; }
.workspace-switcher { padding: 0 .75rem .5rem; }
.ws-button { width: 100%; display: flex; align-items: center; gap: .5rem; background: #162033; color: #e8ebf1; border: 1px solid #222e45; border-radius: var(--tfh-radius); padding: .45rem .6rem; font-size: .8rem; text-align: left; }
.ws-button:hover { background: #1b2740; }
.ws-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-ccy { font-size: .7rem; color: #8b95a7; }
.ws-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: #3b82f6; }
.ws-dot.ws-personal { background: #a855f7; }
.ws-dot.ws-demo { background: #f59e0b; }
.sidebar-nav { padding: .25rem .5rem 1rem; flex: 1; }
.nav-section { margin-top: .75rem; }
.nav-section-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #6b768a; padding: 0 .6rem .3rem; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: .6rem; padding: .38rem .6rem; color: var(--tfh-sidebar-fg); text-decoration: none; border-radius: var(--tfh-radius); font-size: .8125rem; }
.nav-item:hover { background: #151f31; color: #fff; }
.nav-item.active { background: var(--tfh-sidebar-active); color: #fff; box-shadow: inset 2px 0 0 #7d9bff; }
.nav-item .icon { color: #8b95a7; }
.nav-item.active .icon, .nav-item:hover .icon { color: #c9d4ff; }
.sidebar-foot { padding: .5rem; border-top: 1px solid #1a2436; }
.nav-collapse { color: #8b95a7; text-decoration: none; align-items: center; gap: .5rem; font-size: .78rem; }
.nav-collapse:hover { color: #fff; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; padding: .5rem 1.25rem; background: var(--tfh-surface); border-bottom: 1px solid var(--tfh-border); min-height: 54px; }
.breadcrumb { font-size: .8rem; --bs-breadcrumb-divider-color: var(--tfh-muted); }
.breadcrumb a { color: var(--tfh-muted); text-decoration: none; }
.topbar-search { width: min(360px, 40vw); }
.topbar-search .form-control { padding-left: 2rem; background: var(--bs-tertiary-bg); border-color: transparent; }
.topbar-search .form-control:focus { background: var(--tfh-surface); border-color: var(--tfh-accent); }
.search-icon { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--tfh-muted); }
.search-suggest { width: 100%; max-height: 380px; overflow-y: auto; font-size: .8rem; }
.search-suggest.show { display: block; }
.topbar-actions { display: flex; align-items: center; gap: .35rem; }
.notif-count { position: absolute; top: 3px; right: 2px; background: var(--tfh-negative); color: #fff; font-size: .6rem; border-radius: 9px; padding: 0 4px; min-width: 15px; line-height: 15px; font-weight: 600; }
.notif-menu { width: 360px; max-width: 92vw; padding: 0; }
.notif-list { max-height: 400px; overflow-y: auto; border-top: 1px solid var(--tfh-border); }
.notif-item { display: block; padding: .6rem 1rem; border-bottom: 1px solid var(--tfh-border); color: inherit; text-decoration: none; font-size: .8rem; }
.notif-item:hover { background: var(--bs-tertiary-bg); }
.notif-item.unread { box-shadow: inset 3px 0 0 var(--tfh-accent); }
.btn-avatar { padding: 0; border: 0; background: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; }
.avatar-initials { background: var(--tfh-accent-soft); color: var(--tfh-accent); font-size: .72rem; font-weight: 650; }
.avatar-lg { width: 44px; height: 44px; }
.profile-menu { min-width: 250px; }
[data-bs-theme="light"] .theme-light-icon, [data-bs-theme="dark"] .theme-dark-icon { display: none; }
.content { padding: 1.25rem; max-width: 1600px; width: 100%; }
@media (max-width: 575.98px) { .content { padding: .85rem; } .topbar { padding: .5rem .75rem; } }

/* ---- Page header ---- */
.page-header { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.page-header .subtitle { color: var(--tfh-muted); font-size: .8rem; margin-top: 2px; }
.page-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---- Cards ---- */
.card { --bs-card-border-color: var(--tfh-border); --bs-card-bg: var(--tfh-surface); --bs-card-border-radius: var(--tfh-radius); --bs-card-cap-bg: transparent; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card-header { display: flex; align-items: center; gap: .5rem; padding: .65rem 1rem; font-weight: 600; font-size: .85rem; }
.card-header .actions { margin-left: auto; display: flex; gap: .35rem; }
.card-body { padding: 1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.stat { background: var(--tfh-surface); border: 1px solid var(--tfh-border); border-radius: var(--tfh-radius); padding: .75rem .9rem; min-width: 0; }
.stat-label { font-size: .72rem; color: var(--tfh-muted); font-weight: 550; text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; gap: .35rem; }
.stat-value { font-size: 1.2rem; font-weight: 650; margin-top: .2rem; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-meta { font-size: .72rem; color: var(--tfh-muted); margin-top: .15rem; }
.stat.is-forecast { border-style: dashed; }
.stat.is-forecast .stat-label::after { content: 'Forecast'; font-size: .6rem; color: var(--tfh-forecast); border: 1px solid currentColor; border-radius: 3px; padding: 0 3px; margin-left: auto; text-transform: none; letter-spacing: 0; }
.legend-forecast { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; color: var(--tfh-muted); }
.legend-forecast::before { content: ''; width: 14px; height: 0; border-top: 2px dashed var(--tfh-forecast); }

/* ---- Tables ---- */
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--tfh-border); font-size: .8125rem; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .45rem .6rem; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--tfh-muted); font-weight: 600; background: var(--bs-tertiary-bg); white-space: nowrap; border-bottom-width: 1px; }
.table thead th a { color: inherit; text-decoration: none; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--bs-tertiary-bg); }
.table tfoot td, .table tfoot th { font-weight: 650; background: var(--bs-tertiary-bg); }
.table-compact > :not(caption) > * > * { padding: .3rem .5rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.row-link { cursor: pointer; }
tr.is-muted td { color: var(--tfh-muted); }
tr.is-reversed td { text-decoration: line-through; color: var(--tfh-muted); }
.badge-status { font-weight: 550; font-size: .7rem; padding: .25em .5em; border-radius: 4px; }
.text-bg-light.badge-status { border: 1px solid var(--tfh-border); }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; padding: .75rem 1rem; border-bottom: 1px solid var(--tfh-border); }
.filter-bar .form-control, .filter-bar .form-select { width: auto; min-width: 140px; }
.filter-bar .filter-search { min-width: 220px; }
.pagination { --bs-pagination-font-size: .78rem; --bs-pagination-padding-x: .6rem; --bs-pagination-padding-y: .25rem; margin: 0; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--tfh-muted); }
.empty-state .icon { width: 30px; height: 30px; margin-bottom: .5rem; color: #98a2b3; }
.empty-state h3 { color: var(--tfh-ink); margin-bottom: .25rem; }

/* Annual matrix */
.matrix { font-size: .76rem; }
.matrix th, .matrix td { white-space: nowrap; }
.matrix .sticky-col { position: sticky; left: 0; background: var(--tfh-surface); z-index: 2; min-width: 220px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.matrix thead .sticky-col { background: var(--bs-tertiary-bg); z-index: 3; }
.matrix td.cell { text-align: right; cursor: pointer; min-width: 78px; position: relative; }
.matrix td.cell:hover { outline: 1px solid var(--tfh-accent); outline-offset: -1px; }
.matrix td.cell .dot { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; }
.cell-paid .dot, .cell-received .dot { background: var(--tfh-positive); }
.cell-partially_paid .dot { background: #0ea5e9; }
.cell-overdue .dot { background: var(--tfh-negative); }
.cell-expected .dot { background: #98a2b3; }
.cell-skipped, .cell-cancelled, .cell-not_applicable { color: var(--tfh-muted); }
.cell-overdue { color: var(--tfh-negative); }
.matrix tr.section-row td { background: var(--bs-tertiary-bg); font-weight: 650; text-transform: uppercase; font-size: .7rem; letter-spacing: .04em; }
.matrix tr.total-row td { font-weight: 650; border-top: 2px solid var(--tfh-border); }

/* Progress */
.progress { --bs-progress-height: 6px; --bs-progress-bg: var(--bs-tertiary-bg); --bs-progress-bar-bg: var(--tfh-accent); border-radius: 3px; }
.progress-thin { --bs-progress-height: 4px; }
.colour-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; vertical-align: middle; margin-right: 4px; border: 1px solid rgba(0,0,0,.08); }

/* Forecast */
.forecast-table td.neg { color: var(--tfh-negative); font-weight: 600; }
.forecast-table tr.summary td { font-weight: 650; background: var(--bs-tertiary-bg); }
.forecast-table th.week { min-width: 92px; text-align: right; }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.chart-box.lg { height: 320px; }

/* Detail definition lists */
.kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: .35rem .75rem; font-size: .8125rem; margin: 0; }
.kv dt { color: var(--tfh-muted); font-weight: 500; }
.kv dd { margin: 0; word-break: break-word; }

/* Forms */
.form-section { border-top: 1px solid var(--tfh-border); padding-top: 1rem; margin-top: 1rem; }
.form-section-title { font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--tfh-muted); margin-bottom: .75rem; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; border-top: 1px solid var(--tfh-border); padding-top: 1rem; margin-top: 1rem; }
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; }
.ts-control { font-size: .8125rem; border-color: var(--tfh-border) !important; min-height: 33px; }
.ts-dropdown { font-size: .8125rem; }
[data-bs-theme="dark"] .ts-control, [data-bs-theme="dark"] .ts-dropdown { background: var(--tfh-surface); color: var(--tfh-ink); }

/* Toasts / modals / panels */
.toast-container { z-index: 1090; }
.toast { font-size: .8125rem; }
.panel-wide { --bs-offcanvas-width: min(560px, 100vw); }
.offcanvas-body .kv { grid-template-columns: 40% 1fr; }

/* Mobile FAB */
.fab-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 1030; }
.fab { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(16, 24, 40, .25); }
.fab .icon { width: 22px; height: 22px; margin: 0; }
.quick-add .dropdown-item { display: flex; align-items: center; gap: .5rem; padding: .45rem 1rem; }

/* Login / minimal */
body.minimal { background: radial-gradient(1200px 600px at 10% -10%, rgba(29, 63, 209, .08), transparent), var(--tfh-bg); }
.minimal-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; }
.minimal-flash { width: min(420px, 100%); }
.login-card { width: min(420px, 100%); background: var(--tfh-surface); border: 1px solid var(--tfh-border); border-radius: 10px; padding: 2rem; box-shadow: 0 12px 32px rgba(16, 24, 40, .08); }
.login-brand { display: flex; align-items: baseline; gap: .4rem; margin-bottom: 1.5rem; }
.login-brand .brand-wordmark { color: var(--tfh-ink); font-size: 1.35rem; }
.login-brand .brand-sub { color: var(--tfh-muted); font-size: .85rem; }
.login-card h1 { font-size: 1.15rem; margin-bottom: .35rem; }
.login-lede { color: var(--tfh-muted); font-size: .85rem; margin-bottom: 1.5rem; }
.gsi-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 42px; border: 1px solid #747775; border-radius: 4px; background: #fff; color: #1f1f1f; font-family: Roboto, 'Inter Variable', Arial, sans-serif; font-size: 14px; font-weight: 500; text-decoration: none; letter-spacing: .25px; }
.gsi-button:hover { background: #f8f9fa; color: #1f1f1f; box-shadow: 0 1px 2px rgba(60, 64, 67, .3); }
.gsi-button:focus-visible { outline: 2px solid var(--tfh-accent); outline-offset: 2px; }
[data-bs-theme="dark"] .gsi-button { background: #131314; color: #e3e3e3; border-color: #8e918f; }
.gsi-button svg { width: 18px; height: 18px; }
.login-notice { font-size: .78rem; color: var(--tfh-muted); margin-top: 1.25rem; display: flex; gap: .5rem; }
.login-foot { font-size: .72rem; color: var(--tfh-muted); margin-top: 1.25rem; text-align: center; }
.install-card { width: min(760px, 100%); }
.install-steps { display: flex; gap: .25rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.install-steps .step { font-size: .72rem; padding: .2rem .5rem; border-radius: 4px; background: var(--bs-tertiary-bg); color: var(--tfh-muted); }
.install-steps .step.done { background: #ecfdf3; color: var(--tfh-positive); }
.install-steps .step.current { background: var(--tfh-accent); color: #fff; }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--tfh-border); border-left: 1px solid var(--tfh-border); }
.cal-head { font-size: .7rem; text-transform: uppercase; color: var(--tfh-muted); padding: .4rem; border-right: 1px solid var(--tfh-border); border-bottom: 1px solid var(--tfh-border); background: var(--bs-tertiary-bg); font-weight: 600; }
.cal-day { min-height: 104px; border-right: 1px solid var(--tfh-border); border-bottom: 1px solid var(--tfh-border); padding: .3rem; font-size: .72rem; background: var(--tfh-surface); }
.cal-day.other { background: var(--bs-tertiary-bg); color: var(--tfh-muted); }
.cal-day.today .cal-num { background: var(--tfh-accent); color: #fff; border-radius: 10px; padding: 0 6px; }
.cal-num { font-weight: 600; display: inline-block; margin-bottom: 2px; }
.cal-event { display: block; padding: 1px 4px; margin-bottom: 2px; border-radius: 3px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid; background: var(--bs-tertiary-bg); color: var(--tfh-ink); }
.cal-event.in { border-color: var(--tfh-positive); }
.cal-event.out { border-color: var(--tfh-negative); }
.cal-event.info { border-color: var(--tfh-forecast); }
.cal-event.done { opacity: .55; }
@media (max-width: 767.98px) { .cal-day { min-height: 64px; } .cal-event span.amt { display: none; } }

.warning-list li { padding: .35rem 0; border-bottom: 1px dashed var(--tfh-border); font-size: .8rem; }
.warning-list li:last-child { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; }
.code-block { background: var(--bs-tertiary-bg); border: 1px solid var(--tfh-border); border-radius: var(--tfh-radius); padding: .5rem .75rem; word-break: break-all; }
.loading { opacity: .6; pointer-events: none; }
.skeleton { background: linear-gradient(90deg, var(--bs-tertiary-bg), var(--tfh-border), var(--bs-tertiary-bg)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 4px; min-height: 1rem; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { transition: none !important; } }
@media print { .sidebar, .topbar, .page-actions, .fab-wrap, .filter-bar form .btn { display: none !important; } .content { padding: 0; } }
.btn-light { --bs-btn-active-bg: var(--tfh-accent-soft); --bs-btn-active-color: var(--tfh-accent); --bs-btn-active-border-color: var(--tfh-accent); }
.btn-group-sm > .btn { --bs-btn-font-size: .78rem; --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .55rem; }
.matrix a, .table a { text-decoration: none; }
.matrix a:hover, .table a:hover { text-decoration: underline; }
@media (max-width: 575.98px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .stat { padding: .6rem .7rem; }
  .stat-value { font-size: 1.02rem; }
  .topbar { gap: .35rem; }
  .topbar-search { width: auto; flex: 1 1 auto; min-width: 0; }
  .topbar-actions { gap: .15rem; }
  .page-header h1 { font-size: 1.1rem; }
  .page-actions { margin-left: 0; width: 100%; }
  .filter-bar .form-control, .filter-bar .form-select { min-width: 0; width: 100%; }
  .filter-bar > div { flex: 1 1 140px; }
}
.main-col, .content { min-width: 0; }
