/* === Allmänt layout === */

.mt-booking-wrapper,
.mt-my-day-wrapper,
.mt-admin-overview-wrapper,
.mt-login-wrapper {
    width: 100%;
    box-sizing: border-box;
    margin: 0.8rem 0;
    font-family: "Poppins", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--mt-text);
}

.mt-booking-wrapper,
.mt-my-day-wrapper,
.mt-admin-overview-wrapper {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid var(--mt-border);
    border-radius: 12px;
    padding: 0.72rem 0.78rem;
    box-shadow: 0 6px 16px rgba(2, 6, 23, 0.05);
}

.mt-booking-wrapper h2,
.mt-my-day-wrapper h2,
.mt-admin-overview-wrapper h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

:root {
    --mt-primary: #0ea5e9;
    --mt-primary-strong: #0284c7;
    --mt-primary-soft: #e0f2fe;
    --mt-bg: #f8fafc;
    --mt-card: #ffffff;
    --mt-border: #e2e8f0;
    --mt-border-strong: #cbd5e1;
    --mt-text: #0f172a;
    --mt-text-muted: #64748b;
    --mt-slot-height: 28px;
}

html.mt-theme-dark {
    color-scheme: dark;
    --mt-primary: #6f93a6;
    --mt-primary-strong: #89a7b6;
    --mt-primary-soft: rgba(111, 147, 166, 0.16);
    --mt-bg: #17191d;
    --mt-card: #20242a;
    --mt-border: #30353c;
    --mt-border-strong: #454c55;
    --mt-text: #edf1f4;
    --mt-text-muted: #a6afb8;
}

.mt-theme-toggle-fab {
    position: fixed;
    top: calc(max(10px, env(safe-area-inset-top)) + var(--mt-theme-toggle-top-offset, 0px));
    right: max(16px, env(safe-area-inset-right));
    bottom: auto;
    z-index: 2147483200;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--mt-border-strong);
    background: rgba(255, 255, 255, 0.96);
    color: var(--mt-text);
    font-size: 1.08rem;
    font-weight: 700;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.mt-theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mt-theme-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mt-theme-toggle-fab:hover,
.mt-theme-toggle-fab:focus {
    transform: translateY(-1px);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.22);
    outline: none;
}

body.mt-modal-page-open .mt-theme-toggle-fab {
    opacity: 0;
    pointer-events: none;
}

html.mt-theme-dark .mt-theme-toggle-fab {
    background: rgba(32, 36, 42, 0.96);
    color: var(--mt-text);
    border-color: var(--mt-border-strong);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.44);
}

@media (max-width: 640px) {
    .mt-theme-toggle-fab {
        top: calc(max(8px, env(safe-area-inset-top)) + var(--mt-theme-toggle-top-offset, 0px));
        right: max(12px, env(safe-area-inset-right));
        width: 40px;
        height: 40px;
        min-height: 40px;
    }

}

html.mt-theme-dark .mt-booking-wrapper,
html.mt-theme-dark .mt-my-day-wrapper,
html.mt-theme-dark .mt-admin-overview-wrapper,
html.mt-theme-dark .mt-login-wrapper,
html.mt-theme-dark .mt-dashboard-shell,
html.mt-theme-dark .mt-dashboard-card,
html.mt-theme-dark .mt-dashboard-stat-box,
html.mt-theme-dark .mt-booking-wrapper-dashboard .mt-booking-form-col,
html.mt-theme-dark .mt-calendar-nav,
html.mt-theme-dark .mt-calendar-table-wrapper,
html.mt-theme-dark .mt-calendar-history-toggle,
html.mt-theme-dark .mt-live-search-results,
html.mt-theme-dark .mt-calendar-context-menu,
html.mt-theme-dark .mt-quick-move-confirm-dialog,
html.mt-theme-dark .mt-admin-section,
html.mt-theme-dark .mt-admin-search-form,
html.mt-theme-dark .mt-admin-availability-filter,
html.mt-theme-dark .mt-admin-mass-unav,
html.mt-theme-dark .mt-my-day-card,
html.mt-theme-dark .mt-modal-dialog {
    background: linear-gradient(180deg, #272c32 0%, #181b20 100%);
    border-color: var(--mt-border);
    color: var(--mt-text);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

html.mt-theme-dark .mt-dashboard-main,
html.mt-theme-dark .mt-dashboard-side,
html.mt-theme-dark .mt-calendar-grid-header,
html.mt-theme-dark .mt-calendar-grid-timehead,
html.mt-theme-dark .mt-calendar-grid-dayhead,
html.mt-theme-dark .mt-calendar-timecol,
html.mt-theme-dark .mt-calendar-daycol,
html.mt-theme-dark .mt-admin-pagination .page-numbers,
html.mt-theme-dark .mt-modal-close {
    background: #1a1e23;
    border-color: var(--mt-border);
    color: var(--mt-text);
}

html.mt-theme-dark .mt-dashboard-nav {
    background: linear-gradient(180deg, #24282e 0%, #191c21 100%);
    color: #bcc5cc;
}

html.mt-theme-dark .mt-dashboard-brand-kicker {
    color: #aab7c0;
}

html.mt-theme-dark .mt-dashboard-link {
    color: #c7d0d7;
}

html.mt-theme-dark .mt-dashboard-link:hover,
html.mt-theme-dark .mt-dashboard-link.is-active {
    background: #32383f;
    color: #f3f6f8;
}

html.mt-theme-dark .mt-dashboard-nav-user {
    border-top-color: rgba(166, 175, 184, 0.2);
}

html.mt-theme-dark .mt-dashboard-card p,
html.mt-theme-dark .mt-my-day-card-sub,
html.mt-theme-dark .mt-my-day-card-address,
html.mt-theme-dark .mt-admin-note,
html.mt-theme-dark .mt-login-user-select-wrap label,
html.mt-theme-dark .mt-calendar-day-label,
html.mt-theme-dark .mt-calendar-week-label {
    color: var(--mt-text-muted);
}

html.mt-theme-dark .mt-dashboard-stat-box,
html.mt-theme-dark .mt-my-day-card-montor,
html.mt-theme-dark .mt-admin-pagination .page-numbers {
    background: #272c32;
}

html.mt-theme-dark .mt-dashboard-shell,
html.mt-theme-dark .mt-booking-wrapper,
html.mt-theme-dark .mt-my-day-wrapper,
html.mt-theme-dark .mt-admin-overview-wrapper,
html.mt-theme-dark .mt-login-wrapper,
html.mt-theme-dark .mt-dashboard-card,
html.mt-theme-dark .mt-dashboard-stat-box,
html.mt-theme-dark .mt-booking-wrapper-dashboard .mt-booking-form-col,
html.mt-theme-dark .mt-calendar-nav,
html.mt-theme-dark .mt-calendar-table-wrapper,
html.mt-theme-dark .mt-my-day-card,
html.mt-theme-dark .mt-admin-section,
html.mt-theme-dark .mt-admin-search-form,
html.mt-theme-dark .mt-admin-availability-filter,
html.mt-theme-dark .mt-admin-mass-unav,
html.mt-theme-dark .mt-modal-dialog,
html.mt-theme-dark .mt-live-search-results,
html.mt-theme-dark .mt-calendar-context-menu,
html.mt-theme-dark .mt-quick-move-confirm-dialog {
    border-color: transparent;
}

html.mt-theme-dark .mt-dashboard-side {
    border-left-color: transparent;
}

html.mt-theme-dark .mt-button-primary {
    background: #6f93a6;
    border-color: #6f93a6;
    color: #f7fafc;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

html.mt-theme-dark .mt-button-primary:hover,
html.mt-theme-dark .mt-button-primary:focus {
    background: #89a7b6;
    border-color: #89a7b6;
    color: #ffffff;
}

html.mt-theme-dark .mt-button-secondary {
    background: #2a2f35;
    color: var(--mt-text);
    border-color: var(--mt-border-strong);
}

html.mt-theme-dark .mt-button-secondary:hover,
html.mt-theme-dark .mt-button-secondary:focus {
    background: #343a41;
    border-color: #697883;
    color: #f4f7f8;
}

html.mt-theme-dark .mt-button-danger {
    background: #3a262a;
    color: #e8c9ce;
    border-color: #654249;
}

html.mt-theme-dark .mt-button-danger:hover,
html.mt-theme-dark .mt-button-danger:focus {
    background: #493035;
    border-color: #7a5058;
    color: #f3dde1;
}

html.mt-theme-dark .mt-field input[type="text"],
html.mt-theme-dark .mt-field input[type="date"],
html.mt-theme-dark .mt-field input[type="number"],
html.mt-theme-dark .mt-field input[type="file"],
html.mt-theme-dark .mt-field select,
html.mt-theme-dark .mt-field textarea,
html.mt-theme-dark .mt-calendar-filter-form select,
html.mt-theme-dark .mt-calendar-search-form input[type="text"],
html.mt-theme-dark .mt-admin-search-form input[type="text"],
html.mt-theme-dark .mt-admin-availability-filter select,
html.mt-theme-dark .mt-admin-status-quickchange,
html.mt-theme-dark .mt-employee-id-form input[type="text"] {
    background: #16191d;
    color: var(--mt-text);
    border-color: var(--mt-border-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

html.mt-theme-dark .mt-field input[type="text"]:focus,
html.mt-theme-dark .mt-field input[type="date"]:focus,
html.mt-theme-dark .mt-field input[type="number"]:focus,
html.mt-theme-dark .mt-field input[type="file"]:focus,
html.mt-theme-dark .mt-field select:focus,
html.mt-theme-dark .mt-field textarea:focus,
html.mt-theme-dark .mt-calendar-search-form input[type="text"]:focus,
html.mt-theme-dark .mt-calendar-filter-form select:focus,
html.mt-theme-dark .mt-admin-search-form input[type="text"]:focus,
html.mt-theme-dark .mt-admin-availability-filter select:focus,
html.mt-theme-dark .mt-employee-id-form input[type="text"]:focus {
    background: #1c2025;
}

html.mt-theme-dark .mt-booking-wrapper select,
html.mt-theme-dark .mt-booking-wrapper input[type="date"],
html.mt-theme-dark .mt-my-day-wrapper select,
html.mt-theme-dark .mt-my-day-wrapper input[type="date"],
html.mt-theme-dark .mt-admin-overview-wrapper select,
html.mt-theme-dark .mt-admin-overview-wrapper input[type="date"],
html.mt-theme-dark .mt-login-wrapper select,
html.mt-theme-dark .mt-modal-form select,
html.mt-theme-dark .mt-modal-form input[type="date"] {
    color: var(--mt-text) !important;
    -webkit-text-fill-color: var(--mt-text);
}

html.mt-theme-dark .mt-booking-wrapper select option,
html.mt-theme-dark .mt-booking-wrapper select optgroup,
html.mt-theme-dark .mt-my-day-wrapper select option,
html.mt-theme-dark .mt-my-day-wrapper select optgroup,
html.mt-theme-dark .mt-admin-overview-wrapper select option,
html.mt-theme-dark .mt-admin-overview-wrapper select optgroup,
html.mt-theme-dark .mt-login-wrapper select option,
html.mt-theme-dark .mt-login-wrapper select optgroup,
html.mt-theme-dark .mt-modal-form select option,
html.mt-theme-dark .mt-modal-form select optgroup {
    color: #edf1f4;
    background: #23272d;
}

html.mt-theme-dark .mt-booking-wrapper input[type="date"]::-webkit-datetime-edit,
html.mt-theme-dark .mt-my-day-wrapper input[type="date"]::-webkit-datetime-edit,
html.mt-theme-dark .mt-admin-overview-wrapper input[type="date"]::-webkit-datetime-edit,
html.mt-theme-dark .mt-modal-form input[type="date"]::-webkit-datetime-edit {
    color: var(--mt-text);
}

html.mt-theme-dark .mt-booking-wrapper input[type="date"]::-webkit-datetime-edit-text,
html.mt-theme-dark .mt-my-day-wrapper input[type="date"]::-webkit-datetime-edit-text,
html.mt-theme-dark .mt-admin-overview-wrapper input[type="date"]::-webkit-datetime-edit-text,
html.mt-theme-dark .mt-modal-form input[type="date"]::-webkit-datetime-edit-text {
    color: var(--mt-text-muted);
}

html.mt-theme-dark .mt-booking-wrapper input[type="date"]::-webkit-calendar-picker-indicator,
html.mt-theme-dark .mt-my-day-wrapper input[type="date"]::-webkit-calendar-picker-indicator,
html.mt-theme-dark .mt-admin-overview-wrapper input[type="date"]::-webkit-calendar-picker-indicator,
html.mt-theme-dark .mt-modal-form input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.9) saturate(0) brightness(1.05);
    opacity: 0.88;
}

html.mt-theme-dark .mt-login-wrapper {
    background: linear-gradient(180deg, #272c32 0%, #181b20 100%);
}

html.mt-theme-dark .mt-login-message {
    background: rgba(107, 82, 51, 0.22);
    border-color: rgba(172, 142, 96, 0.34);
    color: #d7c09d;
}

html.mt-theme-dark .mt-calendar-grid-header {
    border-bottom-color: var(--mt-border);
}

html.mt-theme-dark .mt-calendar-grid-timehead,
html.mt-theme-dark .mt-calendar-grid-dayhead,
html.mt-theme-dark .mt-calendar-timecol,
html.mt-theme-dark .mt-calendar-daycol {
    border-color: var(--mt-border);
}

html.mt-theme-dark .mt-calendar-time-label {
    color: var(--mt-text-muted);
    border-bottom-color: var(--mt-border);
}

html.mt-theme-dark .mt-calendar-daycol-inner {
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(var(--mt-slot-height) - 1px),
            rgba(88, 95, 103, 0.34) calc(var(--mt-slot-height) - 1px),
            rgba(88, 95, 103, 0.34) var(--mt-slot-height)
        );
}

html.mt-theme-dark .mt-booking-pill {
    background: rgba(41, 46, 54, 0.96) !important;
    background: color-mix(in srgb, var(--mt-pill-bg, #d8dee5) 16%, #262b31 84%) !important;
    border-color: rgba(255, 255, 255, 0.05);
    border-left-color: rgba(150, 160, 170, 0.74) !important;
    border-left-color: color-mix(in srgb, var(--mt-pill-accent, #94a3b8) 54%, #9aa3ad 46%) !important;
    color: var(--mt-text) !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34);
}

html.mt-theme-dark .mt-booking-pill:hover {
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.42);
}

html.mt-theme-dark .mt-booking-pill strong {
    color: var(--mt-text);
}

html.mt-theme-dark .mt-booking-pill span,
html.mt-theme-dark .mt-booking-pill-case {
    color: rgba(237, 241, 244, 0.74);
}

html.mt-theme-dark .mt-booking-pill-note {
    color: rgba(194, 202, 209, 0.78);
}

html.mt-theme-dark .mt-live-search-item:hover {
    background: #2b3036;
}

html.mt-theme-dark .mt-live-search-active {
    background: #32383f;
    outline-color: rgba(111, 147, 166, 0.18);
}

html.mt-theme-dark .mt-row-done-not-invoiced {
    background: rgba(95, 82, 53, 0.34);
}

html.mt-theme-dark .mt-row-ongoing {
    background: rgba(51, 72, 83, 0.36);
}

html.mt-theme-dark .mt-admin-pagination .page-numbers.current {
    background: #89a7b6;
    border-color: #89a7b6;
    color: #1b2127;
}

html.mt-theme-dark .mt-status-chip-booked {
    background: rgba(111, 147, 166, 0.16);
    color: #dce7ed;
    border-color: rgba(137, 167, 182, 0.3);
}

html.mt-theme-dark .mt-status-chip-ongoing {
    background: rgba(92, 124, 132, 0.18);
    color: #d6e3e5;
    border-color: rgba(119, 145, 151, 0.28);
}

html.mt-theme-dark .mt-status-chip-done {
    background: rgba(90, 113, 95, 0.18);
    color: #dbe5dd;
    border-color: rgba(120, 143, 124, 0.28);
}

html.mt-theme-dark .mt-status-chip-invoiced {
    background: rgba(120, 103, 74, 0.2);
    color: #eadfcb;
    border-color: rgba(157, 136, 103, 0.3);
}

.mt-booking-wrapper *,
.mt-my-day-wrapper *,
.mt-admin-overview-wrapper *,
.mt-login-wrapper * {
    box-sizing: border-box;
}

/* === Samlad dashboard === */

.mt-dashboard-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 320px;
    border: 1px solid var(--mt-border);
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    height: calc(100vh - 2rem);
    height: calc(100dvh - 2rem);
    height: var(--mt-dashboard-shell-height, calc(100dvh - 2rem));
    min-height: 620px;
    min-height: min(620px, calc(100dvh - 1rem));
    max-height: calc(100dvh - 0.5rem);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.08);
}

.mt-dashboard-no-sidebar {
    grid-template-columns: 240px minmax(0, 1fr);
}

.mt-dashboard-nav {
    background: #1e293b;
    color: #cbd5e1;
    padding: 1.45rem 1.05rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 0;
    overflow: hidden;
}

.mt-dashboard-brand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    letter-spacing: 0.01em;
    margin-bottom: 0.9rem;
    min-width: 0;
    padding: 0.1rem 0 0.4rem;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

.mt-dashboard-brand-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    padding: 0 0 0.65rem;
    background: transparent;
    border: 0;
}

.mt-dashboard-brand-logo {
    display: block;
    width: auto;
    max-width: 112px;
    max-height: 34px;
    object-fit: contain;
    flex: 0 0 auto;
}

.mt-dashboard-brand-copy {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.16rem;
    min-width: 0;
    padding: 0;
}

.mt-dashboard-brand-kicker {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #8ed4f4;
}

.mt-dashboard-brand-text {
    display: block;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.08;
    color: #f8fafc;
}

.mt-dashboard-nav-links {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.mt-dashboard-link {
    display: block;
    padding: 0.72rem 0.82rem;
    border-radius: 10px;
    text-decoration: none;
    color: #cbd5e1;
    font-weight: 600;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.mt-dashboard-link:hover,
.mt-dashboard-link.is-active {
    background: #334155;
    color: #fff;
    transform: translateX(1px);
}

.mt-dashboard-nav-user {
    margin-top: auto;
    padding-top: 0.95rem;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    font-size: 0.84rem;
}

.mt-dashboard-nav-user .mt-switch-user-bar {
    margin-top: .65rem;
    display: block;
}

.mt-dashboard-nav-user .mt-switch-user-label {
    display: block;
    margin-bottom: .35rem;
    color: #f8fafc;
}

.mt-dashboard-main {
    background: var(--mt-card);
    padding: 0.85rem 0.95rem;
    min-width: 0;
    min-height: 0;
    position: relative;
    transition: opacity 0.16s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.mt-dashboard-shell.mt-dashboard-view-calendar .mt-dashboard-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mt-dashboard-shell.mt-dashboard-view-calendar .mt-dashboard-main > .mt-booking-wrapper-dashboard {
    flex: 1 1 auto;
    min-height: 0;
}

.mt-dashboard-shell.mt-dashboard-loading .mt-dashboard-main {
    opacity: 0.58;
    pointer-events: none;
}

.mt-dashboard-main .mt-booking-wrapper,
.mt-dashboard-main .mt-my-day-wrapper,
.mt-dashboard-main .mt-admin-overview-wrapper {
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.mt-dashboard-side {
    border-left: 1px solid var(--mt-border);
    background: var(--mt-bg);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-height: 0;
    overflow: hidden;
}

.mt-dashboard-side .mt-dashboard-card {
    min-height: 0;
}

.mt-dashboard-side .mt-dashboard-card:last-child {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.mt-dashboard-card {
    background: var(--mt-card);
    border: 1px solid var(--mt-border);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.03);
}

.mt-dashboard-card h3 {
    margin: 0 0 0.85rem;
    font-size: 0.98rem;
    color: var(--mt-text);
}

.mt-dashboard-card p {
    margin: 0.45rem 0;
    font-size: 0.84rem;
    color: #334155;
}

.mt-dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
}

.mt-dashboard-stat-box {
    background: #f8fafc;
    border: 1px solid var(--mt-border);
    border-radius: 12px;
    padding: 0.62rem 0.5rem;
    text-align: center;
}

.mt-dashboard-stat-val {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--mt-primary-strong);
}

.mt-dashboard-stat-lab {
    display: block;
    font-size: 0.72rem;
    color: var(--mt-text-muted);
}

@media (max-width: 1280px) {
    .mt-dashboard-shell {
        grid-template-columns: 210px minmax(0, 1fr);
    }
    .mt-dashboard-side {
        display: none;
    }
}

@media (max-width: 880px) {
    .mt-dashboard-shell,
    .mt-dashboard-no-sidebar {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
        overflow: visible;
    }
    .mt-dashboard-nav {
        border-bottom: 1px solid rgba(148, 163, 184, 0.3);
        min-height: auto;
        overflow: visible;
    }
    .mt-dashboard-main {
        min-height: auto;
        overflow: visible;
    }
}

/* === Auto mobilvy (aktiveras via wp_is_mobile i dashboard-shortcode) === */

.mt-dashboard-shell.mt-dashboard-mobile,
.mt-dashboard-shell.mt-dashboard-mobile.mt-dashboard-no-sidebar {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
    border-radius: 14px;
}

.mt-dashboard-mobile .mt-dashboard-nav {
    position: sticky;
    top: 0;
    z-index: 45;
    padding: 0.8rem 0.75rem 0.7rem;
    gap: 0.55rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.96);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.mt-dashboard-mobile .mt-dashboard-brand {
    margin: 0;
    padding: 0;
}

.mt-dashboard-mobile .mt-dashboard-brand-logo-wrap {
    padding: 0 0 0.52rem;
}

.mt-dashboard-mobile .mt-dashboard-brand-logo {
    max-width: 92px;
    max-height: 28px;
}

.mt-dashboard-mobile .mt-dashboard-brand-kicker {
    font-size: 0.54rem;
}

.mt-dashboard-mobile .mt-dashboard-brand-text {
    font-size: 0.88rem;
    line-height: 1.04;
}

html.mt-theme-dark .mt-dashboard-brand {
    background: transparent;
    border-color: transparent;
}

html.mt-theme-dark .mt-dashboard-brand-logo-wrap {
    background: transparent;
    border-bottom-color: transparent;
}

html.mt-theme-dark .mt-dashboard-brand-kicker {
    color: #9fc1d0;
}

.mt-dashboard-mobile .mt-dashboard-nav-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    gap: 0.42rem;
}

.mt-dashboard-mobile .mt-dashboard-link {
    text-align: center;
    padding: 0.62rem 0.5rem;
    font-size: 0.82rem;
}

.mt-dashboard-mobile .mt-dashboard-nav-user {
    margin-top: 0.2rem;
    padding-top: 0.55rem;
    font-size: 0.8rem;
}

.mt-dashboard-mobile .mt-dashboard-main {
    min-height: auto;
    overflow: visible;
    padding: 0.85rem 0.8rem;
}

.mt-dashboard-mobile .mt-dashboard-side {
    display: none !important;
}

.mt-dashboard-mobile .mt-booking-wrapper-dashboard {
    --mt-slot-height: 48px;
}

.mt-dashboard-mobile .mt-booking-wrapper-dashboard .mt-booking-form-col {
    top: 0.65rem;
    right: 0.65rem;
    left: 0.65rem;
    bottom: 0.65rem;
    width: auto;
    max-width: none;
    min-width: 0;
}

.mt-dashboard-mobile .mt-calendar-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mt-dashboard-mobile .mt-calendar-grid {
    min-width: 760px;
}

.mt-dashboard-mobile .mt-calendar-nav {
    gap: 0.55rem;
}

.mt-dashboard-mobile .mt-calendar-filter-form,
.mt-dashboard-mobile .mt-calendar-search-form {
    flex-direction: column;
    align-items: stretch;
}

.mt-dashboard-mobile .mt-calendar-tools,
.mt-dashboard-mobile .mt-calendar-search-form {
    grid-template-columns: 1fr;
}

.mt-dashboard-mobile .mt-calendar-filter-form label,
.mt-dashboard-mobile .mt-calendar-filter-form select,
.mt-dashboard-mobile .mt-calendar-search-inputwrap,
.mt-dashboard-mobile .mt-calendar-search-form input[type="text"],
.mt-dashboard-mobile .mt-calendar-history-toggle,
.mt-dashboard-mobile .mt-calendar-search-submit {
    width: 100%;
}

.mt-dashboard-mobile .mt-my-day-cards {
    grid-template-columns: 1fr;
}

.mt-dashboard-mobile .mt-my-day-header {
    gap: 0.7rem;
}

.mt-dashboard-mobile .mt-my-day-header-right {
    width: 100%;
    align-items: stretch;
}

.mt-dashboard-mobile .mt-my-day-header-right form,
.mt-dashboard-mobile .mt-my-day-filters {
    width: 100%;
}

/* === Login === */

body.mt-auth-gate-open {
    overflow: hidden !important;
}

body.mt-auth-gate-open .mt-theme-toggle-fab {
    opacity: 0;
    pointer-events: none;
}

.mt-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483645;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.mt-auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.46);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

.mt-auth-modal {
    position: relative;
    z-index: 1;
    width: min(560px, calc(100% - 2rem));
    max-width: 560px;
}

.mt-login-wrapper {
    max-width: 520px;
    margin: 2rem auto;
    padding: 2rem 2.25rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--mt-border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.mt-login-message {
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border-radius: 10px;
    background: #fff5e9;
    border: 1px solid #f4d9b7;
    color: #8a4b0b;
    font-size: .9rem;
}

.mt-login-action {
    margin-top: 1.25rem;
    text-align: center;
}

.mt-login-button {
    display: inline-block;
    padding: 0.72rem 1.24rem;
    border-radius: 10px;
    background: var(--mt-primary);
    border: 1px solid var(--mt-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: .02em;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.mt-login-button:hover {
    background: var(--mt-primary-strong);
    border-color: var(--mt-primary-strong);
    transform: translateY(-1px);
}

.mt-login-button:hover,
.mt-login-button:focus {
    background: var(--mt-primary-strong);
    border-color: var(--mt-primary-strong);
    color: #fff;
}

.mt-switch-user-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    justify-content: space-between;
}

.mt-switch-user-label {
    font-weight: 600;
}

.mt-employee-id-form {
    display: grid;
    gap: .65rem;
    margin-top: 1rem;
}

.mt-employee-id-form label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mt-text-muted);
}

.mt-employee-id-form input[type="text"] {
    width: 100%;
    padding: 0.68rem 0.84rem;
    border-radius: 10px;
    border: 1px solid var(--mt-border-strong);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.mt-employee-id-form .mt-login-button {
    width: 100%;
    text-align: left;
    padding: .85rem 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.mt-login-user-select-wrap {
    margin-bottom: 1.5rem;
}

.mt-login-user-select-wrap label {
    display: block;
    font-weight: 600;
    margin-bottom: .35rem;
}

.mt-login-user-select-wrap select {
    width: 100%;
    padding: .5rem .75rem;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
}

.mt-login-user-hint {
    margin-top: .5rem;
    font-size: .8rem;
    color: #666;
}

.mt-login-form-wrap #mt-loginform {
    margin-top: .5rem;
}

.mt-login-form-wrap p {
    margin-bottom: .75rem;
}

.mt-login-form-wrap label {
    font-weight: 500;
    display: block;
    margin-bottom: .25rem;
}

.mt-login-form-wrap input[type="text"],
.mt-login-form-wrap input[type="password"] {
    width: 100%;
    padding: .5rem .75rem;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
}

/* === Mini dashboard (montörernas dag) === */

.mt-mini-dashboard {
    margin-bottom: 1.5rem;
    padding: 16px;
    height: 450px;
    max-height: 450px;
    overflow: auto;
    border-radius: 0;
    border: none;
    background: #fff;
}

.mt-mini-dashboard-compact {
    margin: 1.25rem 0;
}

.mt-mini-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.mt-mini-dashboard-title h2 {
    margin: 0 0 .2rem;
    font-size: 1.1rem;
}

.mt-mini-dashboard-sub {
    margin: 0;
    color: #64748b;
    font-size: .85rem;
}

.mt-mini-dashboard-total {
    font-weight: 700;
    color: #334155;
    margin-left: .35rem;
}

.mt-mini-dashboard-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.mt-mini-dashboard-filters label span {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: .25rem;
}

.mt-mini-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}

.mt-mini-dashboard-slider {
    position: relative;
    display: block;
}

.mt-mini-slider-track {
    position: relative;
    flex: 1 1 auto;
    min-height: 240px;
}

.mt-mini-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}

.mt-mini-slide.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.mt-mini-nav {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 1.15rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity .2s ease;
}

.mt-mini-nav:hover {
    opacity: 1;
}

.mt-mini-prev {
    left: -6px;
}

.mt-mini-next {
    right: -6px;
}

.mt-mini-dashboard-slider:hover .mt-mini-nav,
.mt-mini-dashboard-slider:focus-within .mt-mini-nav {
    opacity: 0.75;
}

.mt-mini-dashboard-slider:hover .mt-mini-nav:hover,
.mt-mini-dashboard-slider:focus-within .mt-mini-nav:hover {
    opacity: 1;
}

.mt-mini-dots {
    display: none;
    justify-content: center;
    gap: .4rem;
    margin-top: .5rem;
}

.mt-mini-dot {
    width: 2px;
    height: 2px;
    border-radius: 999px;
    border: none;
    background: #9ca3af;
    cursor: pointer;
    opacity: 0.9;
}

.mt-mini-dot:focus {
    outline: none;
}

.mt-mini-dot.is-active {
    background: #29ABE2;
    opacity: 1;
}

.mt-mini-dashboard-empty {
    margin: 0;
    color: #64748b;
    font-size: .9rem;
}

.mt-mini-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--mt-mini-accent, #94a3b8);
    padding: .95rem 1.05rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-height: 170px;
}

.mt-mini-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.mt-mini-card-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.mt-mini-card-title h3 {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mt-mini-initials {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--mt-mini-accent, #94a3b8);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.mt-mini-chip {
    font-size: .72rem;
    font-weight: 700;
    padding: .25rem .6rem;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.mt-mini-chip-busy {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0c4a6e;
}

.mt-mini-chip-free {
    background: #ecfccb;
    border-color: #d9f99d;
    color: #365314;
}

.mt-mini-chip-unav {
    background: #fee2e2;
    border-color: #fecaca;
    color: #7f1d1d;
}

.mt-mini-card-body {
    font-size: .85rem;
    color: #1f2937;
}

.mt-mini-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.mt-mini-list li {
    display: flex;
    gap: .45rem;
    align-items: baseline;
}

.mt-mini-list-compact {
    font-size: .8rem;
    line-height: 1.25;
    gap: .3rem;
}

.mt-mini-list-compact .mt-mini-time,
.mt-mini-list-compact .mt-mini-meta {
    font-size: .8rem;
}

.mt-mini-time {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.mt-mini-meta {
    color: #475569;
    flex: 1;
}

.mt-mini-meta-muted {
    color: #94a3b8;
}

.mt-mini-more {
    margin-top: .35rem;
    font-size: .75rem;
    color: #64748b;
    font-weight: 600;
}

.mt-mini-empty,
.mt-mini-unav-note {
    margin: 0;
    color: #64748b;
    font-size: .85rem;
}

@media (max-width: 640px) {
    .mt-mini-dashboard {
        padding: .85rem;
    }
    .mt-mini-card {
        min-height: auto;
    }
    .mt-mini-slider-track {
        min-height: 230px;
    }
}

.mt-montor-ui-scale {
    zoom: 1;
}
@supports not (zoom: 1) {
    .mt-montor-ui-scale {
        transform: none;
        width: auto;
    }
}

/* === Knapp-stilar === */

.mt-button-primary,
.mt-button-secondary,
.mt-button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.84rem;
    border-radius: 9px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.mt-button-primary {
    background: var(--mt-primary);
    border-color: var(--mt-primary);
    color: #fff;
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.22);
}

.mt-button-primary:hover {
    background: var(--mt-primary-strong);
    border-color: var(--mt-primary-strong);
    color: #fff;
    transform: translateY(-1px);
}

.mt-button-secondary {
    background: #f8fafc;
    color: var(--mt-text);
    border-color: var(--mt-border-strong);
}

.mt-button-secondary:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e3a8a;
}

.mt-button-danger {
    background: #fff1f2;
    color: #991b1b;
    border-color: #fecdd3;
}

.mt-button-danger:hover {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #7f1d1d;
}

.mt-switch-user-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    margin: .35rem 0 1rem;
    gap: .35rem;
}

.mt-button-switch-user {
    font-size: 0.8rem;
    padding: 0.42rem 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 9px;
}
.mt-button-switch-user-icon {
    display: inline-block;
    font-size: .95rem;
    line-height: 1;
}

.mt-button-compact {
    padding: 0.36rem 0.62rem;
    font-size: 0.76rem;
}

.mt-button-fullwidth-on-mobile {
    width: auto;
}

@media (max-width: 640px) {
    .mt-button-fullwidth-on-mobile {
        width: 100%;
        justify-content: center;
    }
}

/* === Formulärfält === */

.mt-field {
    margin-bottom: 0.62rem;
}

.mt-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    margin-bottom: 0.22rem;
    color: var(--mt-text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mt-field input[type="text"],
.mt-field input[type="date"],
.mt-field input[type="number"],
.mt-field input[type="file"],
.mt-field select,
.mt-field textarea {
    width: 100%;
    padding: 0.52rem 0.7rem;
    border-radius: 9px;
    border: 1px solid var(--mt-border-strong);
    font-size: 0.82rem;
    background: #ffffff;
    color: var(--mt-text);
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease, transform .14s ease;
}

.mt-field input[type="text"]:focus,
.mt-field input[type="date"]:focus,
.mt-field input[type="number"]:focus,
.mt-field input[type="file"]:focus,
.mt-field select:focus,
.mt-field textarea:focus {
    border-color: var(--mt-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
    outline: none;
    background: #fafdff;
}

.mt-field .mt-field-hint {
    display:block;
    font-size:0.78rem;
    color:var(--mt-text-muted);
    margin-top:0.35rem;
}

.mt-field textarea {
    min-height: 72px;
    resize: vertical;
    line-height: 1.45;
}

/* === Läsbar text i native select/date-kontroller === */

.mt-booking-wrapper select,
.mt-booking-wrapper input[type="date"],
.mt-my-day-wrapper select,
.mt-my-day-wrapper input[type="date"],
.mt-admin-overview-wrapper select,
.mt-admin-overview-wrapper input[type="date"],
.mt-login-wrapper select,
.mt-modal-form select,
.mt-modal-form input[type="date"] {
    color: var(--mt-text) !important;
    -webkit-text-fill-color: var(--mt-text);
    opacity: 1;
    font-family: inherit;
}

.mt-booking-wrapper select option,
.mt-booking-wrapper select optgroup,
.mt-my-day-wrapper select option,
.mt-my-day-wrapper select optgroup,
.mt-admin-overview-wrapper select option,
.mt-admin-overview-wrapper select optgroup,
.mt-login-wrapper select option,
.mt-login-wrapper select optgroup,
.mt-modal-form select option,
.mt-modal-form select optgroup {
    color: #0f172a;
    background: #ffffff;
}

.mt-booking-wrapper input[type="date"]::-webkit-date-and-time-value,
.mt-my-day-wrapper input[type="date"]::-webkit-date-and-time-value,
.mt-admin-overview-wrapper input[type="date"]::-webkit-date-and-time-value,
.mt-modal-form input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

.mt-booking-wrapper input[type="date"]::-webkit-datetime-edit,
.mt-my-day-wrapper input[type="date"]::-webkit-datetime-edit,
.mt-admin-overview-wrapper input[type="date"]::-webkit-datetime-edit,
.mt-modal-form input[type="date"]::-webkit-datetime-edit {
    color: var(--mt-text);
}

.mt-booking-wrapper input[type="date"]::-webkit-datetime-edit-text,
.mt-my-day-wrapper input[type="date"]::-webkit-datetime-edit-text,
.mt-admin-overview-wrapper input[type="date"]::-webkit-datetime-edit-text,
.mt-modal-form input[type="date"]::-webkit-datetime-edit-text {
    color: var(--mt-text-muted);
}

.mt-booking-wrapper input[type="date"]::-webkit-calendar-picker-indicator,
.mt-my-day-wrapper input[type="date"]::-webkit-calendar-picker-indicator,
.mt-admin-overview-wrapper input[type="date"]::-webkit-calendar-picker-indicator,
.mt-modal-form input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.82;
}

.mt-field-row {
    display: flex;
    gap: 0.82rem;
    flex-wrap: wrap;
}

.mt-field-row .mt-field {
    flex: 1 1 0;
}
.mt-field-row.mt-field-row-stacked {
    display: block;
}
.mt-field-row.mt-field-row-stacked .mt-field {
    width: 100%;
}

/* === Alerts === */

.mt-alert {
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    border-radius: 10px;
    font-size: .85rem;
}

.mt-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.mt-alert-success {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.mt-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.mt-booking-prefill-note {
    margin-bottom: 0.72rem;
    padding: 0.62rem 0.78rem;
}

.mt-booking-prefill-note strong {
    display: block;
    margin-bottom: 0.16rem;
}

html.mt-theme-dark .mt-alert-info {
    background: rgba(111, 147, 166, 0.14);
    border-color: rgba(137, 167, 182, 0.26);
    color: #d9e5eb;
}

.mt-update-alert-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483645;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mt-update-alert-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,0.55);
}
.mt-update-alert-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    max-width: 520px;
    width: calc(100% - 2rem);
    box-shadow: 0 18px 40px rgba(0,0,0,0.3);
    text-align: center;
}
.mt-update-alert-close-x {
    position: absolute;
    top: .45rem;
    right: .5rem;
    width: 30px;
    height: 30px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 1.15rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    touch-action: manipulation;
}
.mt-update-alert-close-x:hover,
.mt-update-alert-close-x:focus {
    background: #f8fafc;
    border-color: #cbd5e1;
    outline: none;
}
.mt-update-alert-card h3 {
    margin: 0 0 .5rem;
    font-size: 1.05rem;
}
.mt-update-alert-list {
    margin-bottom: .9rem;
    color: #991b1b;
    font-size: .9rem;
}
.mt-update-alert-list p {
    margin: .2rem 0;
}

/* === Bokningssida: layout === */

.mt-booking-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    align-items: flex-start;
}

.mt-booking-form-col {
    flex: 0 0 30%;
    min-width: 250px;
    max-width: 340px;
}

.mt-booking-form-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    margin-bottom: .45rem;
}

.mt-booking-form-heading h2 {
    margin: 0;
}

.mt-booking-form-heading .mt-switch-user-bar {
    margin: 0;
}

.mt-booking-calendar-col {
    flex: 1 1 0;
    min-width: 0;
}

.mt-calendar-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    flex-wrap: wrap;
    margin-bottom: .35rem;
}

.mt-calendar-title-row h2 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.01em;
    color: var(--mt-text);
}

.mt-booking-wrapper-dashboard .mt-calendar-title-row h2 {
    font-size: 1.04rem;
}

.mt-calendar-header {
    display: grid;
    gap: 0.42rem;
    margin-bottom: 0.45rem;
}

.mt-calendar-toolbar {
    display: grid;
    gap: 0.42rem;
}

.mt-calendar-title-copy {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.mt-calendar-title-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.48rem;
    flex-wrap: wrap;
}

.mt-calendar-company-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.mt-calendar-company-logo {
    display: block;
    width: auto;
    max-width: 148px;
    max-height: 28px;
    object-fit: contain;
}

.mt-calendar-company-logo-header {
    margin-bottom: 0.12rem;
}

.mt-find-time-trigger {
    white-space: nowrap;
}

.mt-time-alerts-trigger {
    position: relative;
    min-width: 40px;
    width: 40px;
    padding: 0 !important;
    justify-content: center;
}

.mt-time-alerts-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}

.mt-time-alerts-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.24);
}

.mt-time-alerts-trigger.has-alerts {
    border-color: rgba(220, 38, 38, 0.24);
    color: #991b1b;
}

.mt-dashboard-create-hint,
.mt-calendar-context-hint {
    margin: 0 0 0.45rem;
    font-size: 0.74rem;
    color: var(--mt-text-muted);
}

.mt-booking-wrapper-dashboard .mt-calendar-title-row {
    margin-bottom: 0;
    align-items: flex-start;
}

.mt-booking-wrapper-dashboard .mt-calendar-title-actions {
    padding-top: 0.08rem;
}

.mt-booking-wrapper-dashboard .mt-calendar-context-hint {
    margin: 0;
    font-size: 0.72rem;
}

html.mt-theme-dark .mt-calendar-company-logo-wrap {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

html.mt-theme-dark .mt-time-alerts-trigger.has-alerts {
    border-color: rgba(248, 113, 113, 0.24);
    color: #fecaca;
}

@media (max-width: 640px) {
    .mt-calendar-title-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .mt-calendar-company-logo-wrap {
        max-width: 100%;
    }

    .mt-calendar-company-logo {
        max-width: min(148px, 100%);
    }

    .mt-find-time-trigger {
        order: 2;
    }

    .mt-time-alerts-trigger {
        order: 1;
    }
}

.mt-booking-wrapper-dashboard .mt-booking-grid {
    position: relative;
    gap: 0.65rem;
    height: 100%;
    min-height: 0;
    align-items: stretch;
    flex: 1 1 auto;
}

.mt-dashboard-shell.mt-dashboard-view-calendar .mt-dashboard-main > .mt-booking-wrapper-dashboard {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.mt-booking-wrapper-dashboard .mt-booking-form-col {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 220;
    background: #fff;
    border: 1px solid var(--mt-border);
    border-radius: 12px;
    box-shadow: 0 30px 70px rgba(2, 6, 23, 0.3);
    width: min(460px, calc(100vw - 2.4rem));
    max-width: min(460px, calc(100vw - 2.4rem));
    min-width: min(460px, calc(100vw - 2.4rem));
    padding: 0.8rem 0.8rem 0.5rem;
    overflow: auto;
    transform: translateX(112%);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .2s ease;
}

.mt-booking-wrapper-dashboard.mt-booking-form-open .mt-booking-form-col {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.mt-booking-wrapper-dashboard .mt-booking-form-heading {
    align-items: flex-start;
    margin-bottom: 0.6rem;
}

.mt-booking-wrapper-dashboard .mt-booking-form-heading .mt-hide-new-booking {
    margin-left: auto;
}

.mt-booking-wrapper-dashboard .mt-booking-form-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 210;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.mt-booking-wrapper-dashboard.mt-booking-form-open .mt-booking-form-backdrop {
    opacity: 1;
    pointer-events: auto;
}

body.mt-booking-form-overlay-open {
    overflow: hidden;
}

.mt-booking-wrapper-dashboard .mt-calendar-grid-dayhead,
.mt-booking-wrapper-dashboard .mt-calendar-daycol {
    cursor: context-menu;
}

.mt-calendar-context-menu {
    position: fixed;
    top: -9999px;
    left: -9999px;
    z-index: 2147483638;
    background: #fff;
    border: 1px solid var(--mt-border-strong);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
    padding: 0.4rem;
    min-width: 230px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease;
}

.mt-calendar-context-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.mt-calendar-context-action {
    display: block;
    width: 100%;
    border: 1px solid var(--mt-border);
    background: #f8fafc;
    border-radius: 9px;
    text-align: left;
    padding: 0.5rem 0.65rem;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--mt-text);
    cursor: pointer;
    margin: 0 0 .28rem;
}

.mt-calendar-context-action:last-child {
    margin-bottom: 0;
}

.mt-calendar-context-action[data-mt-action="delete-booking"] {
    color: #991b1b;
    border-color: #fecdd3;
    background: #fff1f2;
}

.mt-calendar-context-action[data-mt-action="delete-booking"]:hover,
.mt-calendar-context-action[data-mt-action="delete-booking"]:focus {
    background: #ffe4e6;
    border-color: #fda4af;
}

.mt-calendar-context-action:hover,
.mt-calendar-context-action:focus {
    background: var(--mt-primary-soft);
    border-color: #93c5fd;
    outline: none;
}

@media (max-width: 768px) {
    .mt-calendar-context-menu {
        width: min(320px, calc(100vw - 1rem));
        min-width: 0;
        max-width: calc(100vw - 1rem);
    }
}

html.mt-theme-dark .mt-calendar-context-menu {
    background: linear-gradient(180deg, #23272d 0%, #1b1f24 100%);
    border-color: #394049;
    box-shadow: 0 24px 42px rgba(0, 0, 0, 0.46);
}

html.mt-theme-dark .mt-calendar-context-action {
    background: #2a2f35;
    border-color: #424952;
    color: #edf1f4;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

html.mt-theme-dark .mt-calendar-context-action:hover,
html.mt-theme-dark .mt-calendar-context-action:focus {
    background: #353b43;
    border-color: #6d7c88;
    color: #ffffff;
}

html.mt-theme-dark .mt-calendar-context-action[data-mt-action="delete-booking"] {
    background: #3b2b2f;
    border-color: #6d4a52;
    color: #f1d9dd;
}

html.mt-theme-dark .mt-calendar-context-action[data-mt-action="delete-booking"]:hover,
html.mt-theme-dark .mt-calendar-context-action[data-mt-action="delete-booking"]:focus {
    background: #4a353a;
    border-color: #8b5c66;
    color: #fff1f3;
}

body.mt-quick-move-enabled .mt-booking-wrapper-dashboard .mt-booking-pill {
    cursor: grab;
}

body.mt-quick-move-enabled .mt-booking-wrapper-dashboard .mt-booking-pill.mt-quick-move-source {
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.55), 0 14px 26px rgba(15, 23, 42, 0.2);
    transform: translateY(-1px);
    z-index: 12;
}

body.mt-quick-move-dragging .mt-booking-wrapper-dashboard .mt-booking-pill.mt-quick-move-source {
    cursor: grabbing;
}

.mt-quick-move-ghost {
    opacity: 0.86;
    transform: scale(1.01);
    filter: saturate(1.08);
}

.mt-booking-wrapper-dashboard .mt-calendar-daycol.mt-quick-move-target {
    background: rgba(14, 165, 233, 0.05);
}

.mt-quick-move-preview {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 10px;
    border: 2px dashed #0ea5e9;
    background: rgba(14, 165, 233, 0.16);
    color: #0f172a;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 25;
}

.mt-quick-move-preview.is-invalid {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.16);
    color: #7f1d1d;
}

.mt-quick-move-confirm {
    position: fixed;
    inset: 0;
    z-index: 360;
    display: none;
}

.mt-quick-move-confirm.mt-quick-move-confirm-open {
    display: block;
}

body.mt-quick-move-confirm-open {
    overflow: hidden;
}

.mt-quick-move-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.mt-quick-move-confirm-dialog {
    position: relative;
    width: min(430px, calc(100vw - 1.5rem));
    margin: clamp(72px, 12vh, 128px) auto 0;
    padding: 1rem 1rem 0.9rem;
    background: #ffffff;
    border: 1px solid var(--mt-border);
    border-radius: 18px;
    box-shadow: 0 32px 70px rgba(15, 23, 42, 0.24);
}

.mt-quick-move-confirm-close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: #f8fafc;
    color: var(--mt-text);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.mt-quick-move-confirm-close:hover,
.mt-quick-move-confirm-close:focus {
    background: #eff6ff;
    color: var(--mt-primary-strong);
    outline: none;
}

.mt-quick-move-confirm-body {
    padding-right: 2.4rem;
}

.mt-quick-move-confirm-kicker {
    margin: 0 0 0.22rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mt-primary-strong);
}

.mt-quick-move-confirm-body h3 {
    margin: 0 0 0.35rem;
    font-size: 1.08rem;
    color: var(--mt-text);
}

.mt-quick-move-confirm-message {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--mt-text-muted);
}

.mt-quick-move-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.95rem;
}

@media (max-width: 980px) {
    .mt-booking-form-col,
    .mt-booking-calendar-col {
        flex: 1 1 100%;
        min-width: 0;
    }

    .mt-booking-wrapper-dashboard .mt-booking-form-col {
        top: .65rem;
        right: .65rem;
        left: .65rem;
        bottom: .65rem;
        width: auto;
        max-width: none;
        min-width: 0;
    }
}

/* === Karta === */

.mt-map-placeholder {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    min-height: 180px;
    padding: .75rem;
    font-size: .8rem;
    color: #6b7280;
}

/* Map loading indicator */
.mt-map-placeholder.mt-map-loading {
    position: relative;
}
.mt-map-placeholder.mt-map-loading::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 10px;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(0,0,0,0.08);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: mt-spin 1s linear infinite;
}

/* === Kalendernav & filter === */

.mt-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin-bottom: 0.45rem;
    flex-wrap: wrap;
    padding: 0.44rem 0.52rem;
    border-radius: 10px;
    border: 1px solid var(--mt-border);
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
}

.mt-booking-wrapper-dashboard .mt-calendar-nav {
    margin-bottom: 0;
    padding: 0.38rem 0.44rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.42rem;
}

.mt-calendar-week-label {
    font-weight: 700;
    color: var(--mt-text);
}

.mt-booking-wrapper-dashboard .mt-calendar-week-label {
    justify-self: center;
    text-align: center;
}

.mt-calendar-tools {
    --mt-toolbar-control-height: 36px;
    --mt-toolbar-label-height: 0.82rem;
    display: grid;
    grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
    gap: 0.5rem 0.72rem;
    align-items: end;
    margin-bottom: 0.5rem;
}

.mt-booking-wrapper-dashboard .mt-calendar-tools {
    display: grid !important;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    align-items: end;
    gap: 0.5rem 0.72rem;
    margin-bottom: 0.35rem;
    width: 100%;
}

.mt-calendar-filter-form,
.mt-calendar-search-form {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    margin: 0;
    flex-wrap: wrap;
    min-width: 0;
}

.mt-calendar-filter-form {
    flex-wrap: nowrap;
}

.mt-booking-wrapper-dashboard .mt-calendar-filter-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    min-width: 0;
    width: min(220px, 100%);
    flex: 0 0 220px;
    max-width: 220px;
}

.mt-calendar-tool-field,
.mt-calendar-filter-label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.18rem;
    justify-content: flex-end;
}

.mt-calendar-filter-label {
    flex: 1 1 auto;
}

.mt-calendar-tool-label,
.mt-calendar-filter-label > span {
    display: inline-flex;
    align-items: center;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--mt-text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    min-height: var(--mt-toolbar-label-height);
    margin: 0;
}

.mt-calendar-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px auto;
    align-items: end;
    gap: 0.42rem;
}

.mt-booking-wrapper-dashboard .mt-calendar-search-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 128px;
    align-items: end;
    gap: 0.42rem;
    min-width: 0;
    width: 100%;
    max-width: none;
}

.mt-booking-wrapper-dashboard .mt-calendar-search-label {
    width: auto;
    min-width: 0;
}

.mt-booking-wrapper-dashboard .mt-calendar-history-field {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    justify-content: flex-end;
    width: 128px;
}

.mt-booking-wrapper-dashboard .mt-calendar-search-label,
.mt-booking-wrapper-dashboard .mt-calendar-history-field,
.mt-booking-wrapper-dashboard .mt-calendar-search-actionwrap {
    display: grid;
    grid-template-rows: var(--mt-toolbar-label-height) var(--mt-toolbar-control-height);
    align-content: end;
    gap: 0.18rem;
}

.mt-calendar-search-label,
.mt-calendar-history-field,
.mt-calendar-search-actionwrap {
    min-width: 0;
}

.mt-calendar-search-inputwrap {
    position: relative;
    min-width: 0;
}

.mt-calendar-search-actionwrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.18rem;
    justify-content: flex-end;
}

.mt-booking-wrapper-dashboard .mt-calendar-search-actionwrap {
    flex: 0 0 60px;
    width: 60px;
}

.mt-calendar-tool-label-placeholder {
    display: block;
    visibility: hidden;
    pointer-events: none;
    min-height: var(--mt-toolbar-label-height);
}

.mt-booking-wrapper-dashboard .mt-calendar-tool-label,
.mt-booking-wrapper-dashboard .mt-calendar-filter-label > span,
.mt-booking-wrapper-dashboard .mt-calendar-history-toggle > span {
    font-size: 0.66rem;
    letter-spacing: 0.06em;
}

.mt-calendar-filter-form select,
.mt-calendar-search-form input[type="text"] {
    width: 100%;
    padding: 0.42rem 0.58rem;
    border-radius: 9px;
    border: 1px solid var(--mt-border-strong);
    font-size: 0.78rem;
    min-height: var(--mt-toolbar-control-height);
    height: var(--mt-toolbar-control-height);
    line-height: 1.2;
    background: #ffffff;
    box-sizing: border-box;
}

.mt-calendar-history-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    justify-content: center;
    min-height: var(--mt-toolbar-control-height);
    height: var(--mt-toolbar-control-height);
    padding: 0 0.8rem;
    border-radius: 9px;
    border: 1px solid var(--mt-border);
    background: #ffffff;
    white-space: nowrap;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--mt-text);
    box-sizing: border-box;
    width: 100%;
}

.mt-calendar-history-toggle input {
    margin: 0;
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    align-self: center;
}

.mt-calendar-history-toggle > span {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    min-height: 0;
}

.mt-calendar-search-submit {
    min-height: var(--mt-toolbar-control-height);
    height: var(--mt-toolbar-control-height);
    padding: 0 0.92rem !important;
    align-self: stretch;
    box-sizing: border-box;
    min-width: 60px;
    justify-content: center;
    width: 100%;
    margin: 0;
}

.mt-booking-wrapper-dashboard .mt-calendar-search-inputwrap {
    width: 100%;
}

.mt-booking-wrapper-dashboard .mt-day-freehours-bar {
    margin-bottom: 0.35rem;
    align-items: center;
}

.mt-booking-wrapper-dashboard .mt-day-freehours-hint {
    margin: 0;
    font-size: 0.72rem;
}

@media (max-width: 1320px) {
    .mt-booking-wrapper-dashboard .mt-calendar-tools {
        gap: 0.5rem 0.6rem;
    }
}

@media (max-width: 900px) {
    .mt-booking-wrapper-dashboard .mt-calendar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .mt-booking-wrapper-dashboard .mt-calendar-week-label {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

.mt-dashboard-mobile .mt-booking-wrapper-dashboard .mt-calendar-nav {
    display: flex;
    flex-wrap: wrap;
}

.mt-dashboard-mobile .mt-booking-wrapper-dashboard .mt-calendar-tools {
    display: grid !important;
    grid-template-columns: 1fr;
}

.mt-dashboard-mobile .mt-booking-wrapper-dashboard .mt-calendar-filter-form,
.mt-dashboard-mobile .mt-booking-wrapper-dashboard .mt-calendar-search-form {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 100%;
    max-width: none;
}

.mt-dashboard-mobile .mt-calendar-search-actionwrap,
.mt-dashboard-mobile .mt-calendar-history-field,
.mt-dashboard-mobile .mt-calendar-search-label {
    width: 100%;
}

.mt-dashboard-mobile .mt-calendar-tool-label-placeholder {
    display: none;
}

/* === Lediga timmar chip === */

.mt-day-freehours-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .45rem;
}

.mt-day-freehours-hint {
    font-size: .8rem;
    color: #6b7280;
}

.mt-day-freehours-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid var(--mt-border);
    font-size: .68rem;
}

.mt-day-freehours-label {
    font-weight: 600;
    color: #374151;
}

.mt-day-freehours-value {
    color: #111827;
}

.mt-day-freehours-unavailable {
    color: #b91c1c;
}

/* === Kalender-tabell === */

.mt-calendar-table-wrapper {
    width: 100%;
    overflow-x: hidden;
    border-radius: 12px;
    border: 1px solid var(--mt-border);
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    flex: 1 1 auto;
    min-height: 0;
}

.mt-booking-wrapper-dashboard {
    --mt-slot-height: clamp(20px, 2.2vh, 28px);
}

.mt-booking-wrapper-dashboard .mt-booking-calendar-col {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* === Kalender-grid (ersätter table-layout) === */
.mt-calendar-grid {
    min-width: 0;
}

.mt-calendar-grid-header {
    display: flex;
    background: #ffffff;
    border-bottom: 2px solid var(--mt-border);
}

.mt-calendar-grid-timehead {
    flex: 0 0 72px;
    padding: 0.5rem 0.45rem;
    font-weight: 700;
    color: var(--mt-text-muted);
    white-space: nowrap;
    border-right: 1px solid var(--mt-border);
    box-sizing: border-box;
    letter-spacing: 0.03em;
}

.mt-calendar-grid-dayhead {
    flex: 1 1 0;
    padding: 0.42rem 0.4rem;
    border-right: 1px solid var(--mt-border);
    min-width: 0;
    box-sizing: border-box;
    cursor: pointer;
    background: #ffffff;
}
.mt-calendar-grid-dayhead:hover .mt-calendar-day-label {
    color: var(--mt-primary-strong);
}
.mt-calendar-grid-dayhead:last-child {
    border-right: 0;
}

.mt-calendar-grid-body {
    display: flex;
    min-height: 0;
}

.mt-calendar-timecol {
    flex: 0 0 72px;
    border-right: 1px solid var(--mt-border);
    background: #fcfcfd;
    box-sizing: border-box;
}

.mt-calendar-time-label {
    height: var(--mt-slot-height);
    line-height: var(--mt-slot-height);
    padding: 0 0.36rem;
    font-weight: 600;
    color: var(--mt-text-muted);
    border-bottom: 1px solid var(--mt-border);
    box-sizing: border-box;
    font-size: 0.68rem;
}

.mt-calendar-daycol {
    flex: 1 1 0;
    border-right: 1px solid var(--mt-border);
    min-width: 0;
    background: #ffffff;
    box-sizing: border-box;
}
.mt-calendar-daycol:last-child {
    border-right: 0;
}

.mt-calendar-daycol-inner {
    position: relative;
    height: calc(var(--mt-slot-height) * var(--mt-slots-count));
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(var(--mt-slot-height) - 1px),
            rgba(148, 163, 184, 0.22) calc(var(--mt-slot-height) - 1px),
            rgba(148, 163, 184, 0.22) var(--mt-slot-height)
        );
}

.mt-calendar-daycol-inner .mt-booking-pill {
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    min-width: 0;
}

/* Old table styles kept for backward compat, but grid is preferred */
.mt-calendar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}

.mt-calendar-table thead {
    background: #f9fafb;
}

.mt-calendar-table th,
.mt-calendar-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: .25rem .35rem;
    vertical-align: top;
}

/* Gör varje tidsrad exakt lika hög så att rowspan-bokningar följer bokad längd */
.mt-calendar-table tbody tr {
    height: var(--mt-slot-height);
}

/* Allow booking pills to fill the full rowspan cell: remove inner td padding
   and give the pill its own margin/padding so it visually spans rows cleanly. */
.mt-calendar-table td {
    padding: 0;
    position: relative;
}
.mt-calendar-table tbody td:nth-child(n+2) {
    background: #fbfcfe;
}
.mt-calendar-table tbody td:nth-child(2n+2) {
    background: #f4f7fb;
}
.mt-calendar-table .mt-calendar-timecell {
    padding: .25rem .35rem;
    min-height: var(--mt-slot-height);
    line-height: var(--mt-slot-height);
}
.mt-calendar-table td[rowspan] { border-bottom: none; }

.mt-calendar-table th {
    white-space: nowrap;
    font-weight: 600;
    text-align: left;
}
.mt-calendar-day-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--mt-text);
}
.mt-calendar-day-unavlist {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: .2rem;
}
.mt-calendar-day-unavchip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: 0.18rem 0.42rem;
    border-radius: 999px;
    border: 1px solid rgba(120, 53, 15, 0.25);
    background: #fff7ed;
    color: #78350f;
    font-size: 0.69rem;
    line-height: 1.2;
}
.mt-calendar-day-unavchip small {
    font-weight: 600;
}

.mt-calendar-timecell {
    width: 4rem;
    font-weight: 600;
    color: #6b7280;
}

/* Frånvarolista */
.mt-calendar-unav {
    margin: .45rem 0 .55rem;
    padding: .45rem .58rem;
    border: 1px solid #fde68a;
    background: #fffbeb;
    border-radius: 9px;
    font-size: .73rem;
}
.mt-calendar-unav h4 {
    margin: 0 0 .4rem;
    font-size: .85rem;
    color: #92400e;
}
.mt-calendar-unav-list {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.mt-calendar-unav-chip {
    background: #fef3c7;
    color: #78350f;
    border-radius: 9px;
    padding: .22rem .45rem;
    border: 1px solid rgba(120,53,15,0.2);
    display: flex;
    flex-direction: column;
    min-width: 148px;
    font-size: .7rem;
    line-height: 1.3;
}
.mt-calendar-unav-chip strong {
    font-size: .85rem;
}
.mt-calendar-unav-dates {
    font-weight: 600;
}
.mt-calendar-unav-note {
    font-size: .75rem;
    color: #92400e;
}

/* === Bokningspiller i kalender === */

.mt-booking-pill {
    position: absolute;
    box-sizing: border-box;
    border-radius: 10px;
    font-size: 0.72rem;
    cursor: pointer;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-left: 4px solid transparent;
    background: #eff6ff;
    color: #1e3a8a;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
    padding: 0.3rem 0.34rem;
    background-clip: padding-box;
    z-index: 2;
    transition: transform .16s ease, box-shadow .16s ease;
}

.mt-booking-pill:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.14);
    z-index: 5;
}

.mt-booking-pill strong {
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.1;
}

.mt-booking-pill span {
    font-size: .62rem;
}

.mt-booking-pill-case {
    font-size: 0.64rem;
    color: rgba(0,0,0,0.7);
    margin-top: 2px;
    max-height: 1.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mt-booking-pill-note {
    font-size: 0.62rem;
    color: #047857;
    margin-top: 1px;
    line-height: 1.2;
    max-height: 1.3rem;
    overflow: hidden;
}

/* Spara-knapp: initialt dold (men med transition) och tonas in när klassen tas bort */
.mt-modal-save-button {
    transition: opacity .18s ease, transform .18s ease;
    opacity: 1;
    transform: translateY(0);
}
.mt-modal-save-hidden {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

/* Live search styles */
.mt-live-search-results {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 280;
    background: #fff;
    border: 1px solid var(--mt-border-strong);
    border-radius: 12px;
    max-height: 320px;
    overflow: auto;
    width: auto;
    max-width: none;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
    display: none;
}
.mt-calendar-search-inputwrap,
.mt-admin-search-form { position: relative; }
.mt-live-search-list { list-style:none; margin:0; padding:8px; }
.mt-live-search-item { padding:8px; border-radius:8px; cursor:pointer; }
.mt-live-search-item:hover { background:#f3f4f6; }
.mt-live-search-row.small { font-size:0.8rem; color:#374151; }
.mt-live-search-length { font-size:0.8rem; color:#6b7280; margin-left:6px; }
.mt-live-search-none { padding:10px 12px; color:#6b7280; }
.mt-live-search-active { background: #eef2ff; outline: 2px solid rgba(59,130,246,0.12); }

/* Highlighted match inside live search */
.mt-live-search-row mark { background: #fff59d; padding: 0 .12rem; border-radius: 3px; color: inherit; }

@media (max-width: 640px) {
    .mt-live-search-results { position: fixed; left: 8px; right: 8px; top: auto; bottom: auto; width: calc(100% - 16px); max-width: none; margin-top: .5rem; }
    .mt-quick-move-confirm-dialog {
        width: calc(100vw - 1rem);
        margin-top: max(0.75rem, env(safe-area-inset-top));
    }
    .mt-quick-move-confirm-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
}

/* Loading spinner on select when class mt-loading is present */
.mt-calendar-filter-form select.mt-loading { padding-right: 2.2rem; position: relative; }
.mt-calendar-filter-form select.mt-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0,0,0,0.08);
    border-top-color: #2563eb;
    border-radius: 50%;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    box-sizing: border-box;
    animation: mt-spin 0.9s linear infinite;
}
@keyframes mt-spin { to { transform: translateY(-50%) rotate(360deg); } }

/* Calendar column loading overlay */
.mt-booking-calendar-col { position: relative; }
.mt-calendar-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
}
.mt-calendar-loading .mt-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(0,0,0,0.08);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: mt-spin 1s linear infinite;
}

/* Dölj filtrera-knappen där val ändå triggar direkt. */
.mt-calendar-filter-form button[type="submit"],
.mt-calendar-filter-form input[type="submit"],
.mt-calendar-filter-form .mt-button-secondary,
.mt-admin-availability-filter.mt-instant-submit button[type="submit"],
.mt-admin-availability-filter.mt-instant-submit .mt-button-secondary {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    margin: 0 !important;
}

.mt-calendar-search-submit {
    display: inline-flex !important;
    visibility: visible !important;
    width: auto !important;
    height: auto !important;
    padding: 0.46rem 0.82rem !important;
    border-width: 1px !important;
    margin: 0 !important;
}

.mt-booking-pill.mt-status-booked {
    background: #eff6ff;
    border-left-color: var(--mt-primary);
}

.mt-booking-pill.mt-status-ongoing {
    background: #ecfeff;
    border-left-color: #0891b2;
}

.mt-booking-pill.mt-status-done {
    background: #f0fdf4;
    border-left-color: #22c55e;
}

.mt-booking-pill.mt-status-invoiced {
    background: #fff7ed;
    border-left-color: #f59e0b;
}

/* Gör kalenderrader och piller proportionella så block fyller tiden de spänner över */
.mt-calendar-table tbody tr { height: var(--mt-slot-height); }
.mt-booking-pill { display:flex; flex-direction:column; justify-content:space-between; height:100%; box-sizing:border-box; padding:0.3rem 0.34rem; }
.mt-booking-pill strong { line-height:1.1; }
.mt-booking-pill span { font-size:0.62rem; color:rgba(0,0,0,0.64); }

/* Kompakt/printvänlig modal: visa readonly-fält som text */
.mt-modal-form input[readonly],
.mt-modal-form textarea[readonly],
.mt-modal-form select[disabled] {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    width: 100%;
    font-size: .95rem;
    color: #111827;
}
.mt-modal-form .mt-field { margin-bottom: .45rem; }
.mt-modal-form .mt-field label { font-weight:600; display:block; margin-bottom:.15rem; }

/* Header action (align edit button) */
.mt-modal-header { position: relative; }
.mt-modal-header-actions { position: absolute; right: 0; top: 12px; }
.mt-modal-header-actions .mt-button-secondary { margin-left: 8px; }

.mt-modal-close-inline {
    display: none;
    margin: .5rem 0 0;
}

.mt-modal-avrapportering-collapsed {
    display: none;
}
.mt-modal-form.mt-modal-form-wide .mt-modal-avrapportering-collapsed {
    display: block;
}

.mt-modal.mt-modal-editing .mt-modal-dialog {
    max-width: 1040px;
    width: calc(100% - 1rem);
    max-height: calc(100vh - 2.1rem);
}
.mt-modal.mt-modal-editing #mt-booking-modal-body {
    padding: .72rem .84rem .9rem;
}
.mt-modal.mt-modal-editing form.mt-modal-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}
.mt-modal.mt-modal-editing form.mt-modal-form .mt-modal-section {
    flex: 1 1 360px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.mt-modal.mt-modal-editing form.mt-modal-form .mt-modal-section-full {
    flex: 1 1 100%;
}
@media (max-width: 960px) {
    .mt-modal.mt-modal-editing form.mt-modal-form {
        display: block;
    }
    .mt-modal.mt-modal-editing form.mt-modal-form .mt-modal-section {
        flex: 1 1 100%;
    }
}

/* Kalenderns modal ska inte växa på höjden i redigeringsläge */
.mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-dialog {
    max-width: 1280px;
    width: min(1280px, calc(100vw - 1rem));
    max-height: calc(100vh - 1.5rem);
}
.mt-modal.mt-modal-context-calendar.mt-modal-editing #mt-booking-modal-body {
    padding: .68rem .84rem .9rem;
    overflow-x: hidden;
}
.mt-modal.mt-modal-context-calendar.mt-modal-editing form.mt-modal-form {
    display: block;
}
.mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-section {
    margin-top: .55rem;
    padding-top: .45rem;
}
.mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-map,
.mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-map-actions,
.mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-summary {
    display: none !important;
}
.mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-section-actions {
    display: flex !important;
    flex-wrap: wrap;
}
.mt-modal-calendar-layout {
    display: block;
}
.mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(19rem, 27rem);
    gap: 1.1rem;
    align-items: start;
}
.mt-modal-calendar-main {
    min-width: 0;
}
.mt-modal-calendar-side {
    min-width: 0;
    position: relative;
    z-index: 4;
}
.mt-modal-calendar-edit-panel {
    display: none;
    margin-bottom: .75rem;
    position: relative;
    z-index: 4;
}
.mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-calendar-edit-panel {
    display: block;
}
.mt-modal-schedule-columns {
    display: block;
}
.mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-schedule-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
    align-items: start;
}
.mt-modal-schedule-col {
    flex: 1 1 0;
    min-width: 0;
}
.mt-montor-day-summary {
    display: none;
    margin-top: .6rem;
    padding: .6rem .7rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}
.mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-montor-day-summary {
    display: block;
}
.mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-montor-day-summary {
    margin-top: 0;
}
.mt-montor-day-summary-title {
    font-weight: 700;
    font-size: .85rem;
    color: #374151;
    margin-bottom: .35rem;
}
.mt-montor-day-summary-body {
    font-size: .88rem;
    color: #111827;
}
.mt-montor-day-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.mt-montor-day-summary-list li {
    display: flex;
    gap: .5rem;
    align-items: baseline;
}
.mt-montor-day-time {
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
}
.mt-montor-day-meta {
    color: #374151;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}
.mt-montor-day-summary-empty,
.mt-montor-day-summary-loading {
    color: #6b7280;
    font-size: .85rem;
}

.mt-modal-section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    position: relative;
    z-index: 6;
    pointer-events: auto;
}
.mt-modal-section-actions button,
.mt-modal-section-actions a,
.mt-modal-section-actions form {
    position: relative;
    z-index: 6;
    pointer-events: auto;
}
.mt-modal-action-button {
    flex: 1 1 160px;
}
.mt-modal-section-actions .mt-delete-booking-form {
    flex: 1 1 100%;
}
.mt-modal-section-actions .mt-delete-booking-form .mt-delete-booking,
.mt-modal-section-actions .mt-delete-booking-form button {
    width: 100%;
}
@media (max-width: 640px) {
    .mt-modal-section-actions {
        flex-direction: column;
    }
    .mt-modal-action-button {
        width: 100%;
        flex: 1 1 auto;
    }
}
@media (max-width: 1120px) {
    .mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-calendar-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-calendar-side {
        margin-top: .85rem;
    }
}
@media (max-width: 860px) {
    .mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-schedule-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 720px) {
    .mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-dialog {
        width: calc(100vw - .5rem);
        max-height: calc(100vh - .5rem);
    }
    .mt-modal.mt-modal-context-calendar.mt-modal-editing #mt-booking-modal-body {
        padding: .55rem .6rem .75rem;
    }
    .mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-calendar-layout {
        display: block;
    }
    .mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-modal-schedule-columns {
        display: block;
    }
    .mt-modal.mt-modal-context-calendar.mt-modal-editing .mt-montor-day-summary {
        margin-top: .6rem;
    }
}

/* Compact read-only summary for booking detail */
#mt-booking-modal-body .mt-modal-summary { margin-bottom: .5rem; padding: .5rem; background: #fff; border: 1px solid #eef2f7; border-radius: 8px; }
.mt-modal-summary .mt-summary-row { display:flex; gap:0.75rem; padding:.25rem 0; align-items:flex-start; }
.mt-modal-summary .mt-summary-label { width:7.5rem; font-weight:700; color:#374151; }
.mt-modal-summary .mt-summary-val { color:#111827; flex:1; font-size:0.95rem; }
.mt-modal-summary .mt-summary-val br { content: ""; }
.mt-modal-map {
    margin-top: .75rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #f9fafb;
    min-height: 134px;
}
.mt-modal-map iframe {
    width: 100%;
    height: 130px;
    border: 0;
    display: block;
}
.mt-modal-map-actions {
    margin-top: .35rem;
    text-align: right;
}
.mt-modal-map-actions a {
    font-size: .85rem;
    color: #2563eb;
    text-decoration: none;
}
.mt-modal-map-actions a:hover {
    text-decoration: underline;
}
.mt-summary-logo-wrap { display: none; }

/* When we show the editable form, make it visually distinct */
.mt-modal-form { background: transparent; border: none; padding: 0; }

/* Logo in summary */
.mt-summary-logo-wrap { float:left; margin-right:12px; }
.mt-summary-logo { max-height:48px; max-width:160px; display:block; }

/* Print notes area (hidden on screen) */
.mt-print-notes { display:none; margin-top:12px; }
.mt-print-notes h4 { margin:6px 0; font-size:1rem; }
.mt-print-notes-lines { border-top:1px solid #e6eef6; padding-top:8px; }
.mt-print-note-line { height:1.2rem; border-bottom:1px solid rgba(0,0,0,0.06); margin-bottom:6px; }

/* Print-specific: when printing, hide everything except modal content (if open), and show notes */
@media print {
    /* hide all by default */
    body * { visibility: hidden !important; }
    /* show modal and its contents */
    .mt-modal.mt-modal-open, .mt-modal.mt-modal-open * { visibility: visible !important; }
    /* place modal content at top-left of page */
    .mt-modal.mt-modal-open { position: static !important; top: auto !important; left: auto !important; width: 100% !important; box-shadow: none !important; }
    /* ensure modal dialog expands */
    .mt-modal-dialog { max-width: 100% !important; width: 100% !important; }
    /* show print notes */
    .mt-print-notes { display:block !important; }
    /* remove modal backdrop from print */
    .mt-modal-backdrop { display:none !important; }
    /* simplify summary layout for print */
    .mt-modal-summary { border: none !important; background: #fff !important; padding: 0 !important; }
    .mt-summary-logo-wrap { float:left; margin-right:12px; }
}

@media (min-width: 960px) {
    .mt-modal-form-wide {
        column-count: 2;
        column-gap: 1.25rem;
    }
    .mt-modal-form-wide .mt-modal-section {
        break-inside: avoid;
    }
    .mt-modal-form-wide .mt-modal-section-full,
    #mt-booking-modal-body .mt-modal-map,
    #mt-booking-modal-body .mt-modal-map-actions {
        column-span: all;
    }
}

/* Force two-column layout for montör/admin modaler (utan att bryta headern) */
.mt-modal.mt-modal-context-my_day:not(.mt-modal-editing) #mt-booking-modal-body,
.mt-modal.mt-modal-context-admin:not(.mt-modal-editing) #mt-booking-modal-body {
    display: block;
}

.mt-modal.mt-modal-context-my_day:not(.mt-modal-editing) .mt-modal-dialog,
.mt-modal.mt-modal-context-admin:not(.mt-modal-editing) .mt-modal-dialog {
    max-width: 780px;
    width: min(780px, calc(100% - 2rem));
    min-width: 0;
}

@media (min-width: 960px) {
    .mt-modal.mt-modal-context-my_day:not(.mt-modal-editing) form.mt-modal-form,
    .mt-modal.mt-modal-context-admin:not(.mt-modal-editing) form.mt-modal-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem 1.5rem;
        align-items: start;
    }

    /* Default: sections span full width */
    .mt-modal.mt-modal-context-my_day:not(.mt-modal-editing) form.mt-modal-form .mt-modal-section-full,
    .mt-modal.mt-modal-context-admin:not(.mt-modal-editing) form.mt-modal-form .mt-modal-section-full {
        grid-column: 1 / -1;
    }

    /* Kundeinfo till vänster, avrapportering till höger */
    .mt-modal.mt-modal-context-my_day:not(.mt-modal-editing) form.mt-modal-form .mt-modal-section-customer,
    .mt-modal.mt-modal-context-admin:not(.mt-modal-editing) form.mt-modal-form .mt-modal-section-customer {
        grid-column: 1;
        min-width: 0;
    }
    .mt-modal.mt-modal-context-my_day:not(.mt-modal-editing) form.mt-modal-form .mt-modal-section-report,
    .mt-modal.mt-modal-context-admin:not(.mt-modal-editing) form.mt-modal-form .mt-modal-section-report {
        grid-column: 2;
        min-width: 0;
    }

    /* Actions: compact row, aligned to the right */
    .mt-modal.mt-modal-context-my_day:not(.mt-modal-editing) .mt-modal-section-actions,
    .mt-modal.mt-modal-context-admin:not(.mt-modal-editing) .mt-modal-section-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
        gap: .75rem;
    }
    .mt-modal.mt-modal-context-my_day:not(.mt-modal-editing) .mt-modal-section-actions .mt-modal-action-button,
    .mt-modal.mt-modal-context-admin:not(.mt-modal-editing) .mt-modal-section-actions .mt-modal-action-button {
        flex: 0 0 auto;
    }

    /* Save button sits under avrapportering in the right column */
    .mt-modal.mt-modal-context-my_day:not(.mt-modal-editing) form.mt-modal-form .mt-modal-section-report .mt-modal-save-button,
    .mt-modal.mt-modal-context-admin:not(.mt-modal-editing) form.mt-modal-form .mt-modal-section-report .mt-modal-save-button {
        width: auto;
        min-width: 140px;
    }
}

/* === Sökresultat- & admin-tabeller === */

.mt-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
    margin-top: .5rem;
}

.mt-admin-table th,
.mt-admin-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: .4rem .5rem;
    text-align: left;
}

.mt-admin-table thead {
    background: #f9fafb;
    position: static;
    top: auto;
    z-index: auto;
}

.mt-admin-table-bookings {
    table-layout: fixed;
}
.mt-admin-table-bookings th:nth-child(1),
.mt-admin-table-bookings td:nth-child(1) { width: 10%; }
.mt-admin-table-bookings th:nth-child(2),
.mt-admin-table-bookings td:nth-child(2) { width: 9%; }
.mt-admin-table-bookings th:nth-child(3),
.mt-admin-table-bookings td:nth-child(3) { width: 13%; }
.mt-admin-table-bookings th:nth-child(4),
.mt-admin-table-bookings td:nth-child(4) { width: 15%; }
.mt-admin-table-bookings th:nth-child(5),
.mt-admin-table-bookings td:nth-child(5) { width: 8%; }
.mt-admin-table-bookings th:nth-child(6),
.mt-admin-table-bookings td:nth-child(6) { width: 17%; }
.mt-admin-table-bookings th:nth-child(7),
.mt-admin-table-bookings td:nth-child(7) { width: 28%; }
.mt-admin-table-bookings th,
.mt-admin-table-bookings td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mt-admin-table-bookings td:nth-child(7) {
    overflow: visible;
}
.mt-admin-action-stack {
    width: 100%;
}
.mt-admin-action-stack select,
.mt-admin-action-stack .mt-admin-status-quickchange {
    width: 100%;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
    justify-self: stretch;
}
.mt-admin-action-stack {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .5rem;
    width: 100%;
}
.mt-admin-action-stack .mt-status-chip {
    flex: 0 0 auto;
}
.mt-admin-action-stack select,
.mt-admin-action-stack .mt-admin-status-quickchange {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.mt-clickable-row {
    cursor: pointer;
}

.mt-clickable-row:hover {
    background: #f3f4f6;
}

/* === Statuschips === */

.mt-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.mt-status-chip-booked {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.mt-status-chip-ongoing {
    background: #ecfeff;
    color: #0f766e;
    border-color: #99f6e4;
}

.mt-status-chip-done {
    background: #ecfdf5;
    color: #15803d;
    border-color: #bbf7d0;
}

.mt-status-chip-invoiced {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

/* === My Day (montörsvy) === */

.mt-my-day-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .55rem;
    padding: .45rem .52rem;
    border: 1px solid var(--mt-border);
    border-radius: 10px;
    background: #ffffff;
}

.mt-my-day-date-label {
    font-size: .9rem;
    color: #4b5563;
}

.mt-my-day-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
}

.mt-my-day-filters {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.mt-my-day-filters label span {
    font-size: .8rem;
    font-weight: 600;
}

.mt-my-day-filters input[type="date"],
.mt-my-day-filters select {
    padding: 0.42rem 0.58rem;
    border-radius: 9px;
    border: 1px solid var(--mt-border-strong);
    font-size: 0.78rem;
    color: var(--mt-text);
    background: #fff;
}
.mt-my-day-filters button[type="submit"] {
    display: none;
}

.mt-my-day-statusbar,
.mt-admin-statusbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}

.mt-status-summary-pill {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    padding: .4rem .7rem;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: .75rem;
}

.mt-status-summary-label {
    font-size: .7rem;
    color: #6b7280;
}

.mt-status-summary-value {
    font-weight: 700;
    font-size: .9rem;
    color: #111827;
}

.mt-status-summary-overdue {
    background: #fef2f2;
    color: #b91c1c;
}
.mt-status-summary-ongoing {
    background: #ecfeff;
    color: #0f766e;
}

.mt-my-day-viewnote {
    font-size: .8rem;
    color: #4b5563;
    margin-bottom: .5rem;
}

.mt-my-day-viewnote-warning {
    color: #b91c1c;
}

.mt-my-day-overdue-list {
    margin: 1rem 0;
}
.mt-my-day-overdue-list h3 {
    margin-bottom: .35rem;
    font-size: .95rem;
}
.mt-my-day-overdue-cards {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.mt-my-day-overdue-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: .48rem .56rem;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    cursor: pointer;
}
.mt-my-day-overdue-card.mt-status-ongoing {
    border-left: 4px solid #0f766e;
    background: #f0fdff;
}
.mt-my-day-overdue-card.mt-status-done {
    border-left: 4px solid #ca8a04;
    background: #fef9c3;
}
.mt-my-day-overdue-headline {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    font-size: .8rem;
    color: #475569;
    margin-bottom: .35rem;
}
.mt-my-day-overdue-date {
    font-weight: 700;
    color: #1d4ed8;
}
.mt-my-day-overdue-montor {
    margin-left: auto;
    font-weight: 600;
}
.mt-my-day-overdue-body strong {
    display: block;
    font-size: .95rem;
    color: #111827;
}
.mt-my-day-overdue-city {
    font-size: .8rem;
    color: #6b7280;
}
.mt-my-day-overdue-case {
    margin-top: .25rem;
    font-size: .8rem;
    color: #374151;
}

/* Kort/”appig” montörsvy */

.mt-my-day-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: .5rem;
}

.mt-my-day-card {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: .5rem .62rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    cursor: pointer;
}

.mt-my-day-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}
.mt-my-day-card-title {
    min-width: 0;
}
.mt-my-day-card-header h3 {
    margin: 0 0 .1rem 0;
    font-size: .95rem;
}

.mt-my-day-card-sub {
    margin: 0;
    font-size: .8rem;
    color: #6b7280;
}

.mt-my-day-card-montor {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    margin: 0.1rem 0 .35rem;
    font-size: .75rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    font-weight: 600;
}
.mt-my-day-card-montor-right {
    margin: 0;
    align-self: flex-start;
}

.mt-my-day-card-address {
    margin: .4rem 0 .6rem;
    font-size: .8rem;
    color: #374151;
}
.mt-my-day-card-takeover-hint {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    margin-left: .3rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mt-my-day-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.mt-my-day-card.mt-status-booked {
    border-left: 4px solid #3b82f6;
}

.mt-my-day-card.mt-status-ongoing {
    border-left: 4px solid #0f766e;
}

.mt-my-day-card.mt-status-done {
    border-left: 4px solid #16a34a;
}

.mt-my-day-card.mt-status-invoiced {
    border-left: 4px solid #d97706;
}

@media (min-width: 1024px) {
    .mt-my-day-wrapper {
        --mt-myday-control-height: 34px;
    }

    .mt-my-day-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: .65rem 1rem;
        margin-bottom: .42rem;
        padding: .38rem .46rem;
    }

    .mt-my-day-header h2 {
        margin-bottom: .12rem;
        font-size: .94rem;
    }

    .mt-my-day-date-label {
        font-size: .78rem;
        margin: 0;
    }

    .mt-my-day-header-right {
        gap: .34rem;
        align-items: flex-end;
    }

    .mt-my-day-filters {
        gap: .35rem;
        align-items: end;
        flex-wrap: nowrap;
    }

    .mt-my-day-filters label {
        display: flex;
        flex-direction: column;
        gap: .16rem;
        min-width: 0;
    }

    .mt-my-day-filters label span {
        font-size: .66rem;
        letter-spacing: .05em;
        text-transform: uppercase;
    }

    .mt-my-day-filters input[type="date"],
    .mt-my-day-filters select {
        min-height: var(--mt-myday-control-height);
        height: var(--mt-myday-control-height);
        padding: 0.34rem 0.54rem;
        font-size: 0.74rem;
        line-height: 1.15;
    }

    .mt-my-day-print-all,
    .mt-toggle-unav-panel {
        padding: 0.34rem 0.56rem;
        font-size: 0.72rem;
    }

    .mt-my-day-unav-actions {
        margin: .6rem 0 0;
    }

    .mt-my-day-statusbar {
        gap: .38rem;
        margin-bottom: .55rem;
    }

    .mt-status-summary-pill {
        padding: .28rem .58rem;
        border-radius: 14px;
        gap: .04rem;
        min-width: 84px;
    }

    .mt-status-summary-label {
        font-size: .62rem;
        line-height: 1.1;
    }

    .mt-status-summary-value {
        font-size: .82rem;
        line-height: 1.1;
    }

    .mt-my-day-viewnote {
        margin-bottom: .32rem;
        font-size: .76rem;
    }

    .mt-my-day-overdue-list {
        margin: .72rem 0;
    }

    .mt-my-day-overdue-list h3 {
        margin-bottom: .28rem;
        font-size: .88rem;
    }

    .mt-my-day-overdue-cards {
        gap: .42rem;
    }

    .mt-my-day-overdue-card {
        padding: .42rem .5rem;
        border-radius: 9px;
    }

    .mt-my-day-overdue-headline,
    .mt-my-day-overdue-city,
    .mt-my-day-overdue-case {
        font-size: .74rem;
    }

    .mt-my-day-overdue-body strong {
        font-size: .88rem;
    }

    .mt-my-day-cards {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: .42rem;
    }

    .mt-my-day-card {
        padding: .42rem .52rem;
        border-radius: 9px;
        box-shadow: 0 3px 8px rgba(0,0,0,0.03);
    }

    .mt-my-day-card-header {
        gap: .38rem;
    }

    .mt-my-day-card-header h3 {
        font-size: .88rem;
        line-height: 1.14;
    }

    .mt-my-day-card-sub,
    .mt-my-day-card-address {
        font-size: .74rem;
    }

    .mt-my-day-card-sub {
        margin-top: .12rem;
    }

    .mt-my-day-card-address {
        margin: .26rem 0 .46rem;
    }

    .mt-my-day-card-montor {
        padding: 0.12rem 0.44rem;
        margin: 0;
        font-size: .68rem;
    }

    .mt-my-day-card-takeover-hint {
        padding: 0.12rem 0.42rem;
        margin-left: 0;
        margin-top: .22rem;
        font-size: .62rem;
    }

    .mt-my-day-actions {
        gap: .3rem;
    }

    .mt-my-day-actions .mt-button-primary,
    .mt-my-day-actions .mt-button-secondary {
        padding: 0.34rem 0.52rem;
        font-size: .7rem;
        min-height: 30px;
    }

    .mt-my-day-availability {
        margin-bottom: .72rem;
        padding: .58rem .7rem;
    }

    .mt-my-day-availability-list ul {
        font-size: .75rem;
    }
}

/* === Admin-översikt === */

.mt-admin-overview-wrapper h2 {
    margin-bottom: 1rem;
}

.mt-admin-section {
    margin-top: .7rem;
    padding: .55rem .62rem;
    border: 1px solid var(--mt-border);
    border-radius: 10px;
    background: #ffffff;
}

.mt-admin-search-form {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: .5rem;
    padding: .42rem .48rem;
    border: 1px solid var(--mt-border);
    border-radius: 10px;
    background: #ffffff;
}

.mt-admin-search-form input[type="text"] {
    flex: 1 1 260px;
    padding: 0.42rem 0.58rem;
    border-radius: 9px;
    border: 1px solid var(--mt-border-strong);
    font-size: 0.78rem;
}

.mt-admin-availability-filter {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: .5rem;
    padding: .42rem .48rem;
    border: 1px solid var(--mt-border);
    border-radius: 10px;
    background: #ffffff;
}

.mt-admin-availability-filter label span {
    font-size: .8rem;
    font-weight: 600;
}

.mt-admin-availability-filter select {
    padding: 0.42rem 0.58rem;
    border-radius: 9px;
    border: 1px solid var(--mt-border-strong);
    font-size: 0.78rem;
    background: #fff;
}

.mt-admin-warning-note {
    font-size: .8rem;
    color: #b91c1c;
    margin-bottom: .75rem;
}
.mt-admin-note {
    font-size: .85rem;
    color: #4b5563;
    margin: 0 0 .6rem;
}
.mt-admin-pagination {
    margin-top: .75rem;
}
.mt-admin-pagination ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: 0;
    margin: 0;
}
.mt-admin-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.35rem 0.62rem;
    border-radius: 10px;
    border: 1px solid var(--mt-border-strong);
    background: #fff;
    color: var(--mt-text);
    text-decoration: none;
    font-size: 0.8rem;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.mt-admin-pagination .page-numbers:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}
.mt-admin-pagination .page-numbers.current {
    background: #111827;
    border-color: #111827;
    color: #fff;
}
.mt-admin-pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
}
.mt-overdue-hidden { display: none; }
.mt-admin-loadmore-wrap {
    margin-top: .5rem;
}

.mt-inline-form {
    display: inline-block;
    margin-left: .5rem;
}

.mt-admin-mass-unav {
    margin: 1rem 0;
    padding: .75rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}
.mt-admin-mass-unav-form .mt-field-row {
    margin-bottom: .5rem;
}
.mt-admin-mass-unav-form .mt-field {
    margin-bottom: .35rem;
}

.mt-admin-status-quickchange {
    min-width: 130px;
    padding: .25rem .35rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: .8rem;
    background: #fff;
}

@media (max-width: 768px) {
    .mt-admin-section {
        overflow-x: auto;
    }
    .mt-admin-section > table {
        min-width: 640px;
    }
    .mt-admin-availability-filter,
    .mt-admin-availability-form .mt-field-row,
    .mt-admin-availability-form {
        flex-direction: column;
        gap: .5rem;
    }
    .mt-admin-availability-filter label,
    .mt-admin-availability-form .mt-field {
        width: 100%;
    }
    .mt-admin-availability-filter select,
    .mt-admin-availability-form input[type="date"],
    .mt-admin-availability-form input[type="text"],
    .mt-admin-status-quickchange {
        width: 100%;
    }
    .mt-booking-grid {
        grid-template-columns: 1fr;
    }
    .mt-my-day-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .mt-field-row {
        flex-direction: column;
    }
    .mt-field-row .mt-field {
        width: 100%;
    }
    .mt-calendar-filter-form,
    .mt-calendar-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    .mt-calendar-tools,
    .mt-calendar-search-form {
        grid-template-columns: 1fr;
    }
    .mt-calendar-filter-form label,
    .mt-calendar-search-inputwrap,
    .mt-calendar-search-form input[type="text"],
    .mt-calendar-filter-form select,
    .mt-calendar-history-toggle,
    .mt-calendar-search-submit {
        width: 100%;
    }
    .mt-modal.mt-modal-context-my_day .mt-modal-dialog,
    .mt-modal.mt-modal-context-admin .mt-modal-dialog {
        width: calc(100% - .5rem) !important;
        max-width: 100% !important;
    }
    .mt-my-day-header-right {
        align-items: stretch;
    }
    .mt-my-day-header-right form {
        width: 100%;
    }
    .mt-my-day-filters {
        width: 100%;
    }
    .mt-my-day-filters label,
    .mt-my-day-filters select,
    .mt-my-day-filters input[type="date"] {
        width: 100%;
    }
    .mt-button-fullwidth-on-mobile {
        width: 100%;
    }
    .mt-modal-close-inline {
        display: inline-flex;
        justify-content: center;
        width: 100%;
        margin-top: .75rem;
    }
}

/* Rad som är klar men ej fakturerad – markera svagt */

.mt-row-done-not-invoiced {
    background: #fefce8;
}
.mt-row-ongoing {
    background: #ecfeff;
}

/* === Hitta tid / Flytta tid === */

body.mt-scheduler-tools-modal-open {
    overflow: hidden !important;
}

body.mt-scheduler-tools-modal-open .mt-theme-toggle-fab {
    opacity: 0;
    pointer-events: none;
}

.mt-scheduler-tools-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483634;
}

.mt-scheduler-tools-modal.mt-scheduler-tools-modal-open {
    display: block;
}

.mt-scheduler-tools-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}

.mt-scheduler-tools-dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, calc(100% - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: var(--mt-card);
    border: 1px solid var(--mt-border);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.mt-scheduler-tools-close {
    position: sticky;
    top: 0.75rem;
    float: right;
    margin: 0.75rem 0.75rem 0 0;
    width: 38px;
    height: 38px;
    border: 1px solid var(--mt-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--mt-text);
    font-size: 1.28rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.mt-scheduler-tools-head {
    padding: 1.1rem 1.2rem 0.4rem;
}

.mt-scheduler-tools-kicker {
    margin: 0 0 0.28rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mt-primary-strong);
}

.mt-scheduler-tools-head h3 {
    margin: 0;
    font-size: 1.22rem;
    color: var(--mt-text);
}

.mt-scheduler-tools-subtitle {
    margin: 0.38rem 0 0;
    color: var(--mt-text-muted);
    font-size: 0.92rem;
}

.mt-scheduler-tools-body {
    padding: 0.9rem 1.2rem 1.2rem;
}

.mt-scheduler-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) 120px 200px;
    gap: 0.75rem;
    align-items: end;
}

.mt-scheduler-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.85rem;
}

.mt-find-time-feedback {
    display: none;
    margin-top: 0.75rem;
    padding: 0.72rem 0.84rem;
    border-radius: 12px;
    border: 1px solid var(--mt-border);
    background: #f8fafc;
    color: var(--mt-text-muted);
    font-size: 0.88rem;
}

.mt-find-time-feedback.is-error {
    border-color: rgba(220, 38, 38, 0.18);
    background: #fef2f2;
    color: #991b1b;
}

.mt-find-time-results {
    margin-top: 0.9rem;
}

.mt-scheduler-loading {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mt-scheduler-loading .mt-spinner {
    width: 34px;
    height: 34px;
    border: 4px solid rgba(15, 23, 42, 0.08);
    border-top-color: var(--mt-primary-strong);
    border-radius: 50%;
    animation: mt-spin 1s linear infinite;
}

.mt-scheduler-results-grid,
.mt-scheduler-alerts-list {
    display: grid;
    gap: 0.75rem;
}

.mt-scheduler-results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
    padding: 0.72rem 0.84rem;
    border: 1px solid var(--mt-border);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.9);
}

.mt-scheduler-results-summary {
    margin: 0;
    color: var(--mt-text-muted);
    font-size: 0.88rem;
}

.mt-scheduler-results-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--mt-text);
    cursor: pointer;
    white-space: nowrap;
}

.mt-scheduler-results-toggle input {
    margin: 0;
}

.mt-scheduler-card {
    border: 1px solid var(--mt-border);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    padding: 0.9rem 0.95rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.mt-scheduler-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.52rem;
}

.mt-scheduler-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 0.68rem;
    border-radius: 999px;
    background: var(--mt-primary-soft);
    color: var(--mt-primary-strong);
    font-size: 0.73rem;
    font-weight: 700;
}

.mt-scheduler-chip.is-highlight {
    background: rgba(251, 191, 36, 0.16);
    color: #92400e;
}

.mt-scheduler-card h4 {
    margin: 0 0 0.28rem;
    font-size: 1rem;
    color: var(--mt-text);
}

.mt-scheduler-card-time,
.mt-time-alert-line {
    margin: 0.18rem 0 0;
    color: var(--mt-text);
    font-size: 0.92rem;
}

.mt-scheduler-card-montor,
.mt-scheduler-card-note {
    color: var(--mt-text-muted);
    font-size: 0.86rem;
}

.mt-scheduler-card-note {
    margin: 0.45rem 0 0;
    line-height: 1.45;
}

.mt-scheduler-travel-meta {
    margin-top: 0.58rem;
    padding-top: 0.58rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.mt-scheduler-travel-line {
    margin: 0.22rem 0 0;
    color: var(--mt-text-muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.mt-scheduler-travel-line strong {
    color: var(--mt-text);
    font-weight: 700;
}

.mt-scheduler-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.82rem;
}

.mt-scheduler-result-card.is-started-day {
    border-color: rgba(14, 165, 233, 0.18);
}

.mt-scheduler-result-card.is-empty-day {
    border-style: dashed;
}

.mt-scheduler-empty-state {
    padding: 1rem 1.05rem;
    border: 1px dashed var(--mt-border-strong);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.86);
}

.mt-scheduler-empty-state strong {
    display: block;
    margin-bottom: 0.28rem;
    color: var(--mt-text);
}

.mt-scheduler-empty-state p {
    margin: 0;
    color: var(--mt-text-muted);
}

/* === Modal === */

/* Keep modal above site header/banner layers */
.mt-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483640;
}

.mt-modal.mt-modal-open {
    display: block;
}

body.mt-modal-page-open {
    overflow: hidden !important;
}

.mt-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.45);
    z-index: 2147483640;
}

.mt-modal-dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 680px;
    width: calc(100% - 2rem);
    max-height: calc(100vh - 1rem);
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 34px rgba(0,0,0,0.2);
    z-index: 2147483641;
    display: flex;
    flex-direction: column;
}
.mt-modal.mt-modal-context-my_day .mt-modal-dialog,
.mt-modal.mt-modal-context-admin .mt-modal-dialog {
    max-width: 900px;
    width: calc(100% - 2rem);
    max-height: calc(100vh - (var(--mt-modal-top-offset, 0px) + 32px));
}

.mt-modal-close {
    position: absolute;
    top: .4rem;
    right: .5rem;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    z-index: 6;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.mt-modal-close:hover,
.mt-modal-close:focus {
    background: transparent;
    color: #111827;
    outline: none;
}
.mt-modal-close-floating {
    position: fixed;
    top: calc(.75rem + env(safe-area-inset-top, 0));
    right: calc(.75rem + env(safe-area-inset-right, 0));
    z-index: 2147483646;
    width: 38px;
    height: 38px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1.4rem;
    display: none;
    color: #111827;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.mt-modal.mt-modal-open .mt-modal-close-floating {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

@media (min-width: 769px) {
    .mt-modal-close-floating {
        display: none !important;
    }
}

#mt-booking-modal-body {
    padding: .72rem .84rem .88rem;
    overflow-y: auto;
}

/* Modal-innehåll */

.mt-modal-header h2 {
    margin: 0 0 .2rem;
    font-size: .98rem;
    overflow-wrap: anywhere;
}

.mt-modal-subtitle {
    margin: 0;
    font-size: .8rem;
    color: #6b7280;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.mt-modal-statuschip-wrapper {
    margin-top: .4rem;
}

.mt-modal-section {
    margin-top: .58rem;
    padding-top: .45rem;
    border-top: 1px solid #e5e7eb;
}
.mt-modal-section:first-of-type {
    margin-top: .35rem;
    padding-top: 0;
    border-top: none;
}
.mt-modal-section-full {
    width: 100%;
}

.mt-modal-images img {
    display: inline-block;
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: .4rem;
    margin-bottom: .4rem;
    border: 1px solid #e5e7eb;
}

/* Modal image lightbox */

.mt-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}
.mt-lightbox.is-open {
    display: flex;
}
.mt-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}
.mt-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 980px);
    max-height: 88vh;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem 1.75rem;
    border-radius: 16px;
    background: #111827;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.mt-lightbox-image {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 10px;
    background: #0f172a;
}
.mt-lightbox-close {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.mt-lightbox-close:hover,
.mt-lightbox-close:focus {
    background: transparent;
    outline: none;
}
.mt-lightbox-nav {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}
.mt-lightbox-nav:disabled {
    opacity: 0.35;
    cursor: default;
}
.mt-lightbox-counter {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.85rem;
    color: #e5e7eb;
    margin-top: 0.2rem;
}
.mt-lightbox-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .mt-lightbox-dialog {
        width: 94vw;
        max-height: 86vh;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem 0.85rem 1.5rem;
    }
    .mt-lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }
    .mt-lightbox-prev {
        left: 0.5rem;
    }
    .mt-lightbox-next {
        right: 0.5rem;
    }
}

/* Read-only lista (admin/montörinfo) */

.mt-modal-readonly-list {
    margin: 0;
    padding: 0;
}

.mt-modal-readonly-list dt {
    font-weight: 600;
    font-size: .8rem;
    margin-top: .4rem;
}

.mt-modal-readonly-list dd {
    margin: 0;
    font-size: .8rem;
}

/* Logglista */

.mt-booking-log-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: .8rem;
}

.mt-booking-log-list li {
    margin-bottom: .2rem;
}

/* === Diverse === */

.mt-my-day-availability {
    margin-bottom: 1rem;
    padding: .75rem .9rem;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}
.mt-my-day-unav-actions {
    margin: 1rem 0 0;
}
.mt-my-day-availability-panel {
    display: none;
}
.mt-my-day-availability-panel.mt-open {
    display: block;
}

.mt-my-day-availability-list ul {
    margin: .5rem 0 0;
    padding-left: 1.1rem;
    font-size: .8rem;
}

.mt-my-day-availability-list li {
    margin-bottom: .2rem;
}

/* === Dark mode readability hardening === */

html.mt-theme-dark .mt-live-search-results,
html.mt-theme-dark #mt-booking-modal-body .mt-modal-summary,
html.mt-theme-dark .mt-modal-map,
html.mt-theme-dark .mt-montor-day-summary,
html.mt-theme-dark .mt-my-day-header,
html.mt-theme-dark .mt-status-summary-pill,
html.mt-theme-dark .mt-my-day-overdue-card,
html.mt-theme-dark .mt-my-day-availability,
html.mt-theme-dark .mt-admin-table thead,
html.mt-theme-dark .mt-map-placeholder,
html.mt-theme-dark .mt-day-freehours-chip,
html.mt-theme-dark .mt-calendar-unav,
html.mt-theme-dark .mt-calendar-unav-chip {
    background: linear-gradient(180deg, #272c32 0%, #1b1f24 100%);
    border-color: var(--mt-border);
    color: var(--mt-text);
}

html.mt-theme-dark .mt-live-search-item:hover,
html.mt-theme-dark .mt-live-search-item:focus,
html.mt-theme-dark .mt-live-search-active,
html.mt-theme-dark .mt-clickable-row:hover {
    background: #31363d;
}

html.mt-theme-dark .mt-live-search-active {
    outline-color: rgba(137, 167, 182, 0.2);
}

html.mt-theme-dark .mt-live-search-row.small,
html.mt-theme-dark .mt-live-search-length,
html.mt-theme-dark .mt-live-search-none,
html.mt-theme-dark .mt-modal-subtitle,
html.mt-theme-dark .mt-modal-summary .mt-summary-label,
html.mt-theme-dark .mt-modal-map-actions a,
html.mt-theme-dark .mt-montor-day-summary-title,
html.mt-theme-dark .mt-montor-day-meta,
html.mt-theme-dark .mt-montor-day-summary-empty,
html.mt-theme-dark .mt-montor-day-summary-loading,
html.mt-theme-dark .mt-my-day-date-label,
html.mt-theme-dark .mt-my-day-viewnote,
html.mt-theme-dark .mt-status-summary-label,
html.mt-theme-dark .mt-my-day-overdue-headline,
html.mt-theme-dark .mt-my-day-overdue-city,
html.mt-theme-dark .mt-my-day-overdue-case,
html.mt-theme-dark .mt-my-day-card-sub,
html.mt-theme-dark .mt-my-day-card-address,
html.mt-theme-dark .mt-admin-note,
html.mt-theme-dark .mt-map-placeholder,
html.mt-theme-dark .mt-day-freehours-hint,
html.mt-theme-dark .mt-day-freehours-label,
html.mt-theme-dark .mt-calendar-unav-note,
html.mt-theme-dark .mt-modal-readonly-list dt {
    color: var(--mt-text-muted);
}

html.mt-theme-dark .mt-live-search-item,
html.mt-theme-dark .mt-modal-summary .mt-summary-val,
html.mt-theme-dark .mt-modal-form input[readonly],
html.mt-theme-dark .mt-modal-form textarea[readonly],
html.mt-theme-dark .mt-modal-form select[disabled],
html.mt-theme-dark .mt-modal-readonly-list dd,
html.mt-theme-dark .mt-booking-log-list,
html.mt-theme-dark .mt-booking-log-list li,
html.mt-theme-dark .mt-montor-day-summary-body,
html.mt-theme-dark .mt-montor-day-time,
html.mt-theme-dark .mt-my-day-header h2,
html.mt-theme-dark .mt-status-summary-value,
html.mt-theme-dark .mt-my-day-overdue-body strong,
html.mt-theme-dark .mt-my-day-card-header h3,
html.mt-theme-dark .mt-day-freehours-value,
html.mt-theme-dark .mt-calendar-unav h4,
html.mt-theme-dark .mt-calendar-unav-chip,
html.mt-theme-dark .mt-calendar-unav-chip strong,
html.mt-theme-dark .mt-admin-table th,
html.mt-theme-dark .mt-admin-table td,
html.mt-theme-dark .mt-admin-table td a,
html.mt-theme-dark .mt-admin-table th a {
    color: var(--mt-text);
}

html.mt-theme-dark .mt-live-search-row mark {
    background: rgba(137, 167, 182, 0.24);
    color: #f7fafc;
}

html.mt-theme-dark .mt-modal-section,
html.mt-theme-dark .mt-modal-images img,
html.mt-theme-dark .mt-admin-table th,
html.mt-theme-dark .mt-admin-table td,
html.mt-theme-dark .mt-admin-table thead,
html.mt-theme-dark .mt-my-day-availability,
html.mt-theme-dark .mt-map-placeholder,
html.mt-theme-dark .mt-day-freehours-chip,
html.mt-theme-dark .mt-calendar-unav,
html.mt-theme-dark .mt-calendar-unav-chip {
    border-color: var(--mt-border);
}

html.mt-theme-dark .mt-modal-map-actions a:hover,
html.mt-theme-dark .mt-modal-map-actions a:focus {
    color: #d8e3e8;
}

html.mt-theme-dark .mt-status-summary-overdue {
    background: linear-gradient(180deg, #3a2a2f 0%, #251a1d 100%);
    color: #f0d2d8;
    border-color: #5a4046;
}

html.mt-theme-dark .mt-status-summary-ongoing {
    background: linear-gradient(180deg, #213239 0%, #18242a 100%);
    color: #cce0e2;
    border-color: #37515a;
}

html.mt-theme-dark .mt-my-day-overdue-card.mt-status-ongoing {
    background: linear-gradient(180deg, #223238 0%, #182127 100%);
    border-left-color: #6f93a6;
}

html.mt-theme-dark .mt-my-day-overdue-card.mt-status-done {
    background: linear-gradient(180deg, #31301f 0%, #212014 100%);
    border-left-color: #a58a49;
}

html.mt-theme-dark .mt-my-day-overdue-date {
    color: #c3d4dd;
}

html.mt-theme-dark .mt-my-day-card-montor {
    background: #2d3642;
    color: #d7e3ec;
}

html.mt-theme-dark .mt-my-day-card-takeover-hint {
    background: #22362f;
    color: #c8ddd4;
}

html.mt-theme-dark .mt-admin-pagination .page-numbers:hover {
    background: #31363d;
    border-color: #68747f;
    color: #f7fafc;
}

html.mt-theme-dark .mt-admin-pagination .page-numbers.current {
    background: #dce5ea;
    border-color: #dce5ea;
    color: #172026;
}

html.mt-theme-dark .mt-admin-mass-unav,
html.mt-theme-dark .mt-admin-search-form,
html.mt-theme-dark .mt-admin-availability-filter,
html.mt-theme-dark .mt-admin-section {
    background: linear-gradient(180deg, #272c32 0%, #1b1f24 100%);
    border-color: var(--mt-border);
    color: var(--mt-text);
}

html.mt-theme-dark .mt-admin-status-quickchange {
    background: #16191d;
    color: var(--mt-text);
    border-color: var(--mt-border-strong);
}

html.mt-theme-dark .mt-admin-warning-note,
html.mt-theme-dark .mt-day-freehours-unavailable {
    color: #e0b0b7;
}

html.mt-theme-dark .mt-calendar-loading {
    background: rgba(18, 20, 24, 0.76);
}

html.mt-theme-dark .mt-calendar-loading .mt-spinner,
html.mt-theme-dark .mt-map-placeholder.mt-map-loading::after {
    border-color: rgba(255, 255, 255, 0.16);
    border-top-color: #89a7b6;
}

/* === Dark mode finish pass: modal, montör, admin === */

html.mt-theme-dark .mt-my-day-wrapper h2,
html.mt-theme-dark .mt-my-day-overdue-list h3,
html.mt-theme-dark .mt-admin-overview-wrapper h2,
html.mt-theme-dark .mt-admin-section h3,
html.mt-theme-dark .mt-admin-section h4,
html.mt-theme-dark .mt-modal-header h2,
html.mt-theme-dark .mt-modal-section h3,
html.mt-theme-dark .mt-modal-section h4,
html.mt-theme-dark .mt-modal-section-log h3,
html.mt-theme-dark .mt-booking-log-list li strong,
html.mt-theme-dark .mt-admin-warning-note strong,
html.mt-theme-dark .mt-my-day-viewnote strong {
    color: var(--mt-text);
}

html.mt-theme-dark .mt-modal-section p,
html.mt-theme-dark .mt-modal-section li,
html.mt-theme-dark .mt-admin-warning-note,
html.mt-theme-dark .mt-admin-search-form label,
html.mt-theme-dark .mt-my-day-wrapper label,
html.mt-theme-dark .mt-link-phone {
    color: var(--mt-text-muted);
}

html.mt-theme-dark .mt-link-phone:hover,
html.mt-theme-dark .mt-link-phone:focus,
html.mt-theme-dark .mt-modal-summary a,
html.mt-theme-dark .mt-modal-summary a:hover,
html.mt-theme-dark .mt-modal-summary a:focus,
html.mt-theme-dark .mt-modal-map-actions a,
html.mt-theme-dark .mt-modal-map-actions a:hover,
html.mt-theme-dark .mt-modal-map-actions a:focus {
    color: #d7e4ea;
}

html.mt-theme-dark .mt-modal-header,
html.mt-theme-dark .mt-modal-section,
html.mt-theme-dark .mt-modal-section-actions,
html.mt-theme-dark .mt-modal-section-log,
html.mt-theme-dark .mt-modal-readonly-list,
html.mt-theme-dark .mt-admin-section,
html.mt-theme-dark .mt-my-day-header,
html.mt-theme-dark .mt-my-day-overdue-card,
html.mt-theme-dark .mt-my-day-card,
html.mt-theme-dark .mt-my-day-availability {
    color: var(--mt-text);
}

html.mt-theme-dark .mt-modal-close,
html.mt-theme-dark .mt-modal-close-floating {
    background: transparent;
    color: #f3f6f8;
    border-color: transparent;
}

html.mt-theme-dark .mt-modal-close:hover,
html.mt-theme-dark .mt-modal-close:focus,
html.mt-theme-dark .mt-modal-close-floating:hover,
html.mt-theme-dark .mt-modal-close-floating:focus {
    background: transparent;
    color: #ffffff;
}

html.mt-theme-dark .mt-modal-header {
    border-bottom-color: rgba(166, 175, 184, 0.12);
}

html.mt-theme-dark .mt-modal-section {
    border-top-color: rgba(166, 175, 184, 0.12);
}

html.mt-theme-dark .mt-booking-log-list,
html.mt-theme-dark .mt-booking-log-list li,
html.mt-theme-dark .mt-booking-log-list li::marker {
    color: var(--mt-text-muted);
}

html.mt-theme-dark .mt-modal-summary .mt-summary-val a {
    color: #89a7b6;
}

html.mt-theme-dark .mt-modal.mt-modal-context-my_day:not(.mt-modal-editing) .mt-modal-dialog,
html.mt-theme-dark .mt-modal.mt-modal-context-admin:not(.mt-modal-editing) .mt-modal-dialog {
    background: linear-gradient(180deg, #2a2f35 0%, #1b1f24 100%);
}

html.mt-theme-dark .mt-my-day-filters input[type="date"],
html.mt-theme-dark .mt-my-day-filters select,
html.mt-theme-dark .mt-admin-search-form input[type="text"],
html.mt-theme-dark .mt-admin-availability-filter select,
html.mt-theme-dark .mt-admin-availability-form input[type="date"],
html.mt-theme-dark .mt-admin-availability-form input[type="text"],
html.mt-theme-dark .mt-admin-status-quickchange {
    background: #16191d !important;
    color: var(--mt-text) !important;
    border-color: var(--mt-border-strong) !important;
    -webkit-text-fill-color: var(--mt-text);
}

html.mt-theme-dark .mt-my-day-filters input[type="date"]::placeholder,
html.mt-theme-dark .mt-my-day-filters select::placeholder,
html.mt-theme-dark .mt-admin-search-form input[type="text"]::placeholder,
html.mt-theme-dark .mt-admin-availability-form input[type="text"]::placeholder {
    color: rgba(166, 175, 184, 0.72);
}

html.mt-theme-dark .mt-my-day-filters label span,
html.mt-theme-dark .mt-admin-availability-filter label span,
html.mt-theme-dark .mt-admin-search-form label {
    color: var(--mt-text-muted);
}

html.mt-theme-dark .mt-admin-search-form input[type="checkbox"],
html.mt-theme-dark .mt-calendar-history-toggle input,
html.mt-theme-dark .mt-my-day-wrapper input[type="checkbox"] {
    accent-color: #89a7b6;
}

html.mt-theme-dark .mt-status-summary-pill.mt-status-summary-total,
html.mt-theme-dark .mt-status-summary-pill.mt-status-summary-booked,
html.mt-theme-dark .mt-status-summary-pill.mt-status-summary-done,
html.mt-theme-dark .mt-status-summary-pill.mt-status-summary-invoiced {
    background: linear-gradient(180deg, #242a31 0%, #1a1e23 100%);
    border: 1px solid rgba(166, 175, 184, 0.08);
}

html.mt-theme-dark .mt-admin-table tbody tr > td,
html.mt-theme-dark .mt-admin-table tbody tr > th {
    background: transparent;
}

html.mt-theme-dark .mt-admin-table tbody tr td[colspan],
html.mt-theme-dark .mt-admin-table tbody tr td[colspan] strong,
html.mt-theme-dark .mt-admin-table tbody tr td[colspan] a {
    color: var(--mt-text);
}

html.mt-theme-dark .mt-row-done-not-invoiced {
    background: rgba(92, 82, 34, 0.24);
}

html.mt-theme-dark .mt-row-ongoing {
    background: rgba(33, 50, 57, 0.24);
}

html.mt-theme-dark .mt-scheduler-tools-dialog,
html.mt-theme-dark .mt-scheduler-card,
html.mt-theme-dark .mt-scheduler-results-toolbar,
html.mt-theme-dark .mt-find-time-feedback,
html.mt-theme-dark .mt-scheduler-empty-state {
    background: #23282e;
    border-color: var(--mt-border);
    color: var(--mt-text);
}

html.mt-theme-dark .mt-scheduler-tools-close {
    background: rgba(26, 30, 35, 0.96);
    border-color: var(--mt-border-strong);
    color: var(--mt-text);
}

html.mt-theme-dark .mt-scheduler-chip {
    background: rgba(111, 147, 166, 0.16);
    color: #dbe7ee;
}

html.mt-theme-dark .mt-scheduler-results-summary {
    color: var(--mt-text-muted);
}

html.mt-theme-dark .mt-scheduler-results-toggle {
    color: var(--mt-text);
}

html.mt-theme-dark .mt-scheduler-travel-meta {
    border-top-color: rgba(148, 163, 184, 0.18);
}

html.mt-theme-dark .mt-scheduler-chip.is-highlight {
    background: rgba(146, 118, 66, 0.24);
    color: #f2dfb3;
}

html.mt-theme-dark .mt-find-time-feedback {
    background: #252b31;
    color: var(--mt-text-muted);
}

html.mt-theme-dark .mt-find-time-feedback.is-error {
    background: rgba(127, 29, 29, 0.22);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.22);
}

html.mt-theme-dark .mt-scheduler-loading .mt-spinner {
    border-color: rgba(255, 255, 255, 0.12);
    border-top-color: var(--mt-primary-strong);
}

@media (max-width: 860px) {
    .mt-scheduler-results-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .mt-scheduler-form-grid {
        grid-template-columns: 1fr;
    }

    .mt-scheduler-tools-dialog {
        width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
    }

    .mt-scheduler-tools-head,
    .mt-scheduler-tools-body {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .mt-scheduler-form-actions,
    .mt-scheduler-card-actions {
        justify-content: stretch;
    }

    .mt-scheduler-card-actions .mt-button-primary,
    .mt-scheduler-card-actions .mt-button-secondary,
    .mt-scheduler-form-actions .mt-button-primary {
        width: 100%;
    }
}

/* === Dark mode status palette refinement === */

html.mt-theme-dark .mt-my-day-card,
html.mt-theme-dark .mt-my-day-overdue-card {
    background: linear-gradient(180deg, #252a30 0%, #1d2228 100%);
    border-color: rgba(166, 175, 184, 0.10);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

html.mt-theme-dark .mt-my-day-card.mt-status-booked {
    background: linear-gradient(180deg, #252b31 0%, #1d2329 100%);
    border-left-color: #7da1b7;
}

html.mt-theme-dark .mt-my-day-card.mt-status-ongoing,
html.mt-theme-dark .mt-my-day-overdue-card.mt-status-ongoing {
    background: linear-gradient(180deg, #243039 0%, #1b242b 100%);
    border-left-color: #7daab5;
}

html.mt-theme-dark .mt-my-day-card.mt-status-done,
html.mt-theme-dark .mt-my-day-overdue-card.mt-status-done {
    background: linear-gradient(180deg, #302c24 0%, #231f18 100%);
    border-left-color: #c4a56c;
}

html.mt-theme-dark .mt-my-day-card.mt-status-invoiced {
    background: linear-gradient(180deg, #2e2924 0%, #211d19 100%);
    border-left-color: #c38a63;
}

html.mt-theme-dark .mt-status-chip-booked {
    background: rgba(125, 161, 183, 0.16);
    color: #dbe6ed;
    border-color: rgba(125, 161, 183, 0.26);
}

html.mt-theme-dark .mt-status-chip-ongoing {
    background: rgba(125, 170, 181, 0.16);
    color: #dde8ec;
    border-color: rgba(125, 170, 181, 0.26);
}

html.mt-theme-dark .mt-status-chip-done {
    background: rgba(196, 165, 108, 0.16);
    color: #f0e2c4;
    border-color: rgba(196, 165, 108, 0.26);
}

html.mt-theme-dark .mt-status-chip-invoiced {
    background: rgba(195, 138, 99, 0.16);
    color: #f1ddd0;
    border-color: rgba(195, 138, 99, 0.26);
}

html.mt-theme-dark .mt-status-summary-ongoing {
    background: linear-gradient(180deg, #29323a 0%, #202830 100%);
    color: #dbe7eb;
    border-color: rgba(125, 170, 181, 0.22);
}

html.mt-theme-dark .mt-status-summary-overdue {
    background: linear-gradient(180deg, #332a2c 0%, #251d1f 100%);
    color: #f0d8dc;
    border-color: rgba(205, 141, 141, 0.20);
}

html.mt-theme-dark .mt-row-ongoing {
    background: rgba(36, 48, 57, 0.32);
}

html.mt-theme-dark .mt-row-done-not-invoiced {
    background: rgba(48, 44, 36, 0.32);
}

html.mt-theme-dark .mt-admin-section,
html.mt-theme-dark .mt-admin-search-form,
html.mt-theme-dark .mt-admin-availability-filter,
html.mt-theme-dark .mt-admin-mass-unav {
    background: linear-gradient(180deg, #252a30 0%, #1d2228 100%);
    border-color: rgba(166, 175, 184, 0.10);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

html.mt-theme-dark .mt-admin-table thead {
    background: linear-gradient(180deg, #2a3036 0%, #20252b 100%);
}

html.mt-theme-dark .mt-admin-table tbody tr.mt-row-ongoing > td,
html.mt-theme-dark .mt-admin-table tbody tr.mt-row-ongoing > th {
    background: rgba(36, 48, 57, 0.32);
}

html.mt-theme-dark .mt-admin-table tbody tr.mt-row-done-not-invoiced > td,
html.mt-theme-dark .mt-admin-table tbody tr.mt-row-done-not-invoiced > th {
    background: rgba(48, 44, 36, 0.32);
}

html.mt-theme-dark .mt-admin-table tbody tr.mt-row-ongoing > td:first-child,
html.mt-theme-dark .mt-admin-table tbody tr.mt-row-ongoing > th:first-child {
    box-shadow: inset 3px 0 0 #7daab5;
}

html.mt-theme-dark .mt-admin-table tbody tr.mt-row-done-not-invoiced > td:first-child,
html.mt-theme-dark .mt-admin-table tbody tr.mt-row-done-not-invoiced > th:first-child {
    box-shadow: inset 3px 0 0 #c4a56c;
}

html.mt-theme-dark .mt-dashboard-shell,
html.mt-theme-dark .mt-booking-wrapper,
html.mt-theme-dark .mt-my-day-wrapper,
html.mt-theme-dark .mt-admin-overview-wrapper,
html.mt-theme-dark .mt-login-wrapper {
    border: 0 !important;
    box-shadow: none !important;
}

html.mt-theme-dark .mt-dashboard-shell {
    background: linear-gradient(180deg, #24292f 0%, #1b2026 100%);
}

html.mt-theme-dark .mt-calendar-table-wrapper {
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
    background: transparent;
}

html.mt-theme-dark .mt-status-summary-pill {
    background: linear-gradient(180deg, #252a30 0%, #1d2228 100%);
    border: 1px solid rgba(166, 175, 184, 0.10);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

html.mt-theme-dark .mt-status-summary-label {
    color: #aeb7bf;
}

html.mt-theme-dark .mt-status-summary-value {
    color: #f3f6f8;
}

html.mt-theme-dark .mt-status-summary-pill.mt-status-summary-total {
    background: linear-gradient(180deg, #252a30 0%, #1d2228 100%);
    border-color: rgba(166, 175, 184, 0.10);
}

html.mt-theme-dark .mt-status-summary-pill.mt-status-summary-booked {
    background: linear-gradient(180deg, #28303a 0%, #1e252d 100%);
    border-color: rgba(125, 161, 183, 0.18);
}

html.mt-theme-dark .mt-status-summary-pill.mt-status-summary-ongoing {
    background: linear-gradient(180deg, #29323a 0%, #202830 100%);
    border-color: rgba(125, 170, 181, 0.22);
    color: #dbe7eb;
}

html.mt-theme-dark .mt-status-summary-pill.mt-status-summary-done {
    background: linear-gradient(180deg, #2c312d 0%, #222722 100%);
    border-color: rgba(125, 159, 131, 0.18);
}

html.mt-theme-dark .mt-status-summary-pill.mt-status-summary-invoiced {
    background: linear-gradient(180deg, #2b2d30 0%, #212429 100%);
    border-color: rgba(158, 168, 178, 0.16);
}

html.mt-theme-dark .mt-status-summary-pill.mt-status-summary-overdue {
    background: linear-gradient(180deg, #34282b 0%, #261d20 100%);
    border-color: rgba(205, 141, 141, 0.20);
    color: #f0d8dc;
}

/* === Dark mode sync: WordPress header/adminbar === */

html.mt-theme-dark #wpadminbar {
    background: linear-gradient(180deg, #21262c 0%, #171b20 100%) !important;
    color: var(--mt-text) !important;
    border-bottom: 1px solid rgba(166, 175, 184, 0.12);
}

html.mt-theme-dark #wpadminbar .ab-item,
html.mt-theme-dark #wpadminbar a.ab-item,
html.mt-theme-dark #wpadminbar > #wp-toolbar span.ab-label,
html.mt-theme-dark #wpadminbar > #wp-toolbar span.noticon,
html.mt-theme-dark #wpadminbar .quicklinks .menupop ul li a,
html.mt-theme-dark #wpadminbar .quicklinks .menupop.hover ul li a,
html.mt-theme-dark #wpadminbar .ab-icon::before {
    color: #edf1f4 !important;
}

html.mt-theme-dark #wpadminbar .ab-top-menu > li:hover > .ab-item,
html.mt-theme-dark #wpadminbar .ab-top-menu > li.hover > .ab-item,
html.mt-theme-dark #wpadminbar .ab-top-menu > li > .ab-item:focus,
html.mt-theme-dark #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
html.mt-theme-dark #wpadminbar .menupop .ab-sub-wrapper,
html.mt-theme-dark #wpadminbar .shortlink-input {
    background: #1b2025 !important;
    color: var(--mt-text) !important;
}

html.mt-theme-dark #wpadminbar .quicklinks .menupop ul li:hover,
html.mt-theme-dark #wpadminbar .quicklinks .menupop ul li a:hover,
html.mt-theme-dark #wpadminbar .quicklinks .menupop ul li a:focus {
    background: #2a3138 !important;
    color: #ffffff !important;
}

html.mt-theme-dark header#header,
html.mt-theme-dark .site-header,
html.mt-theme-dark #masthead,
html.mt-theme-dark .header-wrapper,
html.mt-theme-dark .header-main,
html.mt-theme-dark .main-header-bar,
html.mt-theme-dark .site-header-main,
html.mt-theme-dark .header-top,
html.mt-theme-dark .header-bottom,
html.mt-theme-dark #top-bar,
html.mt-theme-dark .top-bar,
html.mt-theme-dark .wp-site-blocks > header,
html.mt-theme-dark header.wp-block-template-part {
    background: linear-gradient(180deg, #252a30 0%, #1c2026 100%) !important;
    color: var(--mt-text) !important;
    border-color: rgba(166, 175, 184, 0.10) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.20);
}

html.mt-theme-dark header#header a,
html.mt-theme-dark .site-header a,
html.mt-theme-dark #masthead a,
html.mt-theme-dark .header-wrapper a,
html.mt-theme-dark .header-main a,
html.mt-theme-dark .main-header-bar a,
html.mt-theme-dark .site-header-main a,
html.mt-theme-dark .top-bar a,
html.mt-theme-dark #top-bar a,
html.mt-theme-dark .wp-site-blocks > header a,
html.mt-theme-dark header.wp-block-template-part a,
html.mt-theme-dark .wp-block-navigation-item__content,
html.mt-theme-dark .menu-item > a,
html.mt-theme-dark .site-title a,
html.mt-theme-dark .site-description {
    color: var(--mt-text) !important;
}

html.mt-theme-dark header#header a:hover,
html.mt-theme-dark .site-header a:hover,
html.mt-theme-dark #masthead a:hover,
html.mt-theme-dark .header-wrapper a:hover,
html.mt-theme-dark .header-main a:hover,
html.mt-theme-dark .main-header-bar a:hover,
html.mt-theme-dark .site-header-main a:hover,
html.mt-theme-dark .top-bar a:hover,
html.mt-theme-dark #top-bar a:hover,
html.mt-theme-dark .wp-site-blocks > header a:hover,
html.mt-theme-dark header.wp-block-template-part a:hover,
html.mt-theme-dark .wp-block-navigation-item__content:hover,
html.mt-theme-dark .menu-item > a:hover {
    color: #ffffff !important;
}

html.mt-theme-dark header#header svg,
html.mt-theme-dark .site-header svg,
html.mt-theme-dark #masthead svg,
html.mt-theme-dark .header-wrapper svg,
html.mt-theme-dark .header-main svg,
html.mt-theme-dark .main-header-bar svg,
html.mt-theme-dark .site-header-main svg,
html.mt-theme-dark .wp-site-blocks > header svg,
html.mt-theme-dark header.wp-block-template-part svg {
    fill: currentColor;
    color: var(--mt-text);
}

html.mt-theme-dark header#header input,
html.mt-theme-dark .site-header input,
html.mt-theme-dark #masthead input,
html.mt-theme-dark .header-wrapper input,
html.mt-theme-dark .header-main input,
html.mt-theme-dark .site-header button,
html.mt-theme-dark #masthead button,
html.mt-theme-dark .header-wrapper button,
html.mt-theme-dark .header-main button,
html.mt-theme-dark .main-header-bar button,
html.mt-theme-dark .wp-site-blocks > header button {
    background: #171b20 !important;
    color: var(--mt-text) !important;
    border-color: var(--mt-border) !important;
}

/* === Late cleanup: dark shell, close icons, toolbar alignment === */

html.mt-theme-dark .mt-dashboard-main,
html.mt-theme-dark .mt-dashboard-side,
html.mt-theme-dark .mt-calendar-header,
html.mt-theme-dark .mt-calendar-toolbar,
html.mt-theme-dark .mt-calendar-nav,
html.mt-theme-dark .mt-calendar-title-row,
html.mt-theme-dark .mt-booking-wrapper-dashboard .mt-booking-calendar-col {
    border: 0 !important;
    box-shadow: none !important;
}

html.mt-theme-dark .mt-calendar-header,
html.mt-theme-dark .mt-calendar-toolbar,
html.mt-theme-dark .mt-calendar-title-row,
html.mt-theme-dark .mt-calendar-nav {
    background: transparent !important;
}

.mt-modal-close,
.mt-modal-close-floating,
.mt-lightbox-close,
.mt-update-alert-close-x,
.mt-quick-move-confirm-close,
.mt-scheduler-tools-close {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.mt-modal-close:hover,
.mt-modal-close:focus,
.mt-modal-close-floating:hover,
.mt-modal-close-floating:focus,
.mt-lightbox-close:hover,
.mt-lightbox-close:focus,
.mt-update-alert-close-x:hover,
.mt-update-alert-close-x:focus,
.mt-quick-move-confirm-close:hover,
.mt-quick-move-confirm-close:focus,
.mt-scheduler-tools-close:hover,
.mt-scheduler-tools-close:focus {
    background: transparent !important;
    box-shadow: none !important;
}

.mt-booking-wrapper-dashboard .mt-calendar-search-actionwrap {
    align-self: end;
}

.mt-booking-wrapper-dashboard .mt-calendar-search-submit {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0 !important;
    height: var(--mt-toolbar-control-height) !important;
    min-height: var(--mt-toolbar-control-height) !important;
    line-height: 1 !important;
    padding: 0 0.92rem !important;
    margin: 0 !important;
}

.mt-booking-wrapper-dashboard .mt-calendar-search-actionwrap,
.mt-dashboard-mobile .mt-booking-wrapper-dashboard .mt-calendar-search-actionwrap {
    display: none !important;
}

.mt-booking-wrapper-dashboard .mt-calendar-search-submit,
.mt-dashboard-mobile .mt-booking-wrapper-dashboard .mt-calendar-search-submit {
    display: none !important;
}

/* === Plugin page dark mode frame cleanup === */

html.mt-plugin-page.mt-theme-dark,
body.mt-plugin-page.mt-theme-dark {
    background: var(--mt-bg) !important;
}

body.mt-plugin-page.mt-theme-dark #page,
body.mt-plugin-page.mt-theme-dark .site,
body.mt-plugin-page.mt-theme-dark .site-content,
body.mt-plugin-page.mt-theme-dark .content-area,
body.mt-plugin-page.mt-theme-dark .entry-content,
body.mt-plugin-page.mt-theme-dark .inside-article,
body.mt-plugin-page.mt-theme-dark .wp-block-post-content,
body.mt-plugin-page.mt-theme-dark .ast-container,
body.mt-plugin-page.mt-theme-dark .ast-plain-container {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body.mt-plugin-page.mt-theme-dark header#header,
body.mt-plugin-page.mt-theme-dark .site-header,
body.mt-plugin-page.mt-theme-dark #masthead,
body.mt-plugin-page.mt-theme-dark .header-wrapper,
body.mt-plugin-page.mt-theme-dark .header-main,
body.mt-plugin-page.mt-theme-dark .main-header-bar,
body.mt-plugin-page.mt-theme-dark .site-header-main,
body.mt-plugin-page.mt-theme-dark .header-top,
body.mt-plugin-page.mt-theme-dark .header-bottom,
body.mt-plugin-page.mt-theme-dark #top-bar,
body.mt-plugin-page.mt-theme-dark .top-bar,
body.mt-plugin-page.mt-theme-dark .wp-site-blocks > header,
body.mt-plugin-page.mt-theme-dark header.wp-block-template-part {
    border: 0 !important;
    box-shadow: none !important;
}

html.mt-theme-dark .mt-booking-wrapper-dashboard,
html.mt-theme-dark .mt-booking-wrapper-dashboard .mt-booking-grid,
html.mt-theme-dark .mt-booking-wrapper-dashboard .mt-booking-calendar-col {
    border: 0 !important;
    box-shadow: none !important;
}

/* === Matte pass: less chrome on montor/admin views === */

body.mt-plugin-page .mt-calendar-nav,
body.mt-plugin-page .mt-my-day-header,
body.mt-plugin-page .mt-admin-search-form,
body.mt-plugin-page .mt-admin-availability-filter,
body.mt-plugin-page .mt-admin-section,
body.mt-plugin-page .mt-admin-mass-unav,
body.mt-plugin-page .mt-dashboard-card,
body.mt-plugin-page .mt-status-summary-pill,
body.mt-plugin-page .mt-my-day-card,
body.mt-plugin-page .mt-my-day-overdue-card,
body.mt-plugin-page .mt-live-search-results,
body.mt-plugin-page .mt-calendar-history-toggle {
    background-image: none !important;
    box-shadow: none !important;
}

body.mt-plugin-page .mt-calendar-nav,
body.mt-plugin-page .mt-my-day-header,
body.mt-plugin-page .mt-admin-search-form,
body.mt-plugin-page .mt-admin-availability-filter,
body.mt-plugin-page .mt-admin-section,
body.mt-plugin-page .mt-admin-mass-unav,
body.mt-plugin-page .mt-dashboard-card,
body.mt-plugin-page .mt-live-search-results {
    border-radius: 8px;
}

body.mt-plugin-page .mt-status-summary-pill {
    min-width: 88px;
    padding: 0.38rem 0.68rem;
    border-radius: 10px;
    border: 1px solid var(--mt-border);
}

body.mt-plugin-page .mt-calendar-history-toggle,
body.mt-plugin-page .mt-calendar-filter-form select,
body.mt-plugin-page .mt-calendar-search-form input[type="text"],
body.mt-plugin-page .mt-my-day-filters input[type="date"],
body.mt-plugin-page .mt-my-day-filters select,
body.mt-plugin-page .mt-admin-search-form input[type="text"],
body.mt-plugin-page .mt-admin-availability-filter select,
body.mt-plugin-page .mt-admin-status-quickchange {
    border-radius: 8px;
    box-shadow: none !important;
}

body.mt-plugin-page .mt-dashboard-link:hover,
body.mt-plugin-page .mt-dashboard-link.is-active {
    transform: none;
}

body.mt-plugin-page.mt-theme-dark {
    --mt-matte-base: #161b20;
    --mt-matte-surface: #1c2228;
    --mt-matte-surface-2: #20272e;
    --mt-matte-border: rgba(166, 175, 184, 0.10);
    --mt-matte-border-strong: rgba(166, 175, 184, 0.16);
}

body.mt-plugin-page.mt-theme-dark .mt-dashboard-shell,
body.mt-plugin-page.mt-theme-dark .mt-dashboard-main {
    background: var(--mt-matte-base) !important;
}

body.mt-plugin-page.mt-theme-dark .mt-dashboard-nav,
body.mt-plugin-page.mt-theme-dark .mt-dashboard-side {
    background: #171c22 !important;
}

body.mt-plugin-page.mt-theme-dark .mt-dashboard-side {
    border-left: 1px solid rgba(166, 175, 184, 0.08) !important;
}

body.mt-plugin-page.mt-theme-dark .mt-dashboard-card,
body.mt-plugin-page.mt-theme-dark .mt-calendar-nav,
body.mt-plugin-page.mt-theme-dark .mt-my-day-header,
body.mt-plugin-page.mt-theme-dark .mt-admin-search-form,
body.mt-plugin-page.mt-theme-dark .mt-admin-availability-filter,
body.mt-plugin-page.mt-theme-dark .mt-admin-section,
body.mt-plugin-page.mt-theme-dark .mt-admin-mass-unav,
body.mt-plugin-page.mt-theme-dark .mt-live-search-results,
body.mt-plugin-page.mt-theme-dark .mt-calendar-history-toggle {
    background: var(--mt-matte-surface) !important;
    border-color: var(--mt-matte-border) !important;
}

body.mt-plugin-page.mt-theme-dark .mt-status-summary-pill {
    background: var(--mt-matte-surface-2) !important;
    border-color: var(--mt-matte-border) !important;
    box-shadow: none !important;
}

body.mt-plugin-page.mt-theme-dark .mt-status-summary-pill.mt-status-summary-total {
    background: var(--mt-matte-surface-2) !important;
    border-color: var(--mt-matte-border) !important;
}

body.mt-plugin-page.mt-theme-dark .mt-status-summary-pill.mt-status-summary-booked {
    background: rgba(125, 161, 183, 0.10) !important;
    border-color: rgba(125, 161, 183, 0.20) !important;
}

body.mt-plugin-page.mt-theme-dark .mt-status-summary-pill.mt-status-summary-ongoing {
    background: rgba(125, 170, 181, 0.11) !important;
    border-color: rgba(125, 170, 181, 0.22) !important;
}

body.mt-plugin-page.mt-theme-dark .mt-status-summary-pill.mt-status-summary-done {
    background: rgba(152, 168, 109, 0.10) !important;
    border-color: rgba(152, 168, 109, 0.18) !important;
}

body.mt-plugin-page.mt-theme-dark .mt-status-summary-pill.mt-status-summary-invoiced {
    background: rgba(158, 168, 178, 0.08) !important;
    border-color: rgba(158, 168, 178, 0.16) !important;
}

body.mt-plugin-page.mt-theme-dark .mt-status-summary-pill.mt-status-summary-overdue {
    background: rgba(205, 141, 141, 0.10) !important;
    border-color: rgba(205, 141, 141, 0.20) !important;
}

body.mt-plugin-page.mt-theme-dark .mt-my-day-card,
body.mt-plugin-page.mt-theme-dark .mt-my-day-overdue-card {
    background: var(--mt-matte-surface) !important;
    border-color: var(--mt-matte-border) !important;
}

body.mt-plugin-page.mt-theme-dark .mt-my-day-card.mt-status-booked {
    background: var(--mt-matte-surface) !important;
    border-left-color: #7da1b7 !important;
}

body.mt-plugin-page.mt-theme-dark .mt-my-day-card.mt-status-ongoing,
body.mt-plugin-page.mt-theme-dark .mt-my-day-overdue-card.mt-status-ongoing {
    background: var(--mt-matte-surface) !important;
    border-left-color: #7daab5 !important;
}

body.mt-plugin-page.mt-theme-dark .mt-my-day-card.mt-status-done,
body.mt-plugin-page.mt-theme-dark .mt-my-day-overdue-card.mt-status-done {
    background: var(--mt-matte-surface) !important;
    border-left-color: #c4a56c !important;
}

body.mt-plugin-page.mt-theme-dark .mt-my-day-card.mt-status-invoiced {
    background: var(--mt-matte-surface) !important;
    border-left-color: #c38a63 !important;
}

body.mt-plugin-page.mt-theme-dark .mt-admin-table thead {
    background: var(--mt-matte-surface-2) !important;
}

body.mt-plugin-page.mt-theme-dark .mt-calendar-filter-form select,
body.mt-plugin-page.mt-theme-dark .mt-calendar-search-form input[type="text"],
body.mt-plugin-page.mt-theme-dark .mt-my-day-filters input[type="date"],
body.mt-plugin-page.mt-theme-dark .mt-my-day-filters select,
body.mt-plugin-page.mt-theme-dark .mt-admin-search-form input[type="text"],
body.mt-plugin-page.mt-theme-dark .mt-admin-availability-filter select,
body.mt-plugin-page.mt-theme-dark .mt-admin-status-quickchange {
    background: #151a1f !important;
    border-color: var(--mt-matte-border-strong) !important;
}

body.mt-plugin-page.mt-theme-dark .mt-dashboard-link {
    color: #c7d0d7;
    border: 1px solid transparent;
}

body.mt-plugin-page.mt-theme-dark .mt-dashboard-link:hover,
body.mt-plugin-page.mt-theme-dark .mt-dashboard-link.is-active {
    background: rgba(137, 167, 182, 0.10) !important;
    border-color: rgba(137, 167, 182, 0.14) !important;
    color: #f3f6f8;
}

body.mt-plugin-page.mt-theme-dark .mt-dashboard-nav-user {
    border-top-color: rgba(166, 175, 184, 0.10) !important;
}

/* === Remove top-level dark mode frame on content headers === */

body.mt-plugin-page.mt-theme-dark .mt-my-day-header,
body.mt-plugin-page.mt-theme-dark .mt-admin-search-form,
body.mt-plugin-page.mt-theme-dark .mt-admin-availability-filter {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* === Make dark mode main canvas solid === */

html.mt-plugin-page.mt-theme-dark,
body.mt-plugin-page.mt-theme-dark,
body.mt-plugin-page.mt-theme-dark #page,
body.mt-plugin-page.mt-theme-dark .site,
body.mt-plugin-page.mt-theme-dark .site-content,
body.mt-plugin-page.mt-theme-dark .content-area,
body.mt-plugin-page.mt-theme-dark .entry-content,
body.mt-plugin-page.mt-theme-dark .inside-article,
body.mt-plugin-page.mt-theme-dark .wp-block-post-content,
body.mt-plugin-page.mt-theme-dark .ast-container,
body.mt-plugin-page.mt-theme-dark .ast-plain-container,
body.mt-plugin-page.mt-theme-dark .mt-dashboard-shell,
body.mt-plugin-page.mt-theme-dark .mt-dashboard-main,
body.mt-plugin-page.mt-theme-dark .mt-booking-wrapper-dashboard,
body.mt-plugin-page.mt-theme-dark .mt-booking-wrapper-dashboard .mt-booking-calendar-col {
    background: #272C32 !important;
}

/* === Flatten dark mode dashboard corners === */

body.mt-plugin-page.mt-theme-dark .mt-dashboard-shell,
body.mt-plugin-page.mt-theme-dark .mt-dashboard-shell.mt-dashboard-mobile,
body.mt-plugin-page.mt-theme-dark .mt-dashboard-shell.mt-dashboard-mobile.mt-dashboard-no-sidebar,
body.mt-plugin-page.mt-theme-dark .mt-dashboard-nav,
body.mt-plugin-page.mt-theme-dark .mt-dashboard-main {
    border-radius: 0 !important;
}

body.mt-plugin-page.mt-theme-dark .mt-dashboard-shell {
    overflow: visible !important;
}

body.mt-plugin-page.mt-theme-dark .mt-dashboard-nav {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* === Normalize dropdown text rendering without replacing native arrow === */

.mt-booking-wrapper select:not([multiple]):not([size]):not([disabled]),
.mt-my-day-wrapper select:not([multiple]):not([size]):not([disabled]),
.mt-admin-overview-wrapper select:not([multiple]):not([size]):not([disabled]),
.mt-login-wrapper select:not([multiple]):not([size]):not([disabled]),
.mt-modal select:not([multiple]):not([size]):not([disabled]),
.mt-admin-status-quickchange:not([multiple]):not([size]):not([disabled]) {
    appearance: auto;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    line-height: 1.25;
    text-indent: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
    font-weight: 500;
    letter-spacing: normal;
    background-image: none !important;
    color-scheme: light;
}

html.mt-theme-dark .mt-booking-wrapper select:not([multiple]):not([size]):not([disabled]),
html.mt-theme-dark .mt-my-day-wrapper select:not([multiple]):not([size]):not([disabled]),
html.mt-theme-dark .mt-admin-overview-wrapper select:not([multiple]):not([size]):not([disabled]),
html.mt-theme-dark .mt-login-wrapper select:not([multiple]):not([size]):not([disabled]),
html.mt-theme-dark .mt-modal select:not([multiple]):not([size]):not([disabled]),
html.mt-theme-dark .mt-admin-status-quickchange:not([multiple]):not([size]):not([disabled]) {
    color-scheme: dark;
}

.mt-booking-wrapper select option,
.mt-booking-wrapper select optgroup,
.mt-my-day-wrapper select option,
.mt-my-day-wrapper select optgroup,
.mt-admin-overview-wrapper select option,
.mt-admin-overview-wrapper select optgroup,
.mt-login-wrapper select option,
.mt-login-wrapper select optgroup,
.mt-modal select option,
.mt-modal select optgroup,
.mt-admin-status-quickchange option,
.mt-admin-status-quickchange optgroup {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
}

@media (min-width: 769px) {
    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools {
        display: grid !important;
        grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) !important;
        align-items: end !important;
        gap: 0.5rem 0.72rem !important;
        width: 100% !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools > .mt-calendar-tools-slot {
        min-width: 0 !important;
        width: 100% !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools > .mt-calendar-tools-slot-filter {
        grid-column: 1;
        max-width: 220px !important;
        justify-self: start !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools > .mt-calendar-tools-slot-filter .mt-calendar-filter-form {
        width: 100% !important;
        max-width: 220px !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools > .mt-calendar-tools-slot-search {
        grid-column: 2;
        justify-self: stretch !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools > .mt-calendar-tools-slot-search .mt-calendar-search-form {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 128px !important;
        align-items: end !important;
        gap: 0.42rem !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-search-label {
        width: 100% !important;
        min-width: 0 !important;
        justify-self: stretch !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-search-inputwrap,
    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-search-form input[type="text"] {
        width: 100% !important;
        min-width: 0 !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-history-field {
        width: 128px !important;
        min-width: 128px !important;
    }
}

@media (min-width: 769px) {
    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-toolbar,
    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools,
    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools > .mt-calendar-tools-slot,
    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools > .mt-calendar-tools-slot-search,
    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools > .mt-calendar-tools-slot-search .mt-calendar-search-form {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: end !important;
        justify-content: flex-start !important;
        gap: 0.72rem !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools > .mt-calendar-tools-slot-filter {
        flex: 0 0 220px !important;
        width: 220px !important;
        max-width: 220px !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools > .mt-calendar-tools-slot-search {
        display: block !important;
        flex: 1 1 0 !important;
        justify-self: stretch !important;
        align-self: stretch !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-tools > .mt-calendar-tools-slot-search .mt-calendar-search-form {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: end !important;
        justify-content: flex-start !important;
        gap: 0.42rem !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-search-label {
        display: flex !important;
        flex: 1 1 0 !important;
        flex-direction: column !important;
        align-self: stretch !important;
        justify-self: stretch !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-search-inputwrap {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: 1 1 auto !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-search-form input[type="text"] {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: 1 1 auto !important;
    }

    body.mt-plugin-page .mt-booking-wrapper-dashboard .mt-calendar-history-field {
        display: flex !important;
        flex: 0 0 128px !important;
        width: 128px !important;
        min-width: 128px !important;
        max-width: 128px !important;
        flex-direction: column !important;
    }
}
