/*
 * Clarity — the Makeena portal theme on Bootstrap 5.3.
 * Colors are tokens (--mk-*) defined once per theme; Bootstrap's own variables and the legacy portal classes are
 * mapped onto them, so pages follow light/dark through <html data-bs-theme>.
 */

:root,
[data-bs-theme="light"] {
    --mk-bg: #edf1f5;
    --mk-surface: #ffffff;
    --mk-surface-2: #f3f6f9;
    --mk-border: #dce3ea;
    --mk-border-strong: #c9d3dd;
    --mk-text: #17212b;
    --mk-text-2: #2f3b47;
    --mk-muted: #526070;
    --mk-thead: #f1f5f8;
    --mk-heat-1: #d7efeb; --mk-heat-2: #a6dbd3; --mk-heat-3: #5fb8ad; --mk-heat-4: #1f8f83; --mk-heat-5: #0b5e56;
    --mk-stage: #0f1729;           /* behind photos (viewer, missing slots): dark in both themes */
    --mk-brand: #00a18f;           /* logo teal (images/brand) */
    --mk-accent: #14978b;          /* brand teal: fills, bars, focus */
    --mk-accent-strong: #0f7f74;   /* teal that passes 4.5:1 for text and buttons */
    --mk-accent-hover: #0c6b62;
    --mk-accent-soft: #e6f2f1;
    --mk-on-accent: #ffffff;
    --mk-track: #e3e9ef;
    --mk-bar: #3aa597;             /* chart bars (3:1 on white); the selected month uses --mk-bar-strong */
    --mk-bar-strong: #0c6b62;      /* highlighted bar (selected month) */
    --mk-warn: #b45309;
    --mk-warn-soft: #fdf1e3;
    --mk-warn-ink: #8a3c0b;
    --mk-info-soft: #e6effb;
    --mk-info-ink: #1c5cab;
    --mk-success: #15803d;
    --mk-danger: #c62f2f;
    --mk-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 2px 6px rgba(16, 24, 40, 0.05);
    /* sidebar: white panel, teal highlight */
    --mk-side-bg: #ffffff;
    --mk-side-border: var(--mk-border);
    --mk-side-text: var(--mk-text-2);
    --mk-side-muted: var(--mk-muted);
    --mk-side-hover: var(--mk-surface-2);
    --mk-side-active-bg: var(--mk-tone-teal-soft);
    --mk-side-active-text: var(--mk-tone-teal-ink);
    --mk-side-brand: var(--mk-brand);
    --mk-side-card: var(--mk-tone-teal-soft);
    /* chart series — fixed order, validated (dataviz validate_palette.js: CVD, contrast, lightness) on white */
    --mk-chart-1: #14978b;
    --mk-chart-2: #2a78d6;
    --mk-chart-3: #eb6834;
    --mk-chart-4: #6250d6;
    --mk-chart-5: #64748b;
    /* tones for KPI icons and badges: fill / soft background / text on soft */
    --mk-tone-teal: #14978b;  --mk-tone-teal-soft: #dff3f0;  --mk-tone-teal-ink: #0b6259;
    --mk-tone-blue: #2a78d6;  --mk-tone-blue-soft: #e3edfb;  --mk-tone-blue-ink: #1a56a0;
    --mk-tone-violet: #6250d6; --mk-tone-violet-soft: #ebe8fb; --mk-tone-violet-ink: #4535a8;
    --mk-tone-pink: #d55181;  --mk-tone-pink-soft: #fbe6ee;  --mk-tone-pink-ink: #9c2c55;
    --mk-tone-orange: #e0622f; --mk-tone-orange-soft: #fdeae1; --mk-tone-orange-ink: #9a3a12;
    --mk-tone-green: #15803d; --mk-tone-green-soft: #e1f4e7; --mk-tone-green-ink: #12602f;
    --mk-tone-amber: #d98a00; --mk-tone-amber-soft: #fdf1dc; --mk-tone-amber-ink: #8a4b05;
    --mk-tone-red: #d03b3b;   --mk-tone-red-soft: #fbe5e5;   --mk-tone-red-ink: #a12424;
}

[data-bs-theme="dark"] {
    --mk-bg: #0a1020;
    --mk-surface: #131d35;
    --mk-surface-2: #0f182c;
    --mk-border: #26345a;
    --mk-border-strong: #31426c;
    --mk-text: #edf2f9;
    --mk-text-2: #cfd8e6;
    --mk-muted: #9aaac4;
    --mk-thead: #18243f;
    --mk-heat-1: #133a3a; --mk-heat-2: #155a55; --mk-heat-3: #1d7f76; --mk-heat-4: #2aa598; --mk-heat-5: #5ad3c7;
    --mk-stage: #060b16;
    --mk-brand: #34c3b5;
    --mk-accent: #34c3b5;
    --mk-accent-strong: #34c3b5;
    --mk-accent-hover: #5ad3c7;
    --mk-accent-soft: rgba(52, 195, 181, 0.14);
    --mk-on-accent: #04211e;
    --mk-track: #1f2b47;
    --mk-bar: #1d7f76;
    --mk-bar-strong: #34c3b5;
    --mk-warn: #f5b544;
    --mk-warn-soft: rgba(245, 181, 68, 0.16);
    --mk-warn-ink: #f7c86f;
    --mk-info-soft: rgba(91, 156, 240, 0.16);
    --mk-info-ink: #9cc3f7;
    --mk-success: #4ade80;
    --mk-danger: #f47b7b;
    --mk-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    --mk-side-bg: #0d1529;
    --mk-side-border: #1f2b4a;
    --mk-side-text: #cfd8e6;
    --mk-side-muted: #9aaac4;
    --mk-side-hover: rgba(255, 255, 255, 0.06);
    --mk-side-active-bg: rgba(52, 195, 181, 0.16);
    --mk-side-active-text: #5ad3c7;
    --mk-side-brand: #34c3b5;
    --mk-side-card: #131d35;
    --mk-chart-1: #22a89b;
    --mk-chart-2: #3987e5;
    --mk-chart-3: #d95926;
    --mk-chart-4: #9085e9;
    --mk-chart-5: #94a3b8;
    --mk-tone-teal: #34c3b5;  --mk-tone-teal-soft: rgba(52, 195, 181, 0.16);  --mk-tone-teal-ink: #6fdccf;
    --mk-tone-blue: #5b9cf0;  --mk-tone-blue-soft: rgba(91, 156, 240, 0.16);  --mk-tone-blue-ink: #9cc3f7;
    --mk-tone-violet: #9085e9; --mk-tone-violet-soft: rgba(144, 133, 233, 0.18); --mk-tone-violet-ink: #c0b8f6;
    --mk-tone-pink: #e87ba4;  --mk-tone-pink-soft: rgba(232, 123, 164, 0.16);  --mk-tone-pink-ink: #f3abc6;
    --mk-tone-orange: #ef8354; --mk-tone-orange-soft: rgba(239, 131, 84, 0.16); --mk-tone-orange-ink: #f6ad8c;
    --mk-tone-green: #4ade80; --mk-tone-green-soft: rgba(74, 222, 128, 0.14); --mk-tone-green-ink: #86efac;
    --mk-tone-amber: #f5b544; --mk-tone-amber-soft: rgba(245, 181, 68, 0.16); --mk-tone-amber-ink: #f7c86f;
    --mk-tone-red: #f07171;   --mk-tone-red-soft: rgba(240, 113, 113, 0.16);  --mk-tone-red-ink: #f8a5a5;
}

/* ---- Bootstrap mapped onto the tokens ---- */
:root,
[data-bs-theme] {
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: 0.9375rem;
    --bs-body-bg: var(--mk-bg);
    --bs-body-color: var(--mk-text);
    --bs-emphasis-color: var(--mk-text);
    --bs-secondary-color: var(--mk-muted);
    --bs-secondary-bg: var(--mk-surface-2);
    --bs-tertiary-bg: var(--mk-surface-2);
    --bs-border-color: var(--mk-border);
    --bs-border-radius: 10px;
    --bs-border-radius-lg: 14px;
    --bs-link-color: var(--mk-accent-strong);
    --bs-link-color-rgb: 15, 127, 116;
    --bs-link-hover-color: var(--mk-accent-hover);
    --bs-link-hover-color-rgb: 12, 107, 98;
    --bs-focus-ring-color: color-mix(in srgb, var(--mk-accent) 35%, transparent);
    --bs-primary: var(--mk-accent-strong);
    --bs-card-bg: var(--mk-surface);
}

[data-bs-theme="dark"] {
    --bs-link-color-rgb: 52, 195, 181;
    --bs-link-hover-color-rgb: 90, 211, 199;
}

body {
    background: var(--mk-bg);
    color: var(--mk-text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--mk-text); letter-spacing: -0.01em; }
hr { border-color: var(--mk-border); opacity: 1; }
.text-muted { color: var(--mk-muted) !important; }

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-padding-x: 1rem;
    --bs-btn-padding-y: 0.5rem;
    --bs-btn-border-radius: 10px;
    --bs-btn-focus-box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

.btn-primary,
.btn-stc,
.themeBtn {
    --bs-btn-color: var(--mk-on-accent);
    --bs-btn-bg: var(--mk-accent-strong);
    --bs-btn-border-color: var(--mk-accent-strong);
    --bs-btn-hover-color: var(--mk-on-accent);
    --bs-btn-hover-bg: var(--mk-accent-hover);
    --bs-btn-hover-border-color: var(--mk-accent-hover);
    --bs-btn-active-color: var(--mk-on-accent);
    --bs-btn-active-bg: var(--mk-accent-hover);
    --bs-btn-active-border-color: var(--mk-accent-hover);
    --bs-btn-disabled-color: var(--mk-on-accent);
    --bs-btn-disabled-bg: var(--mk-accent-strong);
    --bs-btn-disabled-border-color: var(--mk-accent-strong);
}

.btn-outline-secondary,
.btn-light,
.btn-default {
    --bs-btn-color: var(--mk-text-2);
    --bs-btn-bg: var(--mk-surface);
    --bs-btn-border-color: var(--mk-border-strong);
    --bs-btn-hover-color: var(--mk-text);
    --bs-btn-hover-bg: var(--mk-surface-2);
    --bs-btn-hover-border-color: var(--mk-border-strong);
    --bs-btn-active-color: var(--mk-text);
    --bs-btn-active-bg: var(--mk-surface-2);
    --bs-btn-active-border-color: var(--mk-border-strong);
}

.form-control,
.form-select {
    background-color: var(--mk-surface);
    border-color: var(--mk-border-strong);
    color: var(--mk-text);
    border-radius: 10px;
    min-height: 2.75rem;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--mk-accent);
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}
.form-check-input:checked { background-color: var(--mk-accent-strong); border-color: var(--mk-accent-strong); }
.form-label,
.control-label { font-weight: 500; font-size: 0.875rem; color: var(--mk-text-2); margin-bottom: 0.375rem; display: inline-block; }

.card {
    --bs-card-bg: var(--mk-surface);
    --bs-card-border-color: var(--mk-border);
    --bs-card-border-radius: 14px;
    --bs-card-cap-bg: transparent;
    box-shadow: var(--mk-shadow);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--mk-text);
    --bs-table-border-color: var(--mk-border);
    --bs-table-striped-bg: var(--mk-surface-2);
    --bs-table-striped-color: var(--mk-text);
    --bs-table-hover-bg: var(--mk-accent-soft);
    --bs-table-hover-color: var(--mk-text);
}
.table > thead th,
.table > thead > tr.text-muted th {
    color: var(--mk-text-2);
    background: var(--mk-thead);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--mk-border-strong);
    white-space: nowrap;
}
.table > thead th:first-child { border-top-left-radius: 8px; }
.table > thead th:last-child { border-top-right-radius: 8px; }
.table > tbody > tr > td { vertical-align: middle; }
.table .btn { --bs-btn-padding-y: 0.3rem; --bs-btn-padding-x: 0.7rem; --bs-btn-font-size: 0.8125rem; }
.table-borderless > tbody > tr > td { border-top: 1px solid var(--mk-border); }

.modal { --bs-modal-bg: var(--mk-surface); --bs-modal-border-color: var(--mk-border); --bs-modal-border-radius: 16px; }
.dropdown-menu { --bs-dropdown-bg: var(--mk-surface); --bs-dropdown-border-color: var(--mk-border); --bs-dropdown-link-color: var(--mk-text-2); --bs-dropdown-link-hover-bg: var(--mk-surface-2); --bs-dropdown-link-active-bg: var(--mk-accent-soft); --bs-dropdown-link-active-color: var(--mk-accent-strong); border-radius: 12px; }
.nav-tabs { --bs-nav-tabs-border-color: var(--mk-border); --bs-nav-tabs-link-active-bg: var(--mk-surface); --bs-nav-tabs-link-active-border-color: var(--mk-border) var(--mk-border) var(--mk-surface); --bs-nav-link-color: var(--mk-muted); --bs-nav-link-hover-color: var(--mk-text); }
.nav-tabs .nav-link.active { color: var(--mk-accent-strong); font-weight: 600; }
.alert { border-radius: 12px; }
.alert-success { --bs-alert-bg: var(--mk-accent-soft); --bs-alert-color: var(--mk-accent-strong); --bs-alert-border-color: transparent; }

/* ---- App shell ---- */
.mk-shell { display: flex; min-height: 100vh; }

.mk-sidebar {
    flex: 0 0 248px;
    width: 248px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
    background: var(--mk-side-bg);
    border-right: 1px solid var(--mk-side-border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 1040;
}

.mk-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; color: var(--mk-text); }
.mk-brand:hover { color: var(--mk-text); }
.mk-sidebar .mk-brand-mark, .mk-sidebar .mk-brand-logo { background: var(--mk-side-brand); }
.mk-brand-full { flex-direction: column; align-items: flex-start; gap: 6px; }
.mk-sidebar .mk-brand-logo { width: 176px; }
.mk-sidebar .mk-brand-sub { color: var(--mk-side-muted); }
/* Logo images are single-colour cutouts used as masks, so they follow the theme. */
.mk-brand-mark, .mk-brand-logo { display: block; flex: none; background: var(--mk-brand); -webkit-mask: var(--mk-logo) center / contain no-repeat; mask: var(--mk-logo) center / contain no-repeat; }
.mk-brand-mark { --mk-logo: url(../images/brand/makeena-mark.png); width: 32px; height: 39px; }
.mk-brand-logo { --mk-logo: url(../images/brand/makeena-logo.png); width: 200px; aspect-ratio: 960 / 290; }
.mk-brand-name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.mk-brand-sub { font-size: 12px; color: var(--mk-muted); }

.mk-nav { display: flex; flex-direction: column; gap: 2px; }
.mk-nav a {
    display: flex; align-items: center; gap: 12px;
    min-height: 44px; padding: 0 12px; border-radius: 10px;
    color: var(--mk-side-text); text-decoration: none; font-size: 14px; font-weight: 500;
}
.mk-nav a:hover { background: var(--mk-side-hover); color: var(--mk-text); }
.mk-nav a.active { background: var(--mk-side-active-bg); color: var(--mk-side-active-text); font-weight: 700; box-shadow: inset 3px 0 0 var(--mk-accent); }
.mk-nav .bi { font-size: 18px; width: 18px; display: inline-flex; justify-content: center; }

.mk-wallet { margin-top: auto; padding: 14px; border-radius: 12px; background: var(--mk-side-card); border: 1px solid var(--mk-border); display: flex; flex-direction: column; gap: 4px; color: var(--mk-tone-teal-ink); }
[data-bs-theme="dark"] .mk-wallet { color: var(--mk-accent-strong); }
.mk-wallet span:first-child { font-size: 12px; color: var(--mk-side-muted); }
.mk-wallet strong { font-size: 20px; font-variant-numeric: tabular-nums; }

.mk-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.mk-topbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 20px 32px 0; }
.mk-topbar .mk-menu-btn { margin-right: auto; display: none; }

.mk-icon-btn {
    width: 44px; height: 44px; flex: 0 0 44px;
    border-radius: 10px; border: 1px solid var(--mk-border-strong);
    background: var(--mk-surface); color: var(--mk-text-2);
    display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.mk-icon-btn:hover { background: var(--mk-surface-2); color: var(--mk-text); }
.mk-avatar {
    height: 44px; display: inline-flex; align-items: center; gap: 10px;
    padding: 0 12px 0 4px; border-radius: 999px; border: 1px solid var(--mk-border-strong);
    background: var(--mk-surface); color: var(--mk-text-2); font-weight: 600; font-size: 14px;
}
.mk-avatar-initials {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--mk-accent-soft); color: var(--mk-accent-strong);
    display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}

.mk-content { padding: 20px 32px 48px; display: flex; flex-direction: column; gap: 20px; }

/* Theme icon: show the moon in light mode, the sun in dark mode */
[data-bs-theme="light"] .mk-theme-dark-icon,
[data-bs-theme="dark"] .mk-theme-light-icon { display: none; }
[data-bs-theme="dark"] .mk-theme-dark-icon { color: #f5c46b; }

.mk-backdrop { display: none; }

@media (max-width: 991.98px) {
    .mk-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform 0.2s ease; }
    .mk-sidebar.show { transform: none; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25); }
    .mk-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(5, 10, 20, 0.45); z-index: 1030; }
    .mk-topbar { padding: 16px 16px 0; }
    .mk-topbar .mk-menu-btn { display: inline-flex; }
    .mk-content { padding: 16px 16px 40px; }
    .mk-avatar-name { display: none; }
}

/* ---- Page building blocks ---- */
.mk-page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.mk-page-header h1 { margin: 0; font-size: 1.625rem; font-weight: 700; }
.mk-page-header .mk-subtitle { font-size: 0.875rem; color: var(--mk-muted); }

.mk-card,
.customPanel,
.gridPanel {
    background: var(--mk-surface);
    border: 1px solid var(--mk-border);
    border-radius: 14px;
    padding: 22px;
    box-shadow: var(--mk-shadow);
    width: 100%;
}
.mk-card-title { margin: 0; font-size: 1.0625rem; font-weight: 700; }

/* Legacy page header: <div class="clearfix"><h4 class="float-start">Title</h4> …actions…</div><hr> (the page's first div) */
.mk-content > .clearfix:first-of-type,
.mk-content > div > .clearfix:first-of-type {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.mk-content > .clearfix:first-of-type::after,
.mk-content > div > .clearfix:first-of-type::after { display: none; }
.mk-content > .clearfix:first-of-type > h4,
.mk-content > div > .clearfix:first-of-type > h4 { margin: 0; font-size: 1.625rem; font-weight: 700; float: none !important; }
.mk-content > .clearfix:first-of-type > a,
.mk-content > div > .clearfix:first-of-type > a { float: none !important; }
.mk-content > .clearfix:first-of-type + hr,
.mk-content > div > .clearfix:first-of-type + hr { display: none; }

.mk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.mk-kpi {
    --mk-tone: var(--mk-tone-teal); --mk-tone-soft: var(--mk-tone-teal-soft); --mk-tone-ink: var(--mk-tone-teal-ink);
    position: relative; overflow: hidden;
    background: var(--mk-surface); border: 1px solid var(--mk-border); border-radius: 14px; padding: 20px;
    display: flex; flex-direction: column; gap: 10px; box-shadow: var(--mk-shadow);
}
.mk-kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--mk-tone); }
.mk-kpi-label { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--mk-text-2); }
.mk-kpi-icon {
    width: 34px; height: 34px; flex: none; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--mk-tone-soft); color: var(--mk-tone-ink); font-size: 17px;
}

/* Tones: set on a KPI tile or any element that reads --mk-tone* (badges, meters). */
.mk-tone-teal { --mk-tone: var(--mk-tone-teal); --mk-tone-soft: var(--mk-tone-teal-soft); --mk-tone-ink: var(--mk-tone-teal-ink); }
.mk-tone-blue { --mk-tone: var(--mk-tone-blue); --mk-tone-soft: var(--mk-tone-blue-soft); --mk-tone-ink: var(--mk-tone-blue-ink); }
.mk-tone-violet { --mk-tone: var(--mk-tone-violet); --mk-tone-soft: var(--mk-tone-violet-soft); --mk-tone-ink: var(--mk-tone-violet-ink); }
.mk-tone-pink { --mk-tone: var(--mk-tone-pink); --mk-tone-soft: var(--mk-tone-pink-soft); --mk-tone-ink: var(--mk-tone-pink-ink); }
.mk-tone-orange { --mk-tone: var(--mk-tone-orange); --mk-tone-soft: var(--mk-tone-orange-soft); --mk-tone-ink: var(--mk-tone-orange-ink); }
.mk-tone-green { --mk-tone: var(--mk-tone-green); --mk-tone-soft: var(--mk-tone-green-soft); --mk-tone-ink: var(--mk-tone-green-ink); }
.mk-tone-amber { --mk-tone: var(--mk-tone-amber); --mk-tone-soft: var(--mk-tone-amber-soft); --mk-tone-ink: var(--mk-tone-amber-ink); }
.mk-tone-red { --mk-tone: var(--mk-tone-red); --mk-tone-soft: var(--mk-tone-red-soft); --mk-tone-ink: var(--mk-tone-red-ink); }
.mk-kpi-value { font-size: clamp(22px, 2vw, 28px); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-kpi-unit { font-size: 0.55em; font-weight: 600; color: var(--mk-muted); margin-right: 6px; letter-spacing: 0; }
.mk-kpi-note { font-size: 13px; color: var(--mk-muted); }

.mk-row { display: flex; flex-wrap: wrap; gap: 16px; }
.mk-grow-2 { flex: 2 1 520px; min-width: 0; }
.mk-grow-1 { flex: 1 1 300px; min-width: 0; }

.mk-progress { height: 10px; border-radius: 99px; background: var(--mk-track); overflow: hidden; }
.mk-progress > div { height: 100%; border-radius: 99px; background: var(--mk-tone, var(--mk-accent)); }
.mk-progress.mk-warn > div { background: var(--mk-warn); }

.mk-chip { display: inline-block; padding: 6px 10px; border-radius: 8px; background: var(--mk-warn-soft); color: var(--mk-warn-ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.mk-badge { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--mk-tone-soft); color: var(--mk-tone-ink); }
.mk-badge-coin { background: var(--mk-tone-teal-soft); color: var(--mk-tone-teal-ink); }
.mk-badge-read { background: var(--mk-tone-blue-soft); color: var(--mk-tone-blue-ink); }
.mk-badge-off { background: var(--mk-surface-2); color: var(--mk-muted); border: 1px solid var(--mk-border); }
/* Machine types (Machine.Type): badges, and meters (tinted track + fill) */
.mk-type-snack { --mk-tone: var(--mk-tone-orange); --mk-tone-soft: var(--mk-tone-orange-soft); --mk-tone-ink: var(--mk-tone-orange-ink); background: var(--mk-tone-orange-soft); color: var(--mk-tone-orange-ink); }
.mk-type-coffee { --mk-tone: var(--mk-tone-violet); --mk-tone-soft: var(--mk-tone-violet-soft); --mk-tone-ink: var(--mk-tone-violet-ink); background: var(--mk-tone-violet-soft); color: var(--mk-tone-violet-ink); }
.mk-type-drinks { --mk-tone: var(--mk-tone-blue); --mk-tone-soft: var(--mk-tone-blue-soft); --mk-tone-ink: var(--mk-tone-blue-ink); background: var(--mk-tone-blue-soft); color: var(--mk-tone-blue-ink); }
.mk-type-combo { --mk-tone: var(--mk-tone-pink); --mk-tone-soft: var(--mk-tone-pink-soft); --mk-tone-ink: var(--mk-tone-pink-ink); background: var(--mk-tone-pink-soft); color: var(--mk-tone-pink-ink); }

/* Link tiles (e.g. Reports): icon + title + one line */
.mk-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.mk-tile {
    display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 14px;
    background: var(--mk-surface); border: 1px solid var(--mk-border); box-shadow: var(--mk-shadow);
    color: var(--mk-text); text-decoration: none;
}
.mk-tile:hover { border-color: var(--mk-tone, var(--mk-accent)); color: var(--mk-text); }
.mk-tile .mk-kpi-icon { width: 44px; height: 44px; font-size: 20px; }
.mk-tile strong { display: block; font-size: 1rem; }
.mk-tile span.text-muted { font-size: 13px; }
.mk-tile .bi-chevron-right { margin-left: auto; color: var(--mk-muted); }

.mk-num { font-variant-numeric: tabular-nums; }
.mk-in { color: var(--mk-success); }
.mk-out { color: var(--mk-danger); }

/* ---- Legacy classes still used by views ---- */
.green { color: var(--mk-accent-strong); }
.gold { color: var(--mk-warn); }
.purpleText { color: #8d579a; }
.bgGreen { background-color: var(--mk-accent-strong); color: var(--mk-on-accent); }
.bgSilver { background-color: var(--mk-surface-2); color: var(--mk-text-2); }
.big-font-size { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.error { color: var(--mk-danger); font-size: 14px; }
.field-validation-error, .validation-summary-errors { color: var(--mk-danger); font-size: 14px; }


/* ---- Third-party widgets ---- */
.ui-datepicker {
    background: var(--mk-surface) !important; color: var(--mk-text) !important;
    border: 1px solid var(--mk-border) !important; border-radius: 12px !important;
    padding: 8px !important; box-shadow: 0 10px 30px rgba(16, 24, 40, 0.15); font-family: inherit !important;
}
.ui-datepicker .ui-widget-header { background: transparent !important; border: 0 !important; color: var(--mk-text) !important; }
.ui-datepicker .ui-state-default { background: transparent !important; border: 1px solid transparent !important; color: var(--mk-text-2) !important; border-radius: 8px; text-align: center; }
.ui-datepicker .ui-state-hover { background: var(--mk-surface-2) !important; }
.ui-datepicker .ui-state-active, .ui-datepicker .ui-state-highlight { background: var(--mk-accent-soft) !important; color: var(--mk-accent-strong) !important; font-weight: 600; }
.ui-datepicker select { background: var(--mk-surface); color: var(--mk-text); border: 1px solid var(--mk-border-strong); border-radius: 6px; }
.ui-datepicker .ui-datepicker-buttonpane button { background: var(--mk-surface-2) !important; color: var(--mk-text) !important; border: 1px solid var(--mk-border) !important; border-radius: 8px; }

div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_length select { background-color: var(--mk-surface); color: var(--mk-text); border-color: var(--mk-border-strong); }
div.dataTables_wrapper .pagination { --bs-pagination-color: var(--mk-text-2); --bs-pagination-bg: var(--mk-surface); --bs-pagination-border-color: var(--mk-border); --bs-pagination-hover-bg: var(--mk-surface-2); --bs-pagination-active-bg: var(--mk-accent-strong); --bs-pagination-active-border-color: var(--mk-accent-strong); --bs-pagination-active-color: var(--mk-on-accent); --bs-pagination-disabled-bg: var(--mk-surface); --bs-pagination-disabled-color: var(--mk-muted); }

.select2-container--default .select2-selection--single { background: var(--mk-surface); border-color: var(--mk-border-strong); border-radius: 10px; min-height: 2.75rem; display: flex; align-items: center; }
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--mk-text); line-height: 1.5; padding-left: 0.75rem; }
.select2-container--default .select2-selection--single .select2-selection__arrow { top: 50%; transform: translateY(-50%); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 100%; }
.select2-dropdown { background: var(--mk-surface); color: var(--mk-text); border-color: var(--mk-border); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--mk-accent-strong); color: var(--mk-on-accent); }
.select2-search--dropdown .select2-search__field { background: var(--mk-surface); color: var(--mk-text); border-color: var(--mk-border-strong); }

/* ---- Sign-in page ---- */
.mk-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.mk-auth-card { width: 100%; max-width: 420px; background: var(--mk-surface); border: 1px solid var(--mk-border); border-radius: 18px; padding: 32px; box-shadow: 0 10px 40px rgba(16, 24, 40, 0.06); display: flex; flex-direction: column; gap: 20px; }
.mk-auth-card h1 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.mk-auth-theme { position: fixed; top: 16px; right: 16px; }

/* ---- Month / day picker (app.js, form[data-mk-period]) ---- */
.mk-period-toggle { display: flex; align-items: center; gap: 8px; width: auto; cursor: pointer; white-space: nowrap; }
.mk-period-menu { width: 296px; padding: 12px; }
.mk-period-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.mk-period-head button { height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--mk-text); }
.mk-period-head button:hover:not(:disabled) { background: var(--mk-surface-2); }
.mk-period-head button:disabled { color: var(--mk-muted); opacity: 0.5; }
.mk-period-nav { width: 36px; flex: none; }
.mk-period-title { flex: 1; font-weight: 600; }
.mk-period-title:disabled { color: var(--mk-text) !important; opacity: 1 !important; }
.mk-period-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mk-period-grid.mk-days { grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mk-period-dow { padding: 2px 0; text-align: center; font-size: 11px; color: var(--mk-muted); }
.mk-period-cell { height: 44px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--mk-text-2); font-size: 14px; }
.mk-days .mk-period-cell { height: 36px; }
.mk-period-cell:hover:not(:disabled) { background: var(--mk-surface-2); color: var(--mk-text); }
.mk-period-cell.is-now { border-color: var(--mk-accent); }
.mk-period-cell[aria-pressed="true"],
.mk-period-cell[aria-pressed="true"]:hover { background: var(--mk-accent-strong); color: var(--mk-on-accent); }
.mk-period-cell:disabled { color: var(--mk-muted); opacity: 0.45; }
.mk-period-foot { display: flex; align-items: center; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--mk-border); }
.mk-period-sel { flex: 1; font-size: 13px; font-weight: 600; color: var(--mk-text); }

/* ---- Daily operations feed ---- */
.mk-kpis-5 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.mk-warn-text { color: var(--mk-warn) !important; }
.mk-badge-warn { background: var(--mk-warn-soft); color: var(--mk-warn-ink); }

.mk-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--mk-surface-2); border: 1px solid var(--mk-border); }
.mk-seg label { min-height: 34px; padding: 0 12px; border-radius: 8px; display: inline-flex; align-items: center; font-size: 0.875rem; color: var(--mk-muted); cursor: pointer; }
.mk-seg .btn-check:checked + label { background: var(--mk-surface); color: var(--mk-text); font-weight: 600; box-shadow: var(--mk-shadow); }
.mk-seg .btn-check:focus-visible + label { outline: 2px solid var(--mk-accent); outline-offset: 1px; }

.mk-op { display: flex; flex-wrap: wrap; gap: 18px; padding: 18px; }
.mk-op-info { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.mk-op-machine { font-size: 1.0625rem; font-weight: 700; }
.mk-op-machine span { font-weight: 400; color: var(--mk-muted); }
.mk-op-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding-top: 10px; border-top: 1px solid var(--mk-border); }
.mk-op-values dt { font-size: 0.75rem; font-weight: 500; color: var(--mk-muted); }
.mk-op-values dd { margin: 0; font-size: 1rem; font-weight: 700; }
.mk-op-photos { flex: 1 1 260px; display: flex; gap: 10px; }

.mk-photo {
    flex: 1 1 0; min-width: 0; min-height: 140px; position: relative; overflow: hidden;
    border-radius: 12px; border: 1px solid var(--mk-border-strong); background: var(--mk-surface-2); color: var(--mk-text-2);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0; font: inherit;
}
.mk-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mk-photo span { position: relative; font-size: 12px; font-weight: 600; }
.mk-photo img + span { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(5, 10, 20, 0.6); color: #ffffff; }
button.mk-photo:hover { border-color: var(--mk-accent); }
button.mk-photo:focus-visible { outline: 2px solid var(--mk-accent); outline-offset: 2px; }
.mk-photo-missing { border: 2px dashed var(--mk-warn); background: var(--mk-warn-soft); color: var(--mk-warn-ink); }

.mk-stale-list { max-height: 360px; overflow-y: auto; }

/* ---- Analytics ---- */
.mk-section-title { margin: 4px 0 0; display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 700; color: var(--mk-text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.mk-section-title::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--mk-accent); }
/* Stat strip: one card, a header and four cells divided by 1px gaps (the grid background shows through). */
.mk-strip {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
    background: var(--mk-border); border: 1px solid var(--mk-border); border-radius: 14px; overflow: hidden; box-shadow: var(--mk-shadow);
}
.mk-strip-head {
    grid-column: 1 / -1; margin: 0; padding: 8px 16px; display: flex; align-items: center; gap: 8px; background: var(--mk-thead);
    font-size: 0.6875rem; font-weight: 700; color: var(--mk-text-2); text-transform: uppercase; letter-spacing: 0.07em;
}
.mk-strip-head::before { content: ""; width: 4px; height: 12px; border-radius: 2px; background: var(--mk-accent); }
:where(.mk-stat) { --mk-tone: var(--mk-tone-teal); --mk-tone-soft: var(--mk-tone-teal-soft); --mk-tone-ink: var(--mk-tone-teal-ink); } /* default; .mk-tone-* wins */
.mk-stat {
    position: relative; min-width: 0; padding: 12px 16px 13px; display: flex; flex-direction: column; gap: 3px; background: var(--mk-surface);
}
.mk-stat::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--mk-tone); }
.mk-stat-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--mk-text-2); }
.mk-stat-label .bi {
    width: 24px; height: 24px; flex: none; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; background: var(--mk-tone-soft); color: var(--mk-tone-ink);
}
.mk-stat-value { font-size: 1.375rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-stat-value small { margin-right: 4px; font-size: 0.55em; font-weight: 600; letter-spacing: 0; color: var(--mk-muted); }
.mk-stat-note { font-size: 12px; color: var(--mk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 991.98px) { .mk-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) {
    .mk-stat { padding: 10px 12px 11px; }
    .mk-stat-value { font-size: 1.125rem; }
    .mk-stat-label { font-size: 12px; gap: 6px; }
}

/* ---- People (Users page) ---- */
.mk-section-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.mk-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px;
    background: var(--mk-surface); border: 1px solid var(--mk-border); font-size: 11px; font-weight: 700; color: var(--mk-text-2); letter-spacing: 0;
}
.mk-search { position: relative; display: block; }
.mk-search .bi { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--mk-muted); pointer-events: none; }
.mk-search .form-control { padding-left: 38px; min-width: 260px; }
@media (max-width: 575.98px) { .mk-search, .mk-search .form-control { min-width: 0; width: 100%; } }

.mk-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.mk-people-staff { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.mk-people-idle { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.mk-people-idle .mk-person { padding: 10px 14px; box-shadow: none; }
.mk-people-idle .mk-person-avatar { width: 34px; height: 34px; font-size: 13px; border-radius: 10px; }
.mk-subsection-title { margin: 4px 0 0; display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 700; color: var(--mk-muted); }
.mk-person {
    min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px;
    background: var(--mk-surface); border: 1px solid var(--mk-border); border-radius: 14px; box-shadow: var(--mk-shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.mk-person:hover { border-color: var(--mk-border-strong); box-shadow: 0 8px 22px rgba(16, 24, 40, 0.08); transform: translateY(-1px); }
.mk-person.is-disabled { opacity: 0.6; }
.mk-person[hidden] { display: none; }
.mk-person-compact { gap: 10px; }
.mk-person-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mk-person-who { flex: 1; min-width: 0; }
.mk-person-name { font-size: 15px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-person-sub { font-size: 12.5px; color: var(--mk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-person-avatar {
    position: relative; flex: none; width: 42px; height: 42px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
    background: var(--mk-tone-soft); color: var(--mk-tone-ink);
}
.mk-presence { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--mk-surface); background: var(--mk-border-strong); }
.mk-presence.is-today { background: var(--mk-tone-green); }
.mk-presence.is-week { background: var(--mk-tone-teal); }
.mk-presence.is-month { background: var(--mk-tone-amber); }
.mk-fresh { flex: none; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--mk-surface-2); color: var(--mk-muted); }
.mk-fresh.is-today { background: var(--mk-tone-green-soft); color: var(--mk-tone-green-ink); }
.mk-fresh.is-week { background: var(--mk-tone-teal-soft); color: var(--mk-tone-teal-ink); }
.mk-fresh.is-month { background: var(--mk-tone-amber-soft); color: var(--mk-tone-amber-ink); }
.mk-dots { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--mk-muted); display: inline-flex; align-items: center; justify-content: center; }
.mk-dots:hover, .mk-dots[aria-expanded="true"] { background: var(--mk-surface-2); color: var(--mk-text); }

.mk-person-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--mk-border); border: 1px solid var(--mk-border); border-radius: 10px; overflow: hidden; }
.mk-person-stats > div { min-width: 0; padding: 7px 10px; display: flex; flex-direction: column; background: var(--mk-surface-2); }
.mk-person-stats span { font-size: 11px; font-weight: 600; color: var(--mk-muted); }
.mk-person-stats strong { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-person-stats small { font-size: 10px; font-weight: 600; color: var(--mk-muted); }

.mk-spark { display: flex; align-items: flex-end; gap: 2px; height: 34px; }
.mk-spark i { flex: 1; min-width: 0; border-radius: 2px 2px 0 0; background: var(--mk-bar); }
.mk-spark i.is-zero { background: var(--mk-track); }
.mk-spark i.is-today { background: var(--mk-bar-strong); }
.mk-spark-caption { display: flex; justify-content: space-between; margin-top: 3px; font-size: 10.5px; color: var(--mk-muted); }

.mk-person-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding-top: 10px; border-top: 1px solid var(--mk-border); font-size: 12.5px; color: var(--mk-text-2); }

/* People tables (Users page): tall rows with avatar, badges and an inline sparkline */
.mk-card.mk-card-flush { padding: 0; overflow: hidden; }
.mk-table-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; }
.mk-table-people > thead th { padding: 10px 14px; border-radius: 0 !important; }
.mk-table-people > thead th:first-child, .mk-table-people > tbody td:first-child { padding-left: 18px; }
.mk-table-people > thead th:last-child, .mk-table-people > tbody td:last-child { padding-right: 18px; }
.mk-table-people > tbody td { padding: 12px 14px; vertical-align: middle; border-color: var(--mk-border); }
.mk-table-people > tbody tr:hover > td { background: var(--mk-surface-2); }
.mk-table-people > tbody tr:last-child > td { border-bottom: 0; }
.mk-table-people > tbody tr.is-disabled > td { opacity: 0.55; }
.mk-table-people > tbody tr.is-idle .mk-person-name { color: var(--mk-text-2); }
.mk-table-people tr[hidden] { display: none; }
.mk-table-people .mk-person-head { min-width: 190px; }
.mk-table-people .mk-person-avatar { width: 38px; height: 38px; font-size: 14px; border-radius: 11px; }
.mk-spark-inline { width: 120px; height: 26px; gap: 1px; }

/* Account on/off, banners, row links and menu items (Users) */
.mk-account { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.mk-account .bi { font-size: 8px; }
.mk-account.is-on { background: var(--mk-tone-green-soft); color: var(--mk-tone-green-ink); }
.mk-account.is-off { background: var(--mk-tone-red-soft); color: var(--mk-tone-red-ink); }
.mk-account.is-off .bi { font-size: 12px; }
.mk-table-people > tbody tr.is-disabled > td:has(.mk-account) { opacity: 1; }
.mk-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px;
    background: var(--mk-info-soft); color: var(--mk-info-ink); border: 1px solid color-mix(in srgb, var(--mk-info-ink) 18%, transparent); font-size: 14px;
}
.mk-person-link { color: inherit; text-decoration: none; }
.mk-person-link:hover .mk-person-name { color: var(--mk-accent-strong); text-decoration: underline; }
.dropdown-item.mk-danger-item { color: var(--mk-tone-red-ink); }
.dropdown-item.mk-success-item { color: var(--mk-tone-green-ink); }
.min-w-0 { min-width: 0; }

/* User pages (Update, Change password, Visits, Add): profile panel + forms */
.mk-profile-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.mk-profile-layout-end { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 991.98px) { .mk-profile-layout, .mk-profile-layout-end { grid-template-columns: minmax(0, 1fr); } }
.mk-profile {
    position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; padding: 18px;
    background: var(--mk-surface); border: 1px solid var(--mk-border); border-radius: 14px; box-shadow: var(--mk-shadow);
}
@media (max-width: 991.98px) { .mk-profile { position: static; } }
.mk-profile-hero { display: flex; align-items: center; gap: 14px; margin: -18px -18px 0; padding: 18px; border-radius: 14px 14px 0 0; background: linear-gradient(135deg, var(--mk-tone-soft), transparent 75%); }
.mk-person-avatar.mk-person-avatar-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; background: var(--mk-surface); box-shadow: 0 0 0 3px var(--mk-tone-soft); }
.mk-profile-name { font-size: 17px; font-weight: 700; line-height: 1.25; }
.mk-profile-facts { display: flex; flex-direction: column; margin: 0; border-top: 1px solid var(--mk-border); }
.mk-profile-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--mk-border); font-size: 13px; }
.mk-profile-facts dt { font-weight: 500; color: var(--mk-muted); white-space: nowrap; }
.mk-profile-facts dd { margin: 0; min-width: 0; font-weight: 600; text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.mk-profile-nav { display: flex; flex-direction: column; gap: 2px; }
.mk-profile-nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 10px; color: var(--mk-text-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.mk-profile-nav a:hover { background: var(--mk-surface-2); color: var(--mk-text); }
.mk-profile-nav a.active { background: var(--mk-accent-soft); color: var(--mk-accent-strong); font-weight: 700; box-shadow: inset 3px 0 0 var(--mk-accent); }
.mk-profile-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; text-decoration: none; }

.mk-form-card { display: flex; flex-direction: column; gap: 16px; }
.mk-form-card > header p { margin: 4px 0 0; font-size: 13px; color: var(--mk-muted); }
.mk-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
@media (max-width: 767.98px) { .mk-form-grid { grid-template-columns: minmax(0, 1fr); } }
.mk-hint { display: block; margin-top: 5px; font-size: 12px; color: var(--mk-muted); }
.mk-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 12px; background: var(--mk-surface-2); border: 1px solid var(--mk-border); cursor: pointer; }
.mk-switch-row strong { display: block; font-size: 14px; }
.mk-switch-row small { display: block; font-size: 12.5px; color: var(--mk-muted); }
.mk-switch-row .form-check-input { width: 3em; height: 1.6em; cursor: pointer; }
.mk-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.mk-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--mk-surface-2); font-size: 12.5px; color: var(--mk-text-2); }
.mk-note .bi { color: var(--mk-accent-strong); margin-top: 1px; }
.mk-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--mk-text-2); }
.mk-steps strong { color: var(--mk-text); }
.mk-strip.mk-strip-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 575.98px) { .mk-strip.mk-strip-3 { grid-template-columns: minmax(0, 1fr); } }
.mk-table-people > tbody tr.mk-day-row > th { padding: 8px 18px; background: var(--mk-surface-2); font-size: 12.5px; font-weight: 700; color: var(--mk-text-2); border-color: var(--mk-border); }

/* Machines list */
.mk-machine-name { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-type-none { --mk-tone: var(--mk-muted); --mk-tone-soft: var(--mk-surface-2); --mk-tone-ink: var(--mk-muted); background: var(--mk-surface-2); color: var(--mk-muted); }
.mk-spark-months { width: 96px; gap: 3px; }
.mk-table-people > tbody tr.is-highlight > td { background: var(--mk-accent-soft); }
.mk-table-people > tbody tr.is-highlight > td:first-child { box-shadow: inset 3px 0 0 var(--mk-accent); }

/* ---- Reports: photo journal and viewer ---- */
.mk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 14px; }
.mk-seg a { min-height: 34px; padding: 0 12px; border-radius: 8px; display: inline-flex; align-items: center; font-size: 0.875rem; color: var(--mk-muted); text-decoration: none; }
.mk-seg a:hover { color: var(--mk-text); }
.mk-seg a.is-on { background: var(--mk-surface); color: var(--mk-text); font-weight: 600; box-shadow: var(--mk-shadow); }
.mk-journal-day { display: flex; flex-direction: column; gap: 10px; }
.mk-journal-day[hidden] { display: none; }

/* Timeline: one slim row per transaction on a vertical time rail; small photo thumbnails on the right. */
.mk-timeline { padding: 6px 0; }
.mk-tl { position: relative; }
.mk-tl[hidden] { display: none; }
/* The rail is drawn in the dot's own column (stretched to the row's full height), so it lines up at any width. */
.mk-tl-rail { position: relative; align-self: stretch; display: flex; align-items: center; justify-content: center; margin: -9px 0; }
.mk-tl-rail::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--mk-border); }
.mk-tl:first-child .mk-tl-rail::before { top: 50%; }
.mk-tl:last-child .mk-tl-rail::before { bottom: 50%; }
.mk-tl:only-child .mk-tl-rail::before { display: none; }
.mk-tl-row {
    position: relative; width: 100%; display: grid; align-items: center; gap: 14px; padding: 9px 18px;
    grid-template-columns: 44px 26px minmax(0, 1fr) 190px auto 14px;
    border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer;
}
.mk-tl-row:hover { background: var(--mk-surface-2); }
.mk-tl-row:focus-visible { outline: 2px solid var(--mk-accent); outline-offset: -2px; }
.mk-tl.is-missing .mk-tl-row { box-shadow: inset 3px 0 0 var(--mk-warn); }
.mk-tl-time { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--mk-text-2); text-align: right; }
.mk-tl-dot {
    position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--mk-tone-soft); color: var(--mk-tone-ink); font-size: 13px; box-shadow: 0 0 0 3px var(--mk-surface);
}
.mk-tl-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mk-tl-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.mk-tl-title span { color: var(--mk-muted); }
.mk-tl-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--mk-muted); white-space: nowrap; overflow: hidden; }
.mk-tl-figures { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.mk-shot-big { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-shot-big small { font-size: 0.7em; font-weight: 600; color: var(--mk-muted); }
.mk-shot-small { font-size: 12px; color: var(--mk-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mk-tl-thumbs { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 128px; }
.mk-tl-arrow { font-size: 12px; color: var(--mk-muted); }
.mk-tl-open { color: var(--mk-muted); font-size: 13px; }
.mk-tl-row:hover .mk-tl-open { color: var(--mk-accent-strong); }

/* Photo slot (thumbnail, broken or missing) */
.mk-shot-photo {
    position: relative; flex: none; width: 52px; height: 52px; border-radius: 10px; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; background: var(--mk-stage);
    box-shadow: 0 0 0 1px var(--mk-border); color: rgba(255, 255, 255, 0.75); font-size: 16px;
}
.mk-shot-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s ease; }
.mk-tl-row:hover .mk-shot-photo img { transform: scale(1.08); }
.mk-shot-photo-broken { display: none; }
.mk-shot-photo.is-broken img { display: none; }
.mk-shot-photo.is-broken .mk-shot-photo-broken { display: inline-flex; }
.mk-shot-photo.is-none { background: repeating-linear-gradient(135deg, var(--mk-warn-soft) 0 6px, var(--mk-surface) 6px 12px); color: var(--mk-warn-ink); box-shadow: 0 0 0 1px var(--mk-warn); }

@media (max-width: 767.98px) {
    .mk-tl-row { grid-template-columns: 44px 26px minmax(0, 1fr); row-gap: 8px; align-items: start; }
    .mk-tl-time { grid-column: 1; grid-row: 1; padding-top: 13px; }
    .mk-tl-rail { grid-column: 2; grid-row: 1 / 4; align-items: flex-start; padding-top: 18px; }
    .mk-tl-main { grid-column: 3; grid-row: 1; }
    .mk-tl-figures { grid-column: 3; align-items: flex-start; }
    .mk-tl-thumbs { grid-column: 3; justify-content: flex-start; }
    .mk-tl-open { display: none; }
}

.mk-viewer { display: grid; grid-template-columns: minmax(0, 1fr) 320px; overflow: hidden; border: 0; }
@media (max-width: 991.98px) { .mk-viewer { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(55vh, 1fr) auto; } }
.mk-viewer-stage { position: relative; display: flex; flex-direction: column; min-height: 70vh; background: var(--mk-stage); }
.mk-viewer-tools { display: flex; align-items: center; gap: 8px; padding: 12px 14px; }
.mk-viewer-btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.10); color: #ffffff; text-decoration: none; }
.mk-viewer-btn:hover { background: rgba(255, 255, 255, 0.2); color: #ffffff; }
.mk-viewer-btn[hidden] { display: none; }
.mk-seg.mk-seg-dark { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); }
.mk-seg.mk-seg-dark[hidden] { display: none; }
.mk-seg.mk-seg-dark label { color: rgba(255, 255, 255, 0.7); }
.mk-seg.mk-seg-dark .btn-check:checked + label { background: rgba(255, 255, 255, 0.92); color: #0f1729; }
.mk-viewer-canvas { flex: 1; display: flex; align-items: stretch; justify-content: center; gap: 8px; padding: 0 56px 18px; min-height: 0; }
.mk-viewer-photo { position: relative; margin: 0; flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-width: 0; }
.mk-viewer-photo img { max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: 8px; transition: transform 0.2s ease; }
.mk-viewer-photo figcaption, .mk-compare-label { position: absolute; top: 10px; padding: 3px 10px; border-radius: 6px; background: rgba(5, 10, 20, 0.7); color: #ffffff; font-size: 12px; font-weight: 700; }
.mk-viewer-photo figcaption { left: 10px; }
.mk-viewer-missing { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed rgba(255, 255, 255, 0.25); border-radius: 12px; color: rgba(255, 255, 255, 0.7); font-weight: 600; }
.mk-viewer-missing .bi { font-size: 28px; }
.mk-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #ffffff; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; }
.mk-viewer-nav:hover:not(:disabled) { background: rgba(255, 255, 255, 0.28); }
.mk-viewer-nav:disabled { opacity: 0.3; }
.mk-viewer-nav.is-prev { left: 8px; }
.mk-viewer-nav.is-next { right: 8px; }
.mk-viewer-info { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--mk-surface); overflow-y: auto; }
.mk-viewer-title { margin: 0; font-size: 1.375rem; font-weight: 700; }

.mk-compare { position: relative; flex: 1; min-height: 50vh; overflow: hidden; border-radius: 10px; }
.mk-compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: transform 0.2s ease; }
.mk-compare img.mk-compare-top { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.mk-compare-label.is-before { left: 10px; }
.mk-compare-label.is-after { right: 10px; }
.mk-compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px; margin-left: -1.5px; background: #ffffff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); pointer-events: none; }
.mk-compare-handle::after {
    content: "\2194"; position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; transform: translate(-50%, -50%);
    display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #ffffff; color: #0f1729; font-size: 18px; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.mk-compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.mk-compare:focus-within .mk-compare-handle::after { outline: 3px solid var(--mk-accent); }

/* ---- Machine pages: panel extras, QR label, type picker, entry forms, sales bars ---- */
.mk-profile-hero { color: var(--mk-text); }
.mk-spark-panel { height: 34px; gap: 3px; }
.mk-tl-date { display: block; font-size: 11px; font-weight: 600; color: var(--mk-muted); }
.mk-danger-dots:hover { background: var(--mk-tone-red-soft); color: var(--mk-tone-red-ink); }

.mk-qr-card { flex: 0 1 300px; display: flex; flex-direction: column; gap: 12px; }
.mk-qr-label { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border: 2px dashed var(--mk-border-strong); border-radius: 14px; background: #ffffff; color: #17212b; text-align: center; }
.mk-qr-label img { width: 180px; height: 180px; image-rendering: pixelated; }
.mk-qr-label-sm img { width: 150px; height: 150px; }
.mk-qr-text { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mk-qr-text .mk-brand-mark { --mk-brand: #00a18f; width: 22px; height: 27px; }
.mk-qr-text strong { font-size: 20px; letter-spacing: 0.02em; }
.mk-qr-text span:last-child { font-size: 12px; color: #526070; max-width: 220px; }

.mk-type-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 575.98px) { .mk-type-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mk-type-option {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 86px; padding: 10px;
    border: 2px solid var(--mk-border); border-radius: 12px; background: var(--mk-surface) !important; color: var(--mk-text-2) !important;
    font-weight: 600; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
}
.mk-type-option .bi { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; background: var(--mk-tone-soft); color: var(--mk-tone-ink); }
.mk-type-option:hover { border-color: var(--mk-tone); }
.btn-check:checked + .mk-type-option { border-color: var(--mk-tone); background: var(--mk-tone-soft) !important; color: var(--mk-tone-ink) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--mk-tone) 20%, transparent); }
.btn-check:focus-visible + .mk-type-option { outline: 2px solid var(--mk-accent); outline-offset: 2px; }

.mk-entry-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr 120px; gap: 12px 14px; }
.mk-entry-grid-3 { grid-template-columns: 1.1fr 1fr 120px; }
@media (max-width: 767.98px) { .mk-entry-grid, .mk-entry-grid-3 { grid-template-columns: minmax(0, 1fr); } }

.mk-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 190px; padding-top: 6px; }
.mk-bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.mk-bar { width: 100%; max-width: 30px; min-height: 2px; border-radius: 5px 5px 2px 2px; background: var(--mk-bar); }
.mk-bar.is-zero { background: var(--mk-track); }
.mk-bar-col.is-current .mk-bar:not(.is-zero) { background: var(--mk-bar-strong); }
.mk-bar-value { font-size: 10.5px; font-weight: 600; color: var(--mk-text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mk-bar-label { font-size: 11px; color: var(--mk-muted); }
.mk-bar-col.is-current .mk-bar-label { color: var(--mk-text); font-weight: 700; }

/* Print the QR label alone (Details → Print QR label). */
@media print {
    body * { visibility: hidden; }
    .mk-qr-label, .mk-qr-label * { visibility: visible; }
    .mk-qr-label { position: fixed; left: 50%; top: 20mm; transform: translateX(-50%); border: 2px dashed #9aa5b1; }
}

/* ---- Machine status: progress rings, area board, machine tiles ---- */
.mk-rings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1199.98px) { .mk-rings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.mk-ring-card {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-width: 0;
    background: var(--mk-surface); border: 1px solid var(--mk-border); border-radius: 14px; box-shadow: var(--mk-shadow);
}
.mk-ring-card > div { display: flex; flex-direction: column; min-width: 0; }
.mk-ring-card strong { font-size: 1.375rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.mk-ring-card strong small { font-size: 0.6em; font-weight: 600; color: var(--mk-muted); }
.mk-ring-card span { font-size: 13px; font-weight: 600; color: var(--mk-text-2); }
.mk-ring-card em { font-style: normal; font-size: 12px; color: var(--mk-muted); }
.mk-ring {
    --p: 0; flex: none; width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: conic-gradient(var(--mk-tone) calc(var(--p) * 1%), var(--mk-track) 0);
}
.mk-ring > span { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--mk-surface); font-size: 13px !important; font-weight: 800 !important; color: var(--mk-text) !important; }
.mk-ring-note > .bi { flex: none; width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--mk-surface-2); color: var(--mk-muted); font-size: 24px; }

.mk-legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--mk-muted); }
.mk-legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.mk-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--mk-state); }

.mk-area { display: flex; flex-direction: column; gap: 10px; }
.mk-area[hidden] { display: none; }
.mk-area-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.mk-area-head h2 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 1rem; font-weight: 700; }
.mk-area-head h2 .bi { color: var(--mk-accent-strong); }
.mk-area-stats { font-size: 12.5px; font-weight: 600; color: var(--mk-muted); }
.mk-area-bar { flex: 1 1 160px; max-width: 320px; height: 8px; border-radius: 99px; overflow: hidden; display: flex; background: var(--mk-track); }
.mk-area-bar > .is-done { background: var(--mk-tone-green); }
.mk-area-bar > .is-read { background: var(--mk-tone-teal); opacity: 0.55; }

.mk-mtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; }
.mk-mtile {
    --mk-state: var(--mk-tone-amber);
    position: relative; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 11px 14px;
    background: var(--mk-surface); border: 1px solid var(--mk-border); border-radius: 12px; box-shadow: var(--mk-shadow);
    color: var(--mk-text); text-decoration: none; overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.mk-mtile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--mk-state); }
.mk-mtile:hover { color: var(--mk-text); border-color: var(--mk-state); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(16, 24, 40, 0.08); }
.mk-mtile[hidden] { display: none; }
.mk-mtile.is-done, .mk-dot.is-done { --mk-state: var(--mk-tone-green); }
.mk-mtile.is-read, .mk-dot.is-read { --mk-state: var(--mk-tone-teal); }
.mk-mtile.is-collected, .mk-dot.is-collected { --mk-state: var(--mk-tone-violet); }
.mk-mtile.is-todo, .mk-dot.is-todo { --mk-state: var(--mk-tone-amber); }
.mk-mtile.is-idle, .mk-dot.is-idle { --mk-state: var(--mk-border-strong); }
.mk-mtile.is-done { background: linear-gradient(135deg, var(--mk-tone-green-soft), var(--mk-surface) 60%); }
.mk-mtile.is-idle { opacity: 0.6; box-shadow: none; }
.mk-mtile-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mk-mtile-top strong { font-size: 14.5px; }
.mk-mtile-icon { flex: none; width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.mk-mtile-done { margin-left: auto; color: var(--mk-tone-green); }
.mk-mtile-name { font-size: 12px; color: var(--mk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-mtile-pips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mk-pip {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 3px 6px; border-radius: 7px;
    border: 1px dashed var(--mk-border-strong); font-size: 11.5px; font-weight: 600; color: var(--mk-muted); white-space: nowrap;
}
.mk-pip.is-on { border: 1px solid transparent; background: var(--mk-tone-green-soft); color: var(--mk-tone-green-ink); }
.mk-pip.is-part { border-style: solid; border-color: var(--mk-tone-amber); color: var(--mk-tone-amber-ink); }

/* ---- Wallets: balance hero, flows, day-grouped ledger, custody ---- */
.mk-wallet-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: 14px; }
@media (max-width: 991.98px) { .mk-wallet-hero { grid-template-columns: minmax(0, 1fr); } }
.mk-wallet-balance {
    display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 16px; color: #ffffff;
    background: linear-gradient(135deg, #0e6e65, #14978b 60%, #2a9d8f);
    box-shadow: 0 10px 26px color-mix(in srgb, #0e6e65 30%, transparent);
}
.mk-wallet-balance.is-negative { background: linear-gradient(135deg, #8f2424, #c43c3c 60%, #d75a4a); box-shadow: 0 10px 26px rgba(160, 40, 40, 0.28); }
.mk-wallet-balance span { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; opacity: 0.9; }
.mk-wallet-balance strong { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.mk-wallet-balance strong small { font-size: 0.5em; font-weight: 600; opacity: 0.85; margin-right: 6px; }
.mk-wallet-balance em { font-style: normal; font-size: 12.5px; opacity: 0.85; }
.mk-wallet-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.mk-flow { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--mk-surface); border: 1px solid var(--mk-border); border-radius: 14px; box-shadow: var(--mk-shadow); }
.mk-flow > .bi { flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; background: var(--mk-surface-2); color: var(--mk-text-2); }
.mk-flow.is-in > .bi { background: var(--mk-tone-green-soft); color: var(--mk-tone-green-ink); }
.mk-flow.is-out > .bi { background: var(--mk-tone-red-soft); color: var(--mk-tone-red-ink); }
.mk-flow div { display: flex; flex-direction: column; min-width: 0; }
.mk-flow span { font-size: 12.5px; font-weight: 600; color: var(--mk-muted); }
.mk-flow strong { font-size: 1.125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.mk-ledger-day { display: flex; flex-direction: column; gap: 8px; }
.mk-ledger-day[hidden] { display: none; }
.mk-ledger-day > header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 4px; }
.mk-ledger-day > header h2 { margin: 0; font-size: 0.8125rem; font-weight: 700; color: var(--mk-muted); }
.mk-ledger-day > header span { font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mk-ledger-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 110px; align-items: center; gap: 14px; padding: 11px 18px; border-bottom: 1px solid var(--mk-border); }
.mk-ledger-row:last-child { border-bottom: 0; }
.mk-ledger-row:hover { background: var(--mk-surface-2); }
.mk-ledger-row[hidden] { display: none; }
.mk-ledger-icon { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.mk-ledger-icon.is-in { background: var(--mk-tone-green-soft); color: var(--mk-tone-green-ink); }
.mk-ledger-icon.is-out { background: var(--mk-tone-red-soft); color: var(--mk-tone-red-ink); }
.mk-ledger-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mk-ledger-reason { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-ledger-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; color: var(--mk-muted); }
.mk-ledger-amount { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.mk-ledger-balance { font-size: 12.5px; color: var(--mk-muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-ledger-balance::before { content: "bal. "; opacity: 0.7; }
@media (max-width: 575.98px) {
    .mk-ledger-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
    .mk-ledger-balance { display: none; }
}
.mk-chip.mk-chip-sm { padding: 1px 7px; font-size: 11.5px; border-radius: 6px; }

.mk-type-picker.mk-type-picker-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mk-type-option small { font-size: 11.5px; font-weight: 500; color: var(--mk-muted); }
.mk-input-lg .form-control, .mk-input-lg .input-group-text { font-size: 1.25rem; font-weight: 700; min-height: 3.25rem; }
.mk-wallet-preview { display: flex; flex-direction: column; gap: 2px; }
.mk-wallet-preview span { font-size: 12.5px; font-weight: 600; color: var(--mk-muted); }
.mk-wallet-preview strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }

.mk-custody-cell { min-width: 180px; }
.mk-custody-bar { display: block; height: 6px; margin-top: 6px; border-radius: 99px; background: var(--mk-track); overflow: hidden; }
.mk-custody-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--mk-tone-teal); }
.mk-custody-bar > span.is-negative { background: var(--mk-tone-red); }

/* ---- Report filters (Accountant report and other reports) ---- */
.mk-report-filters { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px 14px; align-items: end; }
@media (max-width: 991.98px) { .mk-report-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 575.98px) { .mk-report-filters { grid-template-columns: minmax(0, 1fr); } }
.mk-report-actions { display: flex; gap: 8px; }
.mk-quick-ranges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.mk-chip-btn { padding: 4px 11px; border-radius: 99px; border: 1px solid var(--mk-border-strong); background: var(--mk-surface); color: var(--mk-text-2); font-size: 12.5px; font-weight: 600; }
.mk-chip-btn:hover { border-color: var(--mk-accent); color: var(--mk-accent-strong); }
.mk-ledger-row.no-balance { grid-template-columns: 36px minmax(0, 1fr) auto; }

/* ---- Collector list (Home/Machines): big touch targets, this month's entry per machine ---- */
.mk-collect-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.mk-collect-item {
    display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; min-width: 0;
    background: var(--mk-surface); border: 1px solid var(--mk-border); border-radius: 12px; box-shadow: var(--mk-shadow);
    color: var(--mk-text); text-decoration: none;
}
.mk-collect-item:hover { color: var(--mk-text); border-color: var(--mk-accent); }
.mk-collect-item[hidden] { display: none; }
.mk-collect-item.is-done { background: linear-gradient(135deg, var(--mk-tone-green-soft), var(--mk-surface) 55%); }
.mk-collect-item .mk-mtile-icon { width: 38px; height: 38px; border-radius: 11px; font-size: 17px; }
.mk-collect-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mk-collect-main strong { font-size: 15px; }
.mk-collect-main span { font-size: 12.5px; color: var(--mk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-collect-cta { font-size: 13px; font-weight: 700; color: var(--mk-accent-strong); white-space: nowrap; }

/* ---- Tabs and reconciliation statement (Reports → Machine transactions) ---- */
.mk-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--mk-surface-2); border: 1px solid var(--mk-border); align-self: flex-start; }
.mk-tabs .nav-link { border: 0; border-radius: 9px; padding: 7px 14px; font-size: 0.9rem; font-weight: 600; color: var(--mk-muted); background: transparent; }
.mk-tabs .nav-link:hover { color: var(--mk-text); }
.mk-tabs .nav-link.active { background: var(--mk-surface); color: var(--mk-text); box-shadow: var(--mk-shadow); }
.tab-content > .tab-pane:not(.active) { display: none !important; }
.mk-report-filters.mk-report-filters-3 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; }
@media (max-width: 767.98px) { .mk-report-filters.mk-report-filters-3 { grid-template-columns: minmax(0, 1fr); } }
.mk-tl-thumbs.mk-tl-thumbs-sm { min-width: 0; }
.mk-tl-thumbs-sm .mk-shot-photo { width: 40px; height: 40px; border-radius: 8px; }

.mk-recon { font-variant-numeric: tabular-nums; }
.mk-recon > thead th { padding: 10px 12px; white-space: nowrap; border-radius: 0 !important; }
.mk-recon > thead th:first-child, .mk-recon > tbody th { position: sticky; left: 0; z-index: 1; background: var(--mk-surface); }
.mk-recon > thead th:first-child { background: var(--mk-thead); }
.mk-recon > tbody th { padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--mk-text-2); white-space: nowrap; border-color: var(--mk-border); }
.mk-recon > tbody td { padding: 8px 12px; text-align: right; font-size: 13px; white-space: nowrap; border-color: var(--mk-border); }
.mk-recon > tbody td:last-child, .mk-recon > thead th:last-child { background: var(--mk-surface-2); font-weight: 700; }
.mk-recon-group > th { padding-top: 14px !important; font-size: 11px !important; font-weight: 800 !important; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mk-accent-strong) !important; background: var(--mk-surface); }
.mk-recon-total > th, .mk-recon-total > td { font-weight: 800 !important; color: var(--mk-text) !important; border-top: 2px solid var(--mk-border-strong) !important; }
.mk-recon-result > th, .mk-recon-result > td { font-weight: 800 !important; font-size: 14px !important; }
.mk-recon-result > td.is-short, .mk-recon-key.is-short { background: var(--mk-tone-red-soft) !important; color: var(--mk-tone-red-ink); }
.mk-recon-result > td.is-over, .mk-recon-key.is-over { background: var(--mk-tone-green-soft) !important; color: var(--mk-tone-green-ink); }
.mk-recon-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }

/* ---- Sales heatmap (Reports → Short summary) ---- */
.mk-year-nav { display: inline-flex; align-items: center; gap: 8px; }
.mk-year-nav strong { min-width: 52px; text-align: center; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.mk-icon-btn.disabled { opacity: 0.35; pointer-events: none; }
.mk-year-pick { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.mk-heat-wrap { max-height: 70vh; }
.mk-heat { font-variant-numeric: tabular-nums; border-collapse: separate; border-spacing: 0; }
.mk-heat > thead th, .mk-heat > thead td { position: sticky; z-index: 2; background: var(--mk-thead); }
.mk-heat > thead tr:first-child th { top: 0; padding: 9px 8px; text-align: right; font-size: 11px; border-radius: 0 !important; }
.mk-heat > thead tr.mk-heat-total > * { top: 37px; padding: 8px; text-align: right; font-weight: 800; font-size: 12.5px; background: var(--mk-surface-2); border-bottom: 2px solid var(--mk-border-strong); }
.mk-heat > thead th:first-child, .mk-heat > tbody th { position: sticky; left: 0; z-index: 3; text-align: left !important; }
.mk-heat > tbody th { z-index: 1; background: var(--mk-surface); padding: 6px 14px; font-weight: 400; font-size: 12.5px; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-color: var(--mk-border); }
.mk-heat > tbody th strong { font-weight: 700; margin-right: 4px; }
.mk-heat > tbody th span { color: var(--mk-muted); }
.mk-heat > tbody td { padding: 6px 8px; text-align: right; font-size: 12px; font-weight: 600; min-width: 62px; border: 1px solid var(--mk-surface); border-width: 0 2px 2px 0; }
.mk-heat > tbody tr[hidden] { display: none; }
.mk-heat td.heat-0 { background: transparent; }
.mk-heat td.heat-1, .mk-heat-legend .heat-1 { background: var(--mk-heat-1); color: var(--mk-text); }
.mk-heat td.heat-2, .mk-heat-legend .heat-2 { background: var(--mk-heat-2); color: var(--mk-text); }
.mk-heat td.heat-3, .mk-heat-legend .heat-3 { background: var(--mk-heat-3); color: #ffffff; }
.mk-heat td.heat-4, .mk-heat-legend .heat-4 { background: var(--mk-heat-4); color: #ffffff; }
.mk-heat td.heat-5, .mk-heat-legend .heat-5 { background: var(--mk-heat-5); color: #ffffff; }
[data-bs-theme="dark"] .mk-heat td.heat-1, [data-bs-theme="dark"] .mk-heat td.heat-2 { color: var(--mk-text); }
[data-bs-theme="dark"] .mk-heat td.heat-5 { color: #04211e; }
.mk-heat td.heat-neg, .mk-heat-legend .heat-neg { background: var(--mk-tone-red-soft); color: var(--mk-tone-red-ink); box-shadow: inset 0 0 0 1.5px var(--mk-tone-red); }
.mk-heat td.mk-heat-year { font-weight: 800; font-size: 12.5px; background: var(--mk-surface-2); }
.mk-heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 18px; font-size: 12px; color: var(--mk-muted); border-top: 1px solid var(--mk-border); }
.mk-heat-legend i { display: inline-block; width: 18px; height: 12px; border-radius: 3px; }
.mk-heat-legend span { margin: 0 4px; }

.mk-banner.mk-banner-warn { background: var(--mk-warn-soft); color: var(--mk-warn-ink); border-color: color-mix(in srgb, var(--mk-warn) 30%, transparent); }

/* ---- Phone: compact rings, scrollable segmented controls, tighter wallet flows ---- */
@media (max-width: 575.98px) {
    .mk-rings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .mk-ring-card { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
    .mk-ring-card strong { font-size: 1.125rem; }
    .mk-ring, .mk-ring-note > .bi { width: 50px; height: 50px; }
    .mk-ring > span { width: 38px; height: 38px; font-size: 11.5px !important; }
    .mk-seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .mk-seg label, .mk-seg a { flex: none; white-space: nowrap; }
    .mk-flow { padding: 12px; gap: 10px; }
    .mk-flow > .bi { width: 34px; height: 34px; font-size: 15px; }
    .mk-flow strong { font-size: 1rem; }
    .mk-wallet-balance strong { font-size: 1.625rem; }
}

/* Denser cards for dashboards */
.mk-card.mk-card-compact { padding: 16px 18px; }
.mk-card-compact .mk-card-title { font-size: 0.9375rem; }
.mk-card-compact .mk-progress { height: 7px; }
.mk-card-compact .mk-chip { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.mk-card-compact .table > :not(caption) > * > * { padding-top: 0.45rem; padding-bottom: 0.45rem; }
.mk-row.mk-row-tight { gap: 14px; }
.mk-content:has(.mk-strip) { gap: 14px; }

.mk-legend { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.mk-legend-accent { background: var(--mk-bar); }
.mk-legend-muted { background: var(--mk-muted); }
