/* =====================================================================
   App shell (loaded automatically on every logged-in page; behaviour: includes/scripts/ux/10-shell.js)
   Sections:  1 skip link & focus   2 sidebar (collapsible, count chips)   3 top bar (title, search trigger, bell, menus)
              4 command palette     5 notification centre                   6 shortcuts overlay & session dialog
              7 page header / message pages / skeletons / progress bar      8 dark theme (CSS variables)
              9 print               10 reduced motion
   ===================================================================== */

/* ---------- 1. Skip link & focus --------------------------------------- */
.fm-skip { position: fixed; left: 12px; top: -60px; z-index: 700000; background: var(--fm-primary); color: #fff !important; padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: top .15s; }
.fm-skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--fm-accent); outline-offset: 2px; border-radius: 4px; }
.fm-sidebar a:focus-visible, .fm-sidebar button:focus-visible { outline-color: #7dd3fc; outline-offset: -2px; }
.fm-row:focus-visible { outline-offset: -2px; }
#front_middle:focus { outline: none; }

/* ---------- 2. Sidebar ------------------------------------------------- */
.fm-sidebar, .fm-main { transition: width .2s ease, margin-left .2s ease, transform .22s ease; }
.fm-nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-nav a .fm-nav-text { flex: 1 1 auto; }
.fm-nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(251, 191, 36, .22); color: #fcd34d; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.fm-nav a:hover .fm-nav-count, .fm-nav a.active .fm-nav-count { background: rgba(251, 191, 36, .3); }
.fm-nav-item:hover .fm-nav-count { visibility: hidden; } /* the "+" quick-add takes its place on hover */
.fm-nav-item:focus-within .fm-nav-count { visibility: hidden; }

.fm-sidebar-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 18px; }
.fm-sidebar-company { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.fm-sidebar-company strong { display: block; color: #e2f1fb; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-sidebar-company span { display: block; font-size: 11.5px; color: #7ea6c0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-collapse-btn { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .07); color: #9cc3dc; display: inline-flex; align-items: center; justify-content: center; }
.fm-collapse-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.fm-collapse-btn i { transition: transform .2s; }

/* desktop only: icon rail */
@media (min-width: 992px) {
	body.fm-nav-collapsed { --fm-sidebar-w: 72px; }
	body.fm-nav-collapsed .fm-nav-text, body.fm-nav-collapsed .fm-nav-label, body.fm-nav-collapsed .fm-nav-badge, body.fm-nav-collapsed .fm-nav-add { display: none !important; }
	body.fm-nav-collapsed .fm-sidebar-brand { justify-content: center; padding: 0; }
	body.fm-nav-collapsed .fm-nav a { justify-content: center; padding: 11px 0; position: relative; }
	body.fm-nav-collapsed .fm-nav a > i { width: auto; font-size: 16px; }
	body.fm-nav-collapsed .fm-nav-count { position: absolute; top: 3px; right: 10px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
	body.fm-nav-collapsed .fm-nav-item:hover .fm-nav-count { visibility: visible; }
	body.fm-nav-collapsed .fm-sidebar-scroll { padding: 14px 10px 20px; }
	body.fm-nav-collapsed .fm-nav + .fm-nav { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .07); }
	body.fm-nav-collapsed .fm-sidebar-foot { justify-content: center; padding: 10px 0; }
	body.fm-nav-collapsed .fm-collapse-btn i { transform: rotate(180deg); }
}
@media (max-width: 991.98px) {
	.fm-collapse-btn { display: none; }
	.fm-sidebar { width: min(300px, 86vw); }
}

/* ---------- 3. Top bar -------------------------------------------------- */
.fm-topbar { gap: 12px; }
.fm-topbar-title { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; min-width: 0; flex: 0 0 auto; max-width: 240px; }
.fm-topbar-crumb { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fm-muted); }
.fm-topbar-name { font-size: 16px; font-weight: 650; color: var(--fm-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the old search form became a button that opens the command palette */
button.fm-search { display: flex; align-items: center; gap: 10px; flex: 0 1 440px; margin-left: 14px; height: 38px; padding: 0 8px 0 12px; border: 1px solid var(--fm-line); border-radius: 10px; background: var(--fm-bg); color: var(--fm-muted); font-size: 13.5px; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
button.fm-search:hover { background: var(--fm-surface); border-color: #c9d4e4; }
button.fm-search i { position: static; transform: none; font-size: 13px; }
.fm-search-text { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-search-kbd { display: inline-flex; gap: 3px; }
.fm-search-kbd kbd, .fmx-pal kbd, .fmx-keys kbd { font: 600 11px/1.5 var(--fm-font); padding: 0 6px; border: 1px solid var(--fm-line); border-bottom-width: 2px; border-radius: 6px; background: var(--fm-surface); color: var(--fm-ink-2); }

.fm-icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--fm-ink-2); font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.fm-icon-btn:hover, .fm-icon-btn.show { background: var(--fm-neutral-bg); }
.fm-icon-btn::after { display: none !important; }
.fm-search-mobile { display: none; }

.fm-plan-pill.is-warn { background: var(--fm-warning-bg); color: var(--fm-warning); }

.fm-bell-badge { position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; border: 2px solid var(--fm-surface); box-sizing: content-box; }
.fm-bell-badge[hidden] { display: none; }

.fm-menu-who { padding: 8px 10px 4px; line-height: 1.3; }
.fm-menu-who strong { display: block; font-size: 13.5px; }
.fm-menu-who span { font-size: 12px; color: var(--fm-muted); }
.fm-topbar button.dropdown-item { width: 100%; background: none; border: 0; text-align: left; }
.fm-link-btn { background: none; border: 0; padding: 0; color: var(--fm-primary); font-size: 12.5px; font-weight: 600; }
.fm-link-btn:hover { text-decoration: underline; }

@media (max-width: 991.98px) {
	.fm-topbar-title { flex: 0 1 auto; }
	button.fm-search { flex-basis: 220px; margin-left: 4px; }
}
@media (max-width: 767.98px) {
	.fm-search-kbd { display: none; }
	button.fm-search { flex: 0 0 auto; width: 38px; padding: 0; justify-content: center; margin-left: 0; }
	.fm-search-text { display: none; }
	.fm-new-text { display: none; }
	.fm-topbar .btn.btn-theme.btn-sm { padding: 6px 10px; }
}
@media (max-width: 575.98px) {
	button.fm-search { display: none; }
	.fm-search-mobile { display: inline-flex; }
	.fm-topbar { padding: 0 10px; gap: 4px; }
	.fm-topbar-name { font-size: 15px; max-width: 34vw; }
	.fm-user-btn { padding: 2px; }
}

/* ---------- 4. Command palette ------------------------------------------ */
.fmx-pal { position: fixed; inset: 0; z-index: 600002; background: rgba(8, 25, 40, .5); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 11vh 16px 16px; opacity: 0; transition: opacity .15s; }
.fmx-pal.is-in { opacity: 1; }
.fmx-pal__box { width: min(640px, 100%); max-height: min(560px, 78vh); display: flex; flex-direction: column; background: var(--fm-surface); border: 1px solid var(--fm-line); border-radius: 18px; box-shadow: 0 30px 80px rgba(8, 47, 73, .4); overflow: hidden; transform: translateY(-8px) scale(.99); transition: transform .15s; }
.fmx-pal.is-in .fmx-pal__box { transform: none; }
.fmx-pal__head { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--fm-line-2); }
.fmx-pal__head > i { color: var(--fm-muted); font-size: 15px; }
.fmx-pal .fmx-pal__input { flex: 1 1 auto; height: 56px; border: 0 !important; border-radius: 0; outline: 0 !important; box-shadow: none !important; background: transparent !important; padding: 0; margin: 0; font-size: 16px; color: var(--fm-ink); min-width: 0; width: auto; }
.fmx-pal__input::placeholder { color: #9aa4b8; }
.fmx-pal__spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--fm-primary-100); border-top-color: var(--fm-primary); animation: fmspin .7s linear infinite; opacity: 0; }
.fmx-pal.is-busy .fmx-pal__spin { opacity: 1; }
.fmx-pal__list { overflow-y: auto; padding: 6px 8px 8px; flex: 1 1 auto; overscroll-behavior: contain; }
.fmx-pal__group { padding: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--fm-muted); }
.fmx-pal__item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; color: var(--fm-ink); cursor: pointer; }
.fmx-pal__item.is-active { background: var(--fm-primary-50); }
.fmx-pal__ico { flex: 0 0 34px; height: 34px; border-radius: 9px; background: var(--fm-primary-50); color: var(--fm-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.fmx-pal__item.is-active .fmx-pal__ico { background: var(--fm-primary); color: #fff; }
.fmx-pal__main { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.fmx-pal__title { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmx-pal__sub { display: block; font-size: 12px; color: var(--fm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmx-pal__meta { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--fm-muted); white-space: nowrap; }
.fmx-pal__meta.is-danger { color: var(--fm-danger); }
.fmx-pal__keys { flex: 0 0 auto; display: inline-flex; gap: 3px; }
.fmx-pal mark { background: rgba(14, 165, 233, .22); color: inherit; border-radius: 3px; padding: 0 1px; }
.fmx-pal__empty { padding: 34px 16px; text-align: center; color: var(--fm-muted); }
.fmx-pal__empty i { display: block; font-size: 26px; margin-bottom: 8px; opacity: .6; }
.fmx-pal__empty a { font-weight: 600; }
.fmx-pal__foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--fm-line-2); font-size: 12px; color: var(--fm-muted); background: var(--fm-bg); }
.fmx-pal__foot span { display: inline-flex; align-items: center; gap: 5px; }
.fmx-pal__sk { display: flex; align-items: center; gap: 12px; padding: 9px 10px; }
.fmx-pal__sk > span:first-child { width: 34px; height: 34px; border-radius: 9px; }
.fmx-pal__sk > span:last-child { flex: 1; height: 28px; }
@media (max-width: 575.98px) {
	.fmx-pal { padding: 0; align-items: stretch; }
	.fmx-pal__box { width: 100%; max-height: none; border-radius: 0; border: 0; }
	.fmx-pal__foot { display: none; }
	.fmx-pal__input { height: 60px; font-size: 17px; }
}

/* ---------- 5. Notification centre -------------------------------------- */
.fm-bell-menu { width: 380px; max-width: calc(100vw - 20px); padding: 0 !important; overflow: hidden; }
.fm-bell-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--fm-line-2); }
.fm-bell-head strong { font-size: 14px; }
.fm-bell-body { max-height: min(60vh, 460px); overflow-y: auto; }
.fm-bell-foot { padding: 10px 16px; border-top: 1px solid var(--fm-line-2); text-align: center; font-size: 13px; font-weight: 600; background: var(--fm-bg); }
.fm-bell-empty { padding: 28px 16px; text-align: center; color: var(--fm-muted); font-size: 13.5px; }
.fm-bell-empty i { display: block; font-size: 26px; margin-bottom: 6px; color: var(--fm-success); }
.fm-bell-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--fm-line-2); color: inherit; position: relative; }
.fm-bell-item:last-child { border-bottom: 0; }
.fm-bell-item:hover { background: var(--fm-primary-50); color: inherit; }
.fm-bell-item.is-unseen::before { content: ''; position: absolute; left: 5px; top: 22px; width: 7px; height: 7px; border-radius: 50%; background: var(--fm-accent); }
.fm-bell-ico { flex: 0 0 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--fm-info-bg); color: var(--fm-info); }
.fm-bell-ico.tone-danger { background: var(--fm-danger-bg); color: var(--fm-danger); }
.fm-bell-ico.tone-warning { background: var(--fm-warning-bg); color: var(--fm-warning); }
.fm-bell-text { min-width: 0; line-height: 1.35; }
.fm-bell-text strong { display: block; font-size: 13.5px; }
.fm-bell-text span { display: block; font-size: 12.5px; color: var(--fm-muted); }
.fm-bell-text em { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--fm-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 575.98px) {
	.fm-bell { position: static; }
	.fm-bell-menu { position: fixed !important; left: 10px !important; right: 10px !important; top: calc(var(--fm-topbar-h) + 4px) !important; width: auto; transform: none !important; max-width: none; }
}

/* ---------- 6. Shortcuts overlay & session dialog ------------------------ */
.fmx-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; margin: 4px 0 10px; }
.fmx-keys h4 { grid-column: 1 / -1; margin: 12px 0 2px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--fm-muted); }
.fmx-keys div { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 3px 0; }
.fmx-keys span.k { display: inline-flex; gap: 3px; align-items: center; color: var(--fm-muted); font-size: 12px; }
.fmx-modal__box.is-wide { width: min(560px, 100%); }
.fmx-modal__box .fm-field { margin-bottom: 12px; text-align: left; }
.fmx-modal__box .fm-field label { display: block; margin-bottom: 4px; }
.fmx-modal__err { color: var(--fm-danger); font-size: 13px; min-height: 18px; margin-bottom: 6px; }
@media (max-width: 575.98px) { .fmx-keys { grid-template-columns: 1fr; } }

/* ---------- 7. Page header / message pages / skeletons / progress -------- */
.fm-page-head-main { min-width: 0; }
.fm-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; font-size: 12px; color: var(--fm-muted); }
.fm-crumbs a { color: var(--fm-muted); font-weight: 500; }
.fm-crumbs a:hover { color: var(--fm-primary); }
.fm-crumbs i { font-size: 9px; opacity: .6; }
.fm-page-head h1 .fm-page-icon { color: var(--fm-primary); margin-right: 6px; font-size: .85em; }
.fm-page-chips { display: inline-flex; gap: 6px; vertical-align: middle; margin-left: 6px; font-size: 13px; font-weight: 500; }
.fm-message-card { max-width: 560px; margin: 8vh auto 0; }
.fm-message-card .fm-empty { padding: 48px 28px; }
.fm-message-title { font-size: 20px; margin-bottom: 6px; }
.fm-message-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.fm-empty-icon.fm-tone-danger { background: var(--fm-danger-bg); color: var(--fm-danger); }

/* skeleton building blocks (use with .fmx-skeleton from 00-core.css) */
.fm-skel-line { display: block; height: 12px; border-radius: 6px; margin: 8px 0; }
.fm-skel-line.w-25 { width: 25%; } .fm-skel-line.w-50 { width: 50%; } .fm-skel-line.w-75 { width: 75%; }
.fm-skel-block { display: block; height: 120px; border-radius: 12px; }
.fm-skel-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.fm-skel-row > .fm-skel-dot { flex: 0 0 36px; height: 36px; border-radius: 10px; }

/* thin progress bar while the next page loads */
.fm-progress { position: fixed; left: 0; top: 0; height: 3px; width: 0; z-index: 700001; background: linear-gradient(90deg, #38bdf8, var(--fm-primary)); box-shadow: 0 0 8px rgba(14, 165, 233, .6); opacity: 0; transition: width .4s ease, opacity .2s; pointer-events: none; }
.fm-progress.is-on { opacity: 1; width: 70%; transition: width 8s cubic-bezier(.1, .8, .3, 1); }

/* ---------- 8. Dark theme ------------------------------------------------ */
/* The whole app is built on the --fm-* tokens; the dark theme swaps the tokens and then fixes the few hard-coded white surfaces.
   <html data-theme="dark"> is set by the inline script in menu_after_login.php before first paint. */
:root[data-theme="dark"] {
	color-scheme: dark;
	--fm-primary: #38bdf8; --fm-primary-600: #7dd3fc; --fm-primary-50: rgba(56, 189, 248, .12); --fm-primary-100: rgba(56, 189, 248, .26); --fm-accent: #38bdf8;
	--fm-ink: #e7eef6; --fm-ink-2: #c2cfdd; --fm-muted: #8fa1b5;
	--fm-line: #26374b; --fm-line-2: #1f2e41; --fm-bg: #0b1623; --fm-surface: #122032;
	--fm-success: #4ade80; --fm-success-bg: rgba(74, 222, 128, .13); --fm-warning: #fbbf24; --fm-warning-bg: rgba(251, 191, 36, .13);
	--fm-danger: #f87171; --fm-danger-bg: rgba(248, 113, 113, .14); --fm-info: #7ab1ff; --fm-info-bg: rgba(122, 177, 255, .14); --fm-neutral-bg: #1b2b3f;
	--fm-shadow-sm: 0 1px 2px rgba(0, 0, 0, .35); --fm-shadow: 0 2px 10px rgba(0, 0, 0, .35); --fm-shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
}
:root[data-theme="dark"] body, :root[data-theme="dark"] body.bg-light { background-color: var(--fm-bg) !important; color: var(--fm-ink); }
:root[data-theme="dark"] a { color: #7dd3fc; }
:root[data-theme="dark"] a:hover { color: #bae6fd; }
:root[data-theme="dark"] .btn-theme, :root[data-theme="dark"] .btn-primary { background: #0284c7 !important; border-color: #0284c7 !important; }
:root[data-theme="dark"] .btn-theme:hover, :root[data-theme="dark"] .btn-primary:hover { background: #0369a1 !important; border-color: #0369a1 !important; }
:root[data-theme="dark"] .fm-skip { background: #0284c7; }
:root[data-theme="dark"] .fm-topbar { background: rgba(18, 32, 50, .92); }
:root[data-theme="dark"] .fm-loader { background: rgba(11, 22, 35, .92) !important; }
:root[data-theme="dark"] .btn-default, :root[data-theme="dark"] .btn-light, :root[data-theme="dark"] .btn-secondary, :root[data-theme="dark"] .btn-outline-primary,
:root[data-theme="dark"] .btn-outline-secondary { background: var(--fm-surface); border-color: var(--fm-line); color: var(--fm-ink-2); }
:root[data-theme="dark"] .btn-default:hover, :root[data-theme="dark"] .btn-light:hover, :root[data-theme="dark"] .btn-secondary:hover { background: var(--fm-neutral-bg); color: var(--fm-ink); border-color: #35506b; }
:root[data-theme="dark"] .form-control, :root[data-theme="dark"] .form-select, :root[data-theme="dark"] input.form-control, :root[data-theme="dark"] textarea.form-control,
:root[data-theme="dark"] .bootstrap-select > .dropdown-toggle { background-color: var(--fm-bg) !important; border-color: var(--fm-line) !important; color: var(--fm-ink); }
:root[data-theme="dark"] .form-control:focus, :root[data-theme="dark"] .form-select:focus { background-color: var(--fm-bg) !important; }
:root[data-theme="dark"] .form-control:disabled, :root[data-theme="dark"] .form-control[readonly] { background-color: var(--fm-neutral-bg) !important; }
:root[data-theme="dark"] .form-control::placeholder { color: #66788d; }
:root[data-theme="dark"] .dropdown-menu, :root[data-theme="dark"] .modal-content, :root[data-theme="dark"] .ui-datepicker, :root[data-theme="dark"] .ui-autocomplete,
:root[data-theme="dark"] .bootstrap-select .dropdown-menu { background: var(--fm-surface); color: var(--fm-ink); border-color: var(--fm-line); }
:root[data-theme="dark"] .dropdown-item { color: var(--fm-ink-2); }
:root[data-theme="dark"] .dropdown-item:hover, :root[data-theme="dark"] .dropdown-item:focus { background: var(--fm-primary-50); color: var(--fm-ink); }
:root[data-theme="dark"] .modal-footer { background: var(--fm-bg) !important; border-color: var(--fm-line); }
:root[data-theme="dark"] .modal-header { border-color: var(--fm-line); }
:root[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1); }
:root[data-theme="dark"] .table { color: var(--fm-ink); }
:root[data-theme="dark"] .table thead th, :root[data-theme="dark"] .table > tbody > tr > th, :root[data-theme="dark"] .fm-table thead th { background: #0f1c2c; color: var(--fm-muted); }
:root[data-theme="dark"] .fm-table tbody tr td { color: var(--fm-ink); }
:root[data-theme="dark"] .fm-table tbody tr.fm-row:hover { background: rgba(56, 189, 248, .08) !important; }
:root[data-theme="dark"] .white-box, :root[data-theme="dark"] .fm-me-card, :root[data-theme="dark"] .fm-opt-tile, :root[data-theme="dark"] .fm-quick a, :root[data-theme="dark"] .fm-quick button,
:root[data-theme="dark"] .options-area .fm-settings-menu, :root[data-theme="dark"] .fm-receive-box { background: var(--fm-surface) !important; border-color: var(--fm-line); color: var(--fm-ink); }
:root[data-theme="dark"] .fm-opt-body b, :root[data-theme="dark"] .fm-me-card h3 { color: var(--fm-ink); }
:root[data-theme="dark"] div.fme_pagination a, :root[data-theme="dark"] div.fme_pagination span { background: var(--fm-surface) !important; color: var(--fm-ink-2) !important; border-color: var(--fm-line) !important; }
:root[data-theme="dark"] div.fme_pagination span.current { background: #0284c7 !important; color: #fff !important; border-color: #0284c7 !important; }
:root[data-theme="dark"] .fm-badge.neutral, :root[data-theme="dark"] .fm-badge { color: var(--fm-ink-2); }
:root[data-theme="dark"] .fm-badge.success { color: var(--fm-success); } :root[data-theme="dark"] .fm-badge.warning { color: var(--fm-warning); }
:root[data-theme="dark"] .fm-badge.danger { color: var(--fm-danger); } :root[data-theme="dark"] .fm-badge.info { color: var(--fm-info); }
:root[data-theme="dark"] .nav-tabs .nav-link.active, :root[data-theme="dark"] .fx-tabs a.active { color: #7dd3fc; border-bottom-color: #38bdf8; }
:root[data-theme="dark"] .fmx-modal__box, :root[data-theme="dark"] .fmx-drawer__panel { background: var(--fm-surface); color: var(--fm-ink); }
:root[data-theme="dark"] .fmx-modal__box p { color: var(--fm-muted); }
:root[data-theme="dark"] .fmx-drawer__panel > header { border-color: var(--fm-line); }
:root[data-theme="dark"] .fmx-drawer__x { background: var(--fm-neutral-bg); color: var(--fm-ink); }
:root[data-theme="dark"] .fmx-skeleton { background: linear-gradient(90deg, #1a2a3d 25%, #223650 37%, #1a2a3d 63%); background-size: 400% 100%; }
:root[data-theme="dark"] .fmx-kbd { background: var(--fm-neutral-bg); color: var(--fm-ink-2); border-color: var(--fm-line); }
:root[data-theme="dark"] .fm-detail-pane iframe { background: var(--fm-surface); }
:root[data-theme="dark"] .fm-app-footer { color: var(--fm-muted); }
:root[data-theme="dark"] button.fm-search:hover { border-color: #35506b; }
:root[data-theme="dark"] .fm-bell-badge { border-color: var(--fm-surface); }
:root[data-theme="dark"] hr { border-color: var(--fm-line); }
:root[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2c4058; }
:root[data-theme="dark"] * { scrollbar-color: #2c4058 transparent; }

/* ---------- 9. Print ------------------------------------------------------ */
@media print {
	.fm-sidebar, .fm-topbar, .fm-sidebar-backdrop, .fm-app-footer, .fm-skip, .fmx-toasts, .fmx-pal, .fm-progress, .fm-page-actions, .fm-filters, .fm-table-foot .fme_pagination,
	.fm-quick, .fm-dash-range, .fm-dash-actions, .fm-loader, .cookie_box_fm { display: none !important; }
	html, body, body.bg-light { background: #fff !important; color: #000 !important; }
	:root[data-theme="dark"] { --fm-ink: #000; --fm-ink-2: #222; --fm-muted: #555; --fm-line: #ccc; --fm-line-2: #ddd; --fm-bg: #fff; --fm-surface: #fff; }
	.fm-main { margin: 0 !important; }
	.fm-page { padding: 0 !important; max-width: none; }
	.fx-card, .white-box { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
	.fm-table th, .fm-table td { padding: 6px 8px !important; }
	a { color: inherit !important; text-decoration: none !important; }
	.fm-row { cursor: default; }
	@page { margin: 14mm; }
}

/* ---------- 10. Reduced motion ------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.fm-sidebar, .fm-main, .fmx-pal, .fmx-pal__box, .fm-collapse-btn i, .fm-progress, .fm-skip { transition: none !important; }
	.fmx-pal__spin { animation-duration: 2s; }
	html { scroll-behavior: auto !important; }
	.fmx-skeleton { animation: none !important; }
	.fm-loader::after { animation-duration: 3s; }
}
