h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred." }
.darker-border-checkbox.form-check-input { border-color: #929292; }

/* ─── Teal accent theme ─── */
:root {
    --accent:        #1D9E75;
    --accent-hover:  #0F6E56;
    --accent-subtle: #E1F5EE;
    --accent-dark:   #085041;
    --bs-body-bg:    #f7f7f5;
}

/* Primary button → teal */
.btn-accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 13px;
}
.btn-accent:hover, .btn-accent:focus {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

/* Sidebar nav active state */
.nav-active {
    color: var(--accent) !important;
    background-color: var(--accent-subtle) !important;
    font-weight: 500 !important;
}

/* Badge */
.badge-teal {
    background-color: var(--accent-subtle);
    color: var(--accent-dark);
    font-weight: 500;
}

/* Tabs */
.crm-tabs {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 20px;
    gap: 0;
}
.crm-tab {
    padding: 9px 18px;
    font-size: 14px;
    color: #6c757d;
    cursor: pointer;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.crm-tab:hover:not(.active) { color: #343a40; }
.crm-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 500;
}

/* Avatar */
.crm-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background-color: var(--accent-subtle);
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

/* Card */
.crm-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #f0eeeb;
    padding: 14px 16px;
}
.crm-card-hover {
    cursor: pointer;
    transition: border-color 0.15s;
}
.crm-card-hover:hover { border-color: #d0d0d0; }

/* Hint bar */
.crm-hint {
    background: var(--accent-subtle);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--accent-dark);
    margin-bottom: 14px;
}

/* Price input (compact) */
.price-input-sm {
    width: 84px;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    text-align: right;
    background: #fafafa;
}
.price-input-sm:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
}
.price-input-sm:disabled { opacity: 0.4; background: #f5f5f5; }

/* Service check row */
.svc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f5f5f3;
}
.svc-row:last-child { border-bottom: none; }
.svc-row label {
    flex: 1;
    font-size: 14px;
    cursor: pointer;
    margin: 0;
}
.svc-row .base-price {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

/* ─── Schedule grid ─── */
.sched-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.sched-table th, .sched-table td {
    border-right: 1px solid #f0eeeb;
    text-align: center;
    padding: 8px 6px;
    vertical-align: middle;
    font-size: 13px;
}
.sched-table th:last-child, .sched-table td:last-child { border-right: none; }
.sched-table th {
    background: #fafaf8;
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
    padding: 10px 6px;
}
.sched-col-label { width: 76px; }
.sched-row-label {
    text-align: left !important;
    padding-left: 14px !important;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-right: 1px solid #dee2e6 !important;
    white-space: nowrap;
}
.sched-table td { border-top: 1px solid #f0eeeb; }

.sched-time-cell {
    cursor: pointer;
    transition: background .1s;
    vertical-align: middle;
}
.sched-time-cell:hover { background: #f5faf8; }
.sched-range { font-size: 12px; font-weight: 500; color: #374151; }

.sched-exc-cell { cursor: pointer; transition: background .1s; }
.sched-exc-cell:hover { background: #f5faf8; }
.sched-exc-cell:hover .sched-add-hint { color: var(--accent); }
.sched-add-hint {
    font-size: 13px;
    color: #d1d5db;
    transition: color .1s;
}

.sched-time {
    font-size: 11px;
    padding: 3px 2px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fafafa;
    width: 60px;
    text-align: center;
    color: #374151;
}
.sched-time:focus { outline: none; border-color: var(--accent); background: #fff; }
.sched-inh  { font-size: 11px; color: var(--accent); }
.sched-off  { color: #d1d5db; }

.sched-nav-row > td {
    padding: 0 !important;
    border-top: 2px solid #e9ecef !important;
    border-right: none !important;
}
.sched-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #fafaf8;
}
.sched-nav-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    color: #6c757d;
    font-size: 12px;
    line-height: 1.4;
}
.sched-nav-btn:hover { background: #f5f5f3; }
.sched-period-label { font-size: 13px; font-weight: 500; }
.sched-mode-toggle {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}
.sched-mode-btn {
    background: none;
    border: none;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    color: #6c757d;
    line-height: 1.4;
}
.sched-mode-btn.active { background: var(--accent); color: #fff; }

.sched-chip {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    line-height: 1.5;
    cursor: default;
}
.sched-chip-off     { background: #FAECE7; color: #993C1D; }
.sched-chip-custom  { background: #E1F5EE; color: #0F6E56; }
.sched-chip-vacation{ background: #E6F1FB; color: #185FA5; }
.sched-chip-sick    { background: #FAEEDA; color: #854F0B; }
.sched-chip-break   { background: #F1EFE8; color: #5F5E5A; }

.sched-date-num  { font-size: 13px; font-weight: 500; display: block; }
.sched-date-today {
    display: inline-flex;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}
.sched-other-month { background: #fafaf8; }
.sched-other-month .sched-date-num { color: #d1d5db; }
.sched-week-label {
    font-size: 10px !important;
    color: #9ca3af;
    text-align: left !important;
    padding-left: 14px !important;
}
.sched-footer-row > td {
    text-align: left !important;
    padding: 10px 14px !important;
    border-top: 1px solid #f0eeeb;
    border-right: none !important;
}
.sched-exc-note { font-size: 10px; color: #9ca3af; margin-top: 2px; display: block; }
.sched-del-btn {
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    padding: 0 2px;
    font-size: 10px;
    vertical-align: middle;
}
.sched-del-btn:hover { color: #ef4444; }

.sched-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sched-modal {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    width: 380px;
    max-width: 95vw;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
}
.sched-modal-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

.crm-company-card { transition: box-shadow .15s, transform .15s; }
.crm-company-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08) !important; transform: translateY(-1px); }

/* ─── Application navigation ─── */
.crm-admin-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
}
.crm-sidebar {
    width: 220px;
    min-width: 220px;
    height: 100vh;
    position: sticky;
    top: 0;
}
.crm-admin-content { min-width: 0; }
.crm-admin-mobile-nav { display: none; }

.crm-public-header {
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.crm-public-nav-link,
.crm-employee-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6c757d;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
}
.crm-public-nav-link:hover,
.crm-employee-nav-link:hover { color: var(--accent-dark); background: var(--accent-subtle); }
.crm-public-nav-link.active,
.crm-employee-nav-link.active { color: var(--accent-dark); background: var(--accent-subtle); font-weight: 500; }

.crm-employee-chip-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.crm-employee-chip-strip::-webkit-scrollbar {
    height: 6px;
}

.crm-employee-chip-strip::-webkit-scrollbar-thumb {
    background: #d3d1c7;
    border-radius: 999px;
}

.crm-calendar-event > .tooltip-container {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

/* ─── Client account ─── */
.crm-account-page {
    width: min(100% - 32px, 1040px);
    margin: 0 auto;
    padding: 42px 0 72px;
}

.crm-account-loading {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #777670;
    font-size: 14px;
}

.crm-account-auth-card {
    width: min(100%, 520px);
    margin: 72px auto;
    padding: 48px 36px;
    text-align: center;
    background: #fff;
    border: 1px solid #ebe9e4;
    border-radius: 24px;
    box-shadow: 0 18px 55px rgba(31, 35, 33, .07);
}
.crm-account-auth-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: var(--accent-subtle);
    color: var(--accent-dark);
    font-size: 34px;
}
.crm-account-auth-card h1 { font-size: 26px; margin-bottom: 10px; }
.crm-account-auth-card p { color: #777670; margin: 0 auto 24px; max-width: 390px; }

.crm-account-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 28px 32px;
    color: #fff;
    background: linear-gradient(125deg, #073d34 0%, #0f6e56 52%, #1d9e75 100%);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(8, 80, 65, .2);
}
.crm-account-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -85px;
    top: -150px;
    border: 42px solid rgba(255,255,255,.07);
    border-radius: 50%;
    pointer-events: none;
}
.crm-account-avatar {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 22px;
    background: rgba(255,255,255,.16);
    font-size: 23px;
    font-weight: 700;
    letter-spacing: .04em;
    backdrop-filter: blur(8px);
}
.crm-account-identity { min-width: 0; }
.crm-account-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: rgba(255,255,255,.68);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.crm-account-identity h1 {
    margin: 0 0 5px;
    color: #fff;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.crm-account-identity > span:last-child { color: rgba(255,255,255,.78); font-size: 13px; }
.crm-account-summary {
    z-index: 1;
    display: flex;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 16px;
    background: rgba(3, 43, 36, .2);
    backdrop-filter: blur(8px);
}
.crm-account-summary > div { min-width: 96px; padding: 12px 18px; text-align: center; }
.crm-account-summary > div + div { border-left: 1px solid rgba(255,255,255,.16); }
.crm-account-summary strong { display: block; color: #fff; font-size: 23px; line-height: 1.1; }
.crm-account-summary span { display: block; margin-top: 3px; color: rgba(255,255,255,.66); font-size: 11px; }

.crm-account-tabs {
    display: flex;
    gap: 8px;
    margin: 24px 0;
    padding: 5px;
    background: #eeece7;
    border-radius: 14px;
    width: fit-content;
}
.crm-account-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    color: #696863;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s, box-shadow .15s;
}
.crm-account-tab:hover { color: #212521; }
.crm-account-tab.active { color: var(--accent-dark); background: #fff; box-shadow: 0 2px 8px rgba(33,37,33,.08); }
.crm-account-tab-count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    color: #fff;
    background: var(--accent);
    border-radius: 10px;
    font-size: 10px;
}

.crm-account-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, .75fr); gap: 18px; }
.crm-account-panel {
    padding: 24px;
    background: #fff;
    border: 1px solid #ebe9e4;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(31,35,33,.035);
}
.crm-account-panel-heading,
.crm-account-orders-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}
.crm-account-panel-heading h2,
.crm-account-orders-heading h2 { margin: 0 0 4px; font-size: 18px; font-weight: 650; }
.crm-account-panel-heading p,
.crm-account-orders-heading p { margin: 0; color: #85847e; font-size: 12px; }
.crm-account-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    color: var(--accent-dark);
    background: var(--accent-subtle);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.crm-account-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.crm-account-field { padding: 14px 16px; background: #faf9f7; border: 1px solid #efede8; border-radius: 12px; }
.crm-account-field span { display: block; margin-bottom: 5px; color: #92918b; font-size: 11px; }
.crm-account-field strong { display: block; color: #292c29; font-size: 14px; font-weight: 600; }
.crm-account-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    color: #5e5c55;
    background: #f7f5ef;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.45;
}
.crm-account-hint i { margin-top: 1px; color: #8c7c4b; font-size: 15px; }
.crm-account-session-panel { display: flex; flex-direction: column; }
.crm-account-session { display: flex; align-items: center; gap: 12px; margin: 24px 0; }
.crm-account-session-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--accent-dark);
    background: var(--accent-subtle);
    border-radius: 12px;
    font-size: 20px;
}
.crm-account-session strong { display: block; font-size: 13px; }
.crm-account-session div span { display: block; margin-top: 3px; color: var(--accent); font-size: 10px; }
.crm-account-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: auto;
    color: #8c2f2f;
    background: #fff7f6;
    border: 1px solid #f1d4d0;
    border-radius: 10px;
    font-size: 12px;
}
.crm-account-logout:hover { color: #762222; background: #fcecea; border-color: #e8bcb6; }

.crm-account-orders {
    padding: 26px;
    background: #fff;
    border: 1px solid #ebe9e4;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(31,35,33,.035);
}
.crm-account-order-filters { display: flex; gap: 7px; margin: 22px 0 18px; overflow-x: auto; }
.crm-account-order-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    color: #696863;
    background: #f7f6f3;
    border: 1px solid #ebe9e4;
    border-radius: 99px;
    font-size: 12px;
    white-space: nowrap;
}
.crm-account-order-filter span { color: #999791; font-size: 10px; }
.crm-account-order-filter.active { color: #fff; background: #25332e; border-color: #25332e; }
.crm-account-order-filter.active span { color: rgba(255,255,255,.68); }
.crm-account-order-list { display: flex; flex-direction: column; gap: 12px; }
.crm-account-order-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #ebe9e4;
    border-radius: 16px;
    transition: border-color .15s, box-shadow .15s;
}
.crm-account-order-card:hover { border-color: #d8d5cf; box-shadow: 0 8px 24px rgba(31,35,33,.055); }
.crm-account-order-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 10px;
    background: #f5f3ee;
    border-right: 1px solid #ebe9e4;
}
.crm-account-order-date strong { color: #24332e; font-size: 27px; line-height: 1; }
.crm-account-order-date span { margin: 3px 0 9px; color: #777670; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.crm-account-order-date small { padding-top: 8px; color: var(--accent-dark); border-top: 1px solid #dcd9d2; font-size: 12px; font-weight: 700; }
.crm-account-order-body { padding: 17px 19px; min-width: 0; }
.crm-account-order-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.crm-account-order-label { display: block; margin-bottom: 3px; color: #9a9892; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.crm-account-order-topline h3 { margin: 0; font-size: 15px; font-weight: 650; }
.crm-account-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 650;
    white-space: nowrap;
}
.crm-account-status > span { width: 6px; height: 6px; border-radius: 50%; }
.crm-account-order-branch { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; margin-top: 7px; color: #6b6a65; font-size: 11px; }
.crm-account-order-branch i { color: var(--accent); font-size: 12px; }
.crm-account-order-branch span { font-weight: 600; color: #3a3c39; }
.crm-account-order-branch small { color: #9a9892; }
.crm-account-procedures { display: grid; gap: 6px; margin: 13px 0; padding: 11px 12px; background: #faf9f7; border-radius: 10px; }
.crm-account-procedures > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crm-account-procedures span { min-width: 0; overflow: hidden; color: #424540; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.crm-account-procedures span i { color: var(--accent); }
.crm-account-procedures small { color: #85847e; font-size: 10px; white-space: nowrap; }
.crm-account-order-footer { display: flex; align-items: center; gap: 14px; color: #85847e; font-size: 11px; }
.crm-account-order-footer strong { margin-left: auto; color: #292c29; font-size: 14px; }
.crm-account-cancel { padding: 4px 0 4px 11px; color: #a04a44; background: transparent; border: 0; border-left: 1px solid #e4e1dc; font-size: 10px; }
.crm-account-cancel:hover { color: #7e2923; }
.crm-account-empty { padding: 62px 20px; text-align: center; }
.crm-account-empty > span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 15px;
    color: #9a9892;
    background: #f1efea;
    border-radius: 18px;
    font-size: 26px;
}
.crm-account-empty h3 { margin-bottom: 6px; font-size: 17px; }
.crm-account-empty p { margin-bottom: 18px; color: #85847e; font-size: 12px; }

@media (max-width: 767.98px) {
    .crm-admin-shell {
        display: flex;
        flex-direction: column;
    }
    .crm-sidebar { display: none !important; }
    .crm-admin-mobile-nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 10px 14px 8px;
        position: sticky;
        top: 0;
        z-index: 1020;
    }
    .crm-mobile-nav-link {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 6px 10px;
        border-radius: 999px;
        color: #6c757d;
        text-decoration: none;
        white-space: nowrap;
        font-size: 12px;
    }
    .crm-admin-content { padding: 16px !important; }
    .crm-public-header { height: auto; min-height: 60px; padding: 8px 12px !important; }
    .crm-public-header > div { align-items: flex-start !important; }
    .crm-public-header nav { padding-bottom: 2px; }
    .crm-public-nav-link { padding: 7px 9px; }
    .crm-public-nav-link span { display: none; }
    .crm-employee-nav-link { padding: 6px 8px; }
    .crm-employee-nav-link span { display: none; }

    .crm-account-page { width: min(100% - 24px, 1040px); padding: 20px 0 46px; }
    .crm-account-hero { grid-template-columns: auto minmax(0, 1fr); padding: 22px 20px; border-radius: 18px; }
    .crm-account-avatar { width: 58px; height: 58px; border-radius: 17px; font-size: 19px; }
    .crm-account-summary { grid-column: 1 / -1; width: 100%; }
    .crm-account-summary > div { flex: 1; min-width: 0; padding: 10px; }
    .crm-account-tabs { width: 100%; }
    .crm-account-tab { flex: 1; justify-content: center; padding: 9px 10px; }
    .crm-account-grid { grid-template-columns: 1fr; }
    .crm-account-fields { grid-template-columns: 1fr; }
    .crm-account-panel,
    .crm-account-orders { padding: 18px; border-radius: 15px; }
    .crm-account-orders-heading { align-items: center; }
    .crm-account-orders-heading p { display: none; }
    .crm-account-orders-heading .btn { padding: 6px 12px; font-size: 11px; }
    .crm-account-order-card { grid-template-columns: 64px minmax(0, 1fr); }
    .crm-account-order-date { padding: 13px 7px; }
    .crm-account-order-date strong { font-size: 23px; }
    .crm-account-order-body { padding: 14px; }
    .crm-account-order-topline { flex-direction: column; gap: 8px; }
    .crm-account-procedures > div { align-items: flex-start; flex-direction: column; gap: 2px; }
    .crm-account-order-footer { flex-wrap: wrap; gap: 9px; }
    .crm-account-order-footer strong { margin-left: 0; }
    .crm-account-cancel { width: 100%; padding: 7px 0 0; border-left: 0; border-top: 1px solid #e4e1dc; text-align: left; }
}

/* ─── Role-based topbar layout ─── */
.crm-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid #f0eeeb;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 52px;
    flex-shrink: 0;
}
.crm-topbar-logo {
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: inherit;
}
.crm-mode-sw {
    display: flex;
    gap: 2px;
    background: #f4f4f2;
    border-radius: 8px;
    padding: 3px;
}
.crm-mode-btn {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
}
.crm-mode-btn.active {
    background: #fff;
    color: #111;
    font-weight: 500;
    border: 0.5px solid #ddd;
}
.crm-mode-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 999px;
}
.crm-mode-badge-owner  { background: #EEEDFE; color: #3C3489; border: 0.5px solid #AFA9EC; }
.crm-mode-badge-admin  { background: #E6F1FB; color: #0C447C; border: 0.5px solid #85B7EB; }
.crm-mode-badge-master { background: #E1F5EE; color: #085041; border: 0.5px solid #5DCAA5; }

.crm-body-v2 {
    display: flex;
    overflow: hidden;
    height: calc(100vh - 52px);
}
.crm-sidebar-v2 {
    width: 192px;
    min-width: 192px;
    background: #fff;
    border-right: 1px solid #f0eeeb;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.crm-content-v2 {
    flex: 1;
    min-width: 0;
    overflow: auto;
    padding: 24px;
    background: var(--bs-body-bg, #f7f7f5);
}
.crm-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    text-decoration: none;
    color: #6c757d;
}
.crm-nav-link:hover { background: #f7f7f5; color: #343a40; }
.crm-nav-link.active-nav { background: #E1F5EE; color: #085041; font-weight: 500; }
.crm-nav-section {
    font-size: 10px;
    font-weight: 500;
    color: #9ca3af;
    padding: 10px 16px 4px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.crm-mobile-topbar { display: none; }

/* ─── Master week schedule views ─── */
.crm-week-slot {
    border-radius: 5px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}
.crm-week-exp-wrap {
    border: 1px solid #f0eeeb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
}
.crm-week-time-col {
    width: 46px;
    flex-shrink: 0;
    border-right: 1px solid #f0eeeb;
    padding-top: 36px;
    background: #fafaf8;
}
.crm-week-time-lbl {
    height: 48px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 3px 8px 0 0;
    font-size: 10px;
    color: #9ca3af;
    font-weight: 500;
}
.crm-week-days-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.crm-week-day-hdr {
    height: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    border-bottom: 1px solid #f0eeeb;
    border-right: 1px solid #f0eeeb;
    background: #fafaf8;
    cursor: pointer;
}
.crm-week-day-hdr:last-child { border-right: none; }
.crm-week-hdr-name { font-size: 9px; font-weight: 500; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; }
.crm-week-hdr-num  { font-size: 14px; font-weight: 500; color: #212529; }
.crm-week-day-hdr.w-today .crm-week-hdr-name { color: #0F6E56; }
.crm-week-day-hdr.w-today .crm-week-hdr-num {
    width: 24px; height: 24px; border-radius: 50%;
    background: #1D9E75; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.crm-week-day-body {
    border-right: 1px solid #f0eeeb;
    position: relative;
}
.crm-week-day-body:last-child { border-right: none; }
.crm-week-hline { height: 48px; border-bottom: 1px solid #f0eeeb; }
.crm-week-hline:last-child { border-bottom: none; }
.crm-week-event {
    position: absolute;
    left: 2px; right: 2px;
    border-radius: 5px;
    padding: 3px 5px;
    font-size: 9px;
    overflow: hidden;
    cursor: default;
    border-left: 3px solid;
    line-height: 1.3;
}
.crm-week-event-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-now-line { position: absolute; left: 0; right: 0; height: 1.5px; background: #1D9E75; z-index: 3; }
.crm-now-dot { position: absolute; left: -3px; top: -3.5px; width: 7px; height: 7px; border-radius: 50%; background: #1D9E75; }

@media (max-width: 767.98px) {
    .crm-topbar    { display: none !important; }
    .crm-sidebar-v2 { display: none !important; }
    .crm-body-v2   { height: auto; overflow: visible; }
    .crm-content-v2 { padding: 14px !important; }
    .crm-mobile-topbar {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 10px 14px 8px;
        background: #fff;
        border-bottom: 1px solid #f0eeeb;
        position: sticky;
        top: 0;
        z-index: 100;
    }
}

/* Chat widget */
.chat-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(29, 158, 117, .28);
    transition: background .15s, box-shadow .15s, transform .15s;
}
.chat-fab i { font-size: 24px; }
.chat-fab:hover { background: var(--accent-hover); transform: translateY(-1px); }
.chat-fab.open { background: #343a40; box-shadow: 0 12px 28px rgba(33, 37, 41, .22); }

.chat-widget-panel {
    position: fixed;
    right: 24px;
    bottom: 92px;
    z-index: 1199;
    width: min(760px, calc(100vw - 48px));
    height: min(560px, calc(100vh - 128px));
    min-height: 420px;
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    background: #fff;
    border: 1px solid #e4e1da;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(33, 37, 41, .18);
}

.chat-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fbfaf8;
    border-right: 1px solid #ece8df;
}

.chat-sidebar-top,
.chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    padding: 12px 14px;
    border-bottom: 1px solid #ece8df;
    background: #fff;
}

.chat-heading {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.chat-heading strong,
.chat-head-info strong {
    color: #262a2f;
    font-size: 14px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-kicker,
.chat-head-info span {
    color: #8c8b86;
    font-size: 11px;
    line-height: 1.3;
}

.chat-icon-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e2db;
    border-radius: 50%;
    background: #fff;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.chat-icon-btn:hover { background: #f7f6f3; border-color: #d5d0c6; color: #343a40; }

.chat-space-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 10px 0;
    overflow-x: auto;
}
.chat-space-tab,
.chat-space-current {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    font-size: 12px;
}
.chat-space-tab {
    flex: 1;
    border: 1px solid transparent;
    background: transparent;
    color: #6c757d;
    padding: 8px 9px;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.chat-space-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-space-tab:hover { background: #fff; color: #343a40; }
.chat-space-tab.active {
    background: var(--accent-subtle);
    border-color: #bde9da;
    color: var(--accent-dark);
    font-weight: 600;
}
.chat-space-current {
    margin: 10px 10px 0;
    padding: 8px 10px;
    background: var(--accent-subtle);
    color: var(--accent-dark);
    font-weight: 600;
}

.chat-search {
    margin: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid #e5e2db;
    border-radius: 8px;
    background: #fff;
    color: #9a9892;
}
.chat-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 158, 117, .12); }
.chat-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #343a40;
    font-size: 13px;
}

.chat-conv-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 8px 10px;
}
.chat-conv-item {
    width: 100%;
    min-height: 58px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    padding: 8px;
    text-align: left;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.chat-conv-item:hover { background: #fff; border-color: #ece8df; }
.chat-conv-item.active { background: #fff; border-color: #bde9da; box-shadow: inset 3px 0 0 var(--accent); }
.chat-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: var(--accent-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}
.chat-conv-info,
.chat-head-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.chat-conv-name {
    color: #2f3439;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-conv-preview {
    margin-top: 2px;
    color: #8c8b86;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-conv-time {
    align-self: start;
    padding-top: 2px;
    color: #a8a59e;
    font-size: 10px;
    white-space: nowrap;
}

.chat-list-state,
.chat-message-state,
.chat-empty {
    color: #8c8b86;
    text-align: center;
}
.chat-list-state {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px;
    font-size: 12px;
}
.chat-list-state i,
.chat-message-state i { font-size: 20px; }
.chat-list-state.danger,
.chat-message-state.danger,
.chat-inline-error { color: #b42318; }

.chat-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.chat-head { min-height: 62px; }
.chat-head-info { flex: 1; }

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: #f6f4ef;
}
.chat-message-state,
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    font-size: 13px;
}
.chat-empty strong {
    color: #343a40;
    font-size: 15px;
}
.chat-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: var(--accent-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.chat-msg-row {
    display: flex;
    align-items: flex-end;
}
.chat-msg-row.employee { justify-content: flex-end; }
.chat-msg-row.client { justify-content: flex-start; }
.chat-msg {
    max-width: min(76%, 430px);
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.chat-msg.employee { align-items: flex-end; }
.chat-msg.client { align-items: flex-start; }
.chat-bubble {
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.chat-msg.client .chat-bubble {
    background: #fff;
    border: 1px solid #e7e2d8;
    border-bottom-left-radius: 4px;
    color: #2f3439;
}
.chat-msg.employee .chat-bubble {
    background: var(--accent);
    border: 1px solid var(--accent);
    border-bottom-right-radius: 4px;
    color: #fff;
}
.chat-msg-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #9a9892;
    font-size: 10px;
}
.chat-msg.employee .chat-msg-meta { color: #7b8f88; }

.chat-input-area {
    border-top: 1px solid #ece8df;
    background: #fff;
    padding: 10px 12px 12px;
}
.chat-inline-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
}
.chat-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: end;
    gap: 8px;
}
.chat-compose textarea {
    width: 100%;
    min-height: 42px;
    max-height: 110px;
    resize: none;
    border: 1px solid #e0ddd5;
    border-radius: 8px;
    padding: 10px 12px;
    color: #343a40;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.45;
}
.chat-compose textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(29, 158, 117, .12);
}
.chat-send-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
.chat-send-btn:hover:not(:disabled) { background: var(--accent-hover); }
.chat-send-btn:disabled { cursor: not-allowed; opacity: .48; }

.ti-loader-2 { animation: chat-spin .8s linear infinite; }
@keyframes chat-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
    .chat-widget-panel {
        left: 12px;
        right: 12px;
        bottom: 88px;
        width: auto;
        height: min(72vh, 560px);
        grid-template-columns: minmax(156px, 40%) minmax(0, 1fr);
    }
    .chat-sidebar-top,
    .chat-head { padding: 10px 12px; }
    .chat-space-tab { padding: 7px 8px; }
    .chat-messages { padding: 12px; }
    .chat-msg { max-width: 86%; }
}

@media (max-width: 540px) {
    .chat-fab {
        right: 18px;
        bottom: 18px;
        width: 52px;
        height: 52px;
    }
    .chat-widget-panel {
        top: 70px;
        bottom: 82px;
        grid-template-columns: 1fr;
        grid-template-rows: 214px minmax(0, 1fr);
        min-height: 0;
        height: auto;
    }
    .chat-sidebar {
        border-right: 0;
        border-bottom: 1px solid #ece8df;
    }
    .chat-conv-list { padding-bottom: 8px; }
    .chat-conv-item {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        min-height: 52px;
    }
    .chat-avatar {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }
}
