/* macOS-style finish on top of custom.css: system font, translucent bars, soft hairlines, quieter controls.
   To go back to the previous look, remove the <link> to this file from base.html and base_portal.html. */

:root {
  --mac-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable Text", "Segoe UI", "Plus Jakarta Sans", system-ui, sans-serif;
  --mac-line: rgba(0, 0, 0, .09);
  --mac-glass: rgba(246, 246, 247, .72);
  --mac-card: #ffffff;
  --mac-shadow: 0 0 0 .5px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --mac-pop: 0 0 0 .5px rgba(0,0,0,.14), 0 12px 32px rgba(0,0,0,.18);
  --mac-focus: 0 0 0 3.5px rgba(0, 122, 255, .35);
  --r-sm: 7px; --r-md: 10px; --r-lg: 12px;
}
[data-theme="dark"] {
  --mac-line: rgba(255, 255, 255, .11);
  --mac-glass: rgba(30, 30, 32, .72);
  --mac-card: var(--surface);
  --mac-shadow: 0 0 0 .5px rgba(255,255,255,.10), 0 1px 2px rgba(0,0,0,.4);
  --mac-pop: 0 0 0 .5px rgba(255,255,255,.18), 0 14px 36px rgba(0,0,0,.55);
}

body, .btn, .form-control, .form-select, h1, h2, h3, h4, h5, h6, .brand-text, .btn-nb-logout, .bottom-nav {
  font-family: var(--mac-font) !important;
}
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; letter-spacing: -.003em; }
h2.fw-bold, .page-hd h2 { font-weight: 700 !important; letter-spacing: -.021em; font-size: 21px; }

/* ── translucent bars ── */
.lms-navbar, .bottom-nav {
  background: var(--mac-glass) !important;
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  box-shadow: none !important;
}
.lms-navbar { border-bottom: .5px solid var(--mac-line) !important; }
.bottom-nav { border-top: .5px solid var(--mac-line) !important; }

/* ── sidebar like Finder ── */
@media (min-width: 769px) { #sidebar { border-right: .5px solid var(--mac-line) !important; box-shadow: none !important; } }
#sidebar::before { display: none; }
.sb-section { text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 600; opacity: .85; }
#sidebar .nav-link { margin: 0 8px; padding: 4px 8px; border-radius: 6px; font-size: 13px; gap: 7px; }
#sidebar .nav-link .sb-icon { width: 22px; height: 22px; border-radius: 5px; background: transparent !important; box-shadow: none !important; font-size: 14px; }
#sidebar .nav-link.active { background: rgba(0,0,0,.08) !important; color: var(--text) !important; font-weight: 600; box-shadow: none !important; }
[data-theme="dark"] #sidebar .nav-link.active { background: rgba(255,255,255,.12) !important; }
#sidebar .nav-link.active .sb-icon { color: var(--text) !important; }
#sidebar .nav-link.active::after, #sidebar .nav-link.active::before { display: none !important; }

/* ── cards ── */
.card, .form-card { border: 0 !important; border-radius: var(--r-lg); box-shadow: var(--mac-shadow) !important; background: var(--mac-card); }
.card:hover, .cls-block:hover { transform: none !important; box-shadow: var(--mac-shadow) !important; }
.form-card::before, .card.form-card::before { display: none !important; }
.card-header { border-bottom: .5px solid var(--mac-line) !important; border-radius: var(--r-lg) var(--r-lg) 0 0 !important; font-size: 13px; font-weight: 600; }

/* ── buttons ── */
.btn { border-radius: var(--r-sm) !important; font-weight: 500; letter-spacing: 0; box-shadow: none; transition: filter .1s, background-color .1s; }
.btn:hover { transform: none !important; }
.btn:active { filter: brightness(.93); }
.btn-primary, .btn-success, .btn-danger, .btn-warning { box-shadow: 0 .5px 2px rgba(0,0,0,.22), inset 0 .5px 0 rgba(255,255,255,.18) !important; }
.btn-outline-secondary {
  background: var(--mac-card) !important; color: var(--text) !important; border: 0 !important;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.16), 0 1px 1.5px rgba(0,0,0,.08) !important;
}
[data-theme="dark"] .btn-outline-secondary { background: rgba(255,255,255,.09) !important; box-shadow: inset 0 .5px 0 rgba(255,255,255,.12), 0 0 0 .5px rgba(0,0,0,.5) !important; }
.btn-outline-primary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning { border-width: .5px !important; }

/* ── inputs with the blue focus ring ── */
.form-control, .form-select { border: .5px solid rgba(0,0,0,.18); border-radius: var(--r-sm); box-shadow: inset 0 .5px 1.5px rgba(0,0,0,.05); font-weight: 400; }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select { border-color: rgba(255,255,255,.16); }
.form-control:focus, .form-select:focus, .btn:focus-visible { border-color: rgba(0,122,255,.7) !important; box-shadow: var(--mac-focus) !important; outline: 0; }
.form-label { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
.form-check-input:focus { box-shadow: var(--mac-focus); }

/* ── tables ── */
.table > thead > tr > th { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; border-bottom: .5px solid var(--mac-line) !important; }
.table > tbody > tr > td, .table > tfoot > tr > td { border-color: var(--mac-line); }
@media (min-width: 768px) { .m-cards > tbody > tr:nth-child(even) > td { background-color: rgba(127,127,127,.045); } }
.m-cards [data-label]::before { text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 600; }

/* ── menus, pop-ups, notices ── */
.dropdown-menu, .pal-menu { border: 0 !important; border-radius: 10px !important; padding: 5px; box-shadow: var(--mac-pop) !important; }
.dropdown-item { border-radius: 5px; padding: 4px 10px; font-size: 13px; }
.dropdown-item:hover, .dropdown-item:focus { background: #0a7aff !important; color: #fff !important; }
.dropdown-item:hover span { color: #fff !important; }
.modal-content { border: 0; border-radius: 14px; box-shadow: var(--mac-pop); }
.modal-header, .modal-footer { border-color: var(--mac-line); }
.modal-backdrop.show { opacity: .28; }
.alert { border: 0; border-radius: var(--r-md); box-shadow: inset 0 0 0 .5px var(--mac-line); }
.id-chip, .badge, [class^="pill-"] { border-radius: 6px; letter-spacing: 0; }
.id-chip { font-family: var(--mac-font); font-variant-numeric: tabular-nums; }
.table td, .table th { font-variant-numeric: tabular-nums; }

/* macOS scrollbars: a thin rounded thumb, no arrow buttons, no track.
   Chrome/Edge/Safari only obey the ::-webkit rules when the standard scrollbar properties are left on "auto". */
@supports selector(::-webkit-scrollbar) {
  *, html:not([data-theme="dark"]) *, #sidebar { scrollbar-width: auto !important; scrollbar-color: auto !important; }
  ::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
  ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(60,60,67,.28); border: 3px solid transparent; background-clip: padding-box; border-radius: 99px; min-height: 36px; min-width: 36px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(60,60,67,.46); border-width: 2px; background-clip: padding-box; }
}
@supports not selector(::-webkit-scrollbar) {            /* Firefox */
  * { scrollbar-width: thin; scrollbar-color: rgba(60,60,67,.3) transparent; }
}
[data-theme="dark"] .form-text, [data-theme="dark"] .text-muted { color: #a1a1a6 !important; }

/* ── tables inside cards follow the card's rounded corners ── */
.card > .table-responsive:first-child, .card > .card-body.p-0:first-child { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.card > .table-responsive:last-child, .card > .card-body.p-0:last-child { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); overflow-y: hidden; }
.card > .table-responsive:first-child { overflow-y: hidden; }
.card > table, .card > .card-body.p-0 > .table-responsive:last-child { border-radius: var(--r-lg); overflow: hidden; }
.card > .table-responsive:last-child > .table > :last-child > tr:last-child > * { border-bottom: 0 !important; }
.card > .table-responsive:last-child > .table { margin-bottom: 0; }

/* ── long lists scroll in their own box with the column headings pinned (js/fixed-lists.js) ── */
.table-responsive.fixed-list { overflow: auto; }
.table-responsive.fixed-list > .table > thead > tr > th { position: sticky; top: 0; z-index: 3; background: var(--mac-card) !important; box-shadow: inset 0 -1px 0 var(--mac-line); }
@media (max-width: 767.98px) { .table-search { position: sticky; top: -12px; z-index: 4; background: var(--mac-card); } }
@media print { .table-responsive.fixed-list { max-height: none !important; overflow: visible; } }

/* row action buttons stay on one line; labels give way to icons when there isn't room */
.row-actions { display: inline-flex; gap: 4px; flex-wrap: nowrap; justify-content: flex-end; align-items: center; }
.row-actions form { margin: 0; }
@media (min-width: 768px) and (max-width: 1799.98px) { .row-actions .lbl { display: none; } .row-actions .btn { min-width: 34px; } }
@media (max-width: 767.98px) { .row-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; } }
/* must beat the rounded-corner rules above, which hide vertical overflow and would block wheel scrolling */
.card > .table-responsive.fixed-list, .card > .table-responsive.fixed-list:first-child, .card > .table-responsive.fixed-list:last-child { overflow: auto !important; }

/* ══ macOS toolbar: search field and pop-up filter menus, on every page ══ */
:root { --mac-field: rgba(120,120,128,.12); --mac-ctl-h: 30px; }
[data-theme="dark"] { --mac-field: rgba(120,120,128,.24); }

/* search: one grey rounded field with the magnifier inside it */
main .input-group:has(> .btn > .bi-search), main .input-group:has(> .input-group-text > .bi-search) { position: relative; }
main .input-group:has(> .btn > .bi-search) > .form-control, main .input-group:has(> .input-group-text > .bi-search) > .form-control {
  height: var(--mac-ctl-h); min-height: 0; padding: 3px 10px 3px 30px; font-size: 13px; border: 0 !important; border-radius: 8px !important;
  background: var(--mac-field) !important; box-shadow: none; margin: 0 !important; width: 100%;
}
main .input-group > .btn:has(> .bi-search), main .input-group > .input-group-text:has(> .bi-search) {
  position: absolute; left: 0; top: 0; z-index: 6; width: 30px; height: var(--mac-ctl-h); padding: 0 !important; margin: 0 !important;
  display: flex; align-items: center; justify-content: center; font-size: 12.5px;
  background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--text-muted) !important;
}
.table-search input[type="search"] {
  height: var(--mac-ctl-h); min-height: 0; padding: 3px 10px 3px 30px; font-size: 13px; border: 0 !important; border-radius: 8px; box-shadow: none;
  background: var(--mac-field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 16 16' fill='%238a8a8e'%3E%3Cpath d='M11.74 10.34a6.5 6.5 0 1 0-1.4 1.4l3.85 3.85a1 1 0 0 0 1.41-1.41l-3.86-3.84zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 10px center !important;
}
.table-search input[type="search"]:focus, main .input-group > .form-control:focus { box-shadow: var(--mac-focus) !important; }

/* filters: small pop-up buttons with up/down arrows */
main form[method="get"] .form-select, .table-search .form-select, .row-filter .form-select {
  height: var(--mac-ctl-h); min-height: 0; padding: 2px 26px 2px 10px; font-size: 13px; font-weight: 500; border: 0 !important; border-radius: 7px !important;
  background-color: var(--mac-card) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='13' viewBox='0 0 9 13' fill='none' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 4.5 4.5 1.5l3 3M1.5 8.5l3 3 3-3'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 8px center !important; background-size: 9px 13px !important;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.17), 0 1px 1.5px rgba(0,0,0,.08) !important; width: auto; cursor: pointer;
}
[data-theme="dark"] main form[method="get"] .form-select, [data-theme="dark"] .table-search .form-select {
  background-color: rgba(255,255,255,.09) !important; box-shadow: inset 0 .5px 0 rgba(255,255,255,.12), 0 0 0 .5px rgba(0,0,0,.5) !important;
}
main form[method="get"] .form-select:focus, .table-search .form-select:focus { box-shadow: var(--mac-focus) !important; }
main form[method="get"] input[type="date"], main form[method="get"] input[type="month"] { height: var(--mac-ctl-h); min-height: 0; font-size: 13px; padding: 2px 10px; }
main form[method="get"] .btn:not(:has(> .bi-search)) { height: var(--mac-ctl-h); display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding-top: 0; padding-bottom: 0; }

/* page toolbar buttons (title row) in the same size */
main > div.d-flex:first-of-type .btn { height: var(--mac-ctl-h); display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px; padding: 0 12px; }
main > div.d-flex:first-of-type .btn i { font-size: 12.5px; }

@media (max-width: 767.98px) {                 /* easier to tap on a phone; 16px text stops zooming */
  :root { --mac-ctl-h: 38px; }
  main .input-group > .form-control, .table-search input[type="search"] { font-size: 16px; }
}

/* ══ every drop-down list in macOS style ══
   Chrome/Edge (135+) can style the open list. Mouse devices only: phones keep their own picker, which is easier to use
   there. Safari and Firefox ignore this and show their normal list. */
@supports (appearance: base-select) {
  @media (pointer: fine) {
    select:not([multiple]):not([size]), select:not([multiple]):not([size])::picker(select) { appearance: base-select; }
    select:not([multiple]):not([size]) { display: inline-flex; align-items: center; line-height: 1.35; white-space: nowrap; overflow: hidden; min-block-size: 0; min-inline-size: 0; text-align: left; cursor: pointer; }
    select:not([multiple]):not([size])::picker-icon { display: none; }          /* the field already has its arrows */
    select::picker(select) {
      border: 0; border-radius: 10px; padding: 5px; margin-block: 4px; background: var(--mac-card); color: var(--text);
      box-shadow: var(--mac-pop); max-block-size: min(340px, 60vh); overflow-y: auto; font-family: var(--mac-font); font-size: 13px;
      opacity: 0; transform: translateY(-3px); transition: opacity .12s, transform .12s, display .12s allow-discrete, overlay .12s allow-discrete;
    }
    select:open::picker(select) { opacity: 1; transform: none; }
    @starting-style { select:open::picker(select) { opacity: 0; transform: translateY(-3px); } }
    select option { display: flex; align-items: center; gap: 7px; min-block-size: 0; padding: 4px 14px 4px 7px; border-radius: 5px; font-weight: 400; background: transparent; color: inherit; cursor: pointer; outline: 0; white-space: nowrap; }
    select option::checkmark { content: "\2713"; inline-size: 11px; font-size: 11px; font-weight: 700; visibility: hidden; }
    select option:checked::checkmark { visibility: visible; }
    select option:checked { font-weight: 600; background: transparent; }
    select option:hover, select option:focus-visible { background: #0a7aff; color: #fff; }
    select option:disabled { opacity: .45; }
  }
}
/* arrows on every single-choice list, including form fields */
select.form-select:not([multiple]):not([size]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='13' viewBox='0 0 9 13' fill='none' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 4.5 4.5 1.5l3 3M1.5 8.5l3 3 3-3'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 9px center !important; background-size: 9px 13px !important; padding-right: 28px;
}
@supports (appearance: base-select) {
  @media (pointer: fine) {
    html select option, html[data-theme="dark"] select option { background: transparent !important; }
    html select option:hover, html select option:focus-visible, html[data-theme="dark"] select option:hover, html[data-theme="dark"] select option:focus-visible { background: #0a7aff !important; color: #fff !important; }
  }
}

/* "Actions" menu on a list row */
.row-menu { min-width: 210px; max-width: 320px; text-align: left; }
.row-menu .dropdown-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; white-space: normal; }
.row-menu .dropdown-item i { width: 16px; text-align: center; flex-shrink: 0; }
.row-menu .dropdown-item.text-danger:hover { background: #ff3b30 !important; color: #fff !important; }
.row-menu .dropdown-divider { margin: 4px 6px; }

/* one standard look: light only, so browser controls stay light on a dark-mode computer or phone too */
:root { color-scheme: light; }
/* the small buttons at the end of a row stay side by side */
@media (min-width: 768px) { .table > tbody > tr > td.text-end { white-space: nowrap; } }

/* ══════════ The app's one colour scheme (sky blue): light sky sidebar, sky-blue accent, soft blue-white page.
   To try another colour, change these values. ══════════ */
html[data-palette="iytech"] {
  --brand: #0284c7; --brand-dark: #0369a1; --brand-deep: #075985; --brand-light: #0ea5e9; --brand-rgb: 2,132,199; --brand-ink: #075985;
  --brand-tint: #e0f2fe; --brand-blush: #f6fbff; --brand-wash: #ecf8ff; --brand-track: #d2ebfb; --ink-deep: #082f49; --shade-rgb: 10,80,120; --shade2-rgb: 5,45,75;
  --accent: #0284c7; --accent-dark: #0369a1; --accent-glow: rgba(2,132,199,.28);
  --bg: #f5fafe; --surface: #ffffff; --border: #dbeaf4; --border-subtle: #ecf5fb; --text: #0f2536; --text-muted: #54707f;
  --mac-line: rgba(8,70,110,.11); --mac-focus: 0 0 0 3.5px rgba(14,165,233,.32); --mac-field: rgba(14,165,233,.09); --mac-glass: rgba(255,255,255,.78);
  --navy: #e3f4fd; --navy-text: #134a68; --navy-faint: #4d89a8;
}
html[data-palette="iytech"] body { background: var(--bg); }

/* navy sidebar */
html[data-palette="iytech"] #sidebar { background: linear-gradient(180deg, #eef9ff 0%, var(--navy) 55%, #d6eefc 100%) !important; border-right: 1px solid #c8e6f8 !important; }
html[data-palette="iytech"] .sb-section { color: var(--navy-faint) !important; }
html[data-palette="iytech"] #sidebar .nav-link { color: var(--navy-text) !important; }
html[data-palette="iytech"] #sidebar .nav-link .sb-icon { color: #0284c7 !important; }
html[data-palette="iytech"] #sidebar .nav-link:hover { background: rgba(2,132,199,.10) !important; color: #075985 !important; }
html[data-palette="iytech"] #sidebar .nav-link.active { background: var(--brand) !important; color: #fff !important; }
html[data-palette="iytech"] #sidebar .nav-link.active .sb-icon { color: #fff !important; }
html[data-palette="iytech"] .sb-divider { background: rgba(2,132,199,.18) !important; border-color: rgba(2,132,199,.18) !important; }

/* indigo actions */
html[data-palette="iytech"] .btn-primary, html[data-palette="iytech"] .btn-primary:hover, html[data-palette="iytech"] .btn-primary:focus {
  background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important;
}
html[data-palette="iytech"] .btn-primary:hover { background: var(--brand-dark) !important; }
html[data-palette="iytech"] .table > thead > tr > th { color: #0b5580; }
html[data-palette="iytech"] .table-responsive.fixed-list > .table > thead > tr > th { background: #f2f9fe !important; }
html[data-palette="iytech"] .table > thead > tr > th { background: #f2f9fe; }
html[data-palette="iytech"] .card-icon, html[data-palette="iytech"] .stat-icon-wrap, html[data-palette="iytech"] .sh-icon { background: var(--brand-tint) !important; color: var(--brand) !important; }
html[data-palette="iytech"] .row-avatar, html[data-palette="iytech"] .nb-avatar { background: linear-gradient(135deg, #0284c7, #38bdf8) !important; color: #fff !important; }
html[data-palette="iytech"] .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
html[data-palette="iytech"] .bottom-nav a.active, html[data-palette="iytech"] .bottom-nav a.active i { color: var(--brand) !important; }
html[data-palette="iytech"] .dropdown-item:hover, html[data-palette="iytech"] .dropdown-item:focus { background: var(--brand) !important; }
html[data-palette="iytech"] select option:hover, html[data-palette="iytech"] select option:focus-visible { background: var(--brand) !important; }
@media (max-width: 768px) { html[data-palette="iytech"] #sidebar { background: var(--navy) !important; } }

/* ══ macOS calendar (js/mac-controls.js) ══ */
html.mac-cal input[type="date"]::-webkit-calendar-picker-indicator, html.mac-cal input[type="month"]::-webkit-calendar-picker-indicator { display: none; }
html.mac-cal input[type="date"], html.mac-cal input[type="month"] {
  cursor: pointer; padding-right: 30px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='%236e6e73'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 10px center !important;
}
.mcal { position: fixed; z-index: 2000; width: 252px; padding: 10px; border-radius: 12px; background: var(--surface, #fff); color: var(--text);
  box-shadow: var(--mac-pop); font-family: var(--mac-font); font-size: 13px; user-select: none; animation: mcal-in .12s ease-out; }
@keyframes mcal-in { from { opacity: 0; transform: translateY(-3px); } }
.mcal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.mcal-head select.mcal-select { flex: 1 1 auto; min-width: 0; height: 26px; border: 0; border-radius: 6px; background: var(--mac-field); color: inherit; font: inherit; font-weight: 600; padding: 0 8px; justify-content: center; }
.mcal-nav { flex: 0 0 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); font-size: 17px; line-height: 1; }
.mcal-nav:hover { background: var(--mac-field); }
.mcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mcal-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mcal-dow { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 2px 0 4px; }
.mcal-day { height: 28px; border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; font-variant-numeric: tabular-nums; }
.mcal-months .mcal-day { height: 34px; }
.mcal-day:hover:not(:disabled) { background: var(--mac-field); }
.mcal-day.dim { color: var(--text-muted); opacity: .55; }
.mcal-day.today { color: var(--brand); font-weight: 700; }
.mcal-day.on, .mcal-day.on:hover { background: var(--brand) !important; color: #fff; font-weight: 600; opacity: 1; }
.mcal-day:disabled { opacity: .28; cursor: default; }
.mcal-foot { display: flex; margin-top: 8px; padding-top: 6px; border-top: .5px solid var(--mac-line); }
.mcal-link { border: 0; background: transparent; color: var(--brand); font: inherit; font-weight: 600; padding: 2px 6px; border-radius: 5px; }
.mcal-link:hover:not(:disabled) { background: var(--mac-field); }
.mcal-link:disabled { opacity: .4; }

/* confirm dialog */
.mac-alert-back { position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.28); }
.mac-alert { width: 100%; max-width: 320px; padding: 18px 16px 14px; border-radius: 14px; background: var(--surface, #fff); box-shadow: var(--mac-pop); text-align: center; animation: mcal-in .14s ease-out; }
.mac-alert-text { font-size: 13.5px; font-weight: 600; line-height: 1.45; margin-bottom: 14px; color: var(--text); overflow-wrap: anywhere; }
.mac-alert-row { display: flex; gap: 8px; }
.mac-alert-row .btn { flex: 1; height: 32px; }

/* choose-file buttons, tick boxes and radio dots */
input[type="file"]::file-selector-button { border: 0; border-radius: 6px; padding: 3px 10px; margin-right: 10px; background: var(--mac-field); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
input[type="time"] { font-variant-numeric: tabular-nums; }

/* pager: one joined control */
.pager { display: inline-flex; align-items: stretch; margin-top: 10px; border-radius: 8px; background: var(--surface, #fff); box-shadow: 0 0 0 .5px rgba(0,0,0,.18), 0 1px 2px rgba(0,0,0,.07); overflow: hidden; font-size: 13px; }
.pager-btn, .pager-info { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; white-space: nowrap; }
.pager-btn { color: var(--text) !important; text-decoration: none; font-weight: 500; }
a.pager-btn:hover { background: rgba(127,127,127,.12); color: var(--text) !important; }
a.pager-btn:active { background: rgba(127,127,127,.2); }
.pager-btn.off { color: var(--text-muted) !important; opacity: .45; cursor: default; }
.pager-info { color: var(--text-muted); border-left: .5px solid rgba(0,0,0,.14); border-right: .5px solid rgba(0,0,0,.14); font-variant-numeric: tabular-nums; }
.pager-btn i { font-size: 11px; }
@media (max-width: 767.98px) { .pager { display: flex; justify-content: space-between; } .pager-btn, .pager-info { height: 38px; } }

/* profile photo: top bar circle and My Profile preview (initials stay underneath if the file is missing) */
.nb-avatar { position: relative; overflow: hidden; }
.nb-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: #fff; }
.profile-now { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 .5px rgba(0,0,0,.18); }

/* phones and tablets: touching or holding a list must not select its text or flash it blue */
@media (hover: none) and (pointer: coarse) {
  * { -webkit-tap-highlight-color: transparent; }
  .table, .table-responsive, .m-cards, .cls-block > summary, .cls-more > summary, .nav, .bottom-nav, #sidebar, .btn, .pager, .dropdown-menu {
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  }
  .table input, .table textarea, .table select { -webkit-user-select: text; user-select: text; }      /* typing marks still works */
}

/* touch screens have no mouse, but keep a tapped row in its "hover" state: don't shade it */
@media (hover: none) {
  html body .table-hover > tbody > tr:hover, html body .table-hover > tbody > tr:hover > *,
  html[data-palette] body .table-hover > tbody > tr:hover > td {
    background: transparent !important; --bs-table-bg-state: transparent !important; --bs-table-accent-bg: transparent !important;
  }
  html body .table-hover > tbody > tr.table-primary:hover > * { background: var(--bs-table-bg) !important; }      /* total rows keep their colour */
  html body table.m-sticky.table-hover > tbody > tr:hover > :first-child, html body table.m-sticky-2.table-hover > tbody > tr:hover > :nth-child(2) { background: var(--surface, #fff) !important; }
}
