:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #132133;
  background: #f4f6f8;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
.site-header { min-height: 68px; padding: 0 6vw; display: flex; align-items: center; gap: 24px; background: #0d1b2a; color: white; }
.brand { color: white; text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.tenant-name { color: #b9c8d8; }
.site-header form { margin-left: auto; }
.link-button { border: 0; background: none; color: white; cursor: pointer; font: inherit; }
.hero, .dashboard-shell { max-width: 1100px; margin: 0 auto; padding: 12vh 6vw; }
.hero h1 { max-width: 820px; margin: 12px 0 20px; font-size: clamp(2.4rem, 6vw, 5.6rem); line-height: .98; letter-spacing: -.055em; }
.hero > p:not(.eyebrow) { max-width: 680px; font-size: 1.2rem; line-height: 1.65; color: #4b5d70; }
.eyebrow { color: #3578e5; font-size: .78rem; font-weight: 800; letter-spacing: .16em; }
.primary-button { display: inline-block; margin-top: 20px; padding: 14px 22px; border: 0; border-radius: 10px; background: #3578e5; color: white; text-decoration: none; font: inherit; font-weight: 700; cursor: pointer; }
.auth-card { width: min(440px, calc(100% - 32px)); margin: 9vh auto; padding: 34px; border-radius: 18px; background: white; box-shadow: 0 18px 60px rgba(13, 27, 42, .1); }
.auth-card h1 { margin-top: 8px; }
.auth-card form { display: grid; gap: 10px; }
.auth-card label { margin-top: 8px; font-size: .88rem; font-weight: 700; }
.auth-card input { width: 100%; padding: 13px 14px; border: 1px solid #cbd5df; border-radius: 9px; font: inherit; }
.form-error { padding: 12px; border-radius: 8px; background: #fff0f0; color: #a52020; }
.form-success { padding: 12px; border-radius: 8px; background: #e9f8f0; color: #176a42; }
.hero-actions { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.tenant-entry { max-width: 720px; margin-top: 46px; padding: 20px; border: 1px solid rgba(160,183,210,.42); border-radius: 18px; background: rgba(255,255,255,.72); box-shadow: 0 16px 50px rgba(34,68,105,.08); }
.tenant-entry label { display: block; margin-bottom: 9px; font-size: .88rem; font-weight: 750; }
.tenant-entry > div { display: flex; align-items: center; gap: 10px; }
.tenant-entry input { min-width: 0; flex: 1; padding: 13px 14px; border: 1px solid #cbd5df; border-radius: 10px; font: inherit; }
.tenant-entry span { color: #667b93; }
.registration-card { width: min(560px, calc(100% - 32px)); }
.registration-card .auth-intro, .registration-card small { color: #667b93; }
.registration-card .errorlist { margin: 2px 0 0; padding: 0; list-style: none; color: #a52020; font-size: .82rem; }
.slug-field { display: flex; align-items: center; overflow: hidden; border: 1px solid #cbd5df; border-radius: 9px; background: #fff; }
.auth-card .slug-field input { border: 0; border-radius: 0; outline: 0; }
.slug-field span { padding-right: 14px; color: #667b93; white-space: nowrap; }
@media (max-width: 620px) { .tenant-entry > div { align-items: stretch; flex-wrap: wrap; } .tenant-entry span { align-self: center; } .tenant-entry .button { width: 100%; } .slug-field span { font-size: .78rem; } }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-top: 36px; }
.module-grid article, .module-grid a { min-height: 140px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; border-radius: 14px; background: white; box-shadow: 0 8px 30px rgba(13, 27, 42, .06); color: inherit; text-decoration: none; }
.module-grid span { color: #77879a; font-size: .88rem; }

.crm-layout { background: #f3f4f6; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 238px; padding: 24px 14px; display: flex; flex-direction: column; background: #17181c; color: white; }
.sidebar-brand { padding: 4px 10px; color: white; font-size: 1.15rem; font-weight: 900; text-decoration: none; }
.sidebar-brand span { color: #5b93ef; }
.sidebar-tenant { margin: 22px 10px 12px; color: #8c929d; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { padding: 11px 12px; display: flex; justify-content: space-between; border-radius: 8px; color: #c8ccd2; text-decoration: none; font-size: .94rem; }
.sidebar nav a:hover, .sidebar nav a.active { background: #2a2d33; color: white; }
.sidebar nav a.disabled { color: #737780; cursor: default; }
.sidebar nav small { font-size: .65rem; text-transform: uppercase; }
.sidebar-user { margin-top: auto; padding: 14px 10px 2px; display: grid; gap: 4px; border-top: 1px solid #303238; overflow: hidden; }
.sidebar-user span { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; }
.sidebar-user small { color: #858a94; }
.crm-main { min-height: 100vh; margin-left: 238px; }
.topbar { height: 64px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e2e4e8; background: white; }
.dark-link { color: #344052; }
.crm-content { max-width: 1320px; margin: 0 auto; padding: 38px 34px 70px; }
.page-heading, .section-heading { margin-bottom: 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-heading h1 { margin: 0 0 6px; font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -.035em; }
.page-heading p { margin: 0; color: #77808c; }
.section-heading { margin-top: 34px; }
.section-heading h2 { margin: 0; }
.button { padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cfd4db; border-radius: 8px; background: white; color: #202833; font: inherit; font-size: .9rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.button.dark { border-color: #191b20; background: #191b20; color: white; }
.button.ghost { background: transparent; }
.toolbar { margin-bottom: 18px; display: flex; gap: 10px; }
.search { min-width: min(520px, 70vw); padding: 11px 13px; border: 1px solid #d4d8de; border-radius: 8px; background: white; font: inherit; }
.table-card, .info-card, .empty-card, .form-card { border: 1px solid #e1e3e6; border-radius: 12px; background: white; box-shadow: 0 4px 18px rgba(25, 32, 42, .035); }
.table-card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 17px; border-bottom: 1px solid #eceef0; text-align: left; vertical-align: middle; }
th { color: #7a828d; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.table-link, .actions a, .post-card a, .back-link { color: #2368d7; font-weight: 700; text-decoration: none; }
.actions { text-align: right; white-space: nowrap; }
.muted { color: #8a929d; }
.empty { padding: 44px 18px; color: #8a929d; text-align: center; }
.messages { margin-bottom: 20px; }
.message { padding: 12px 15px; border: 1px solid #b9dfc8; border-radius: 8px; background: #edf9f1; color: #23653b; }
.info-card { padding: 22px; }
.info-card h2, .info-card h3 { margin: 8px 0; }
.info-card p { line-height: 1.55; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.empty-card { padding: 40px; color: #8a929d; text-align: center; }
.post-card { min-height: 180px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; }
.status-pill { padding: 5px 8px; display: inline-block; border-radius: 999px; background: #e8f6ed; color: #247240; font-size: .72rem; font-weight: 800; }
.status-pill.inactive { background: #eceef1; color: #777e88; }
dl { margin: 16px 0 0; display: grid; gap: 10px; }
dl div { display: grid; grid-template-columns: 100px 1fr; }
dt { color: #8a929d; }
dd { margin: 0; }
.form-card { max-width: 680px; padding: 26px; }
.field { margin-bottom: 18px; display: grid; gap: 7px; }
.field label { font-size: .84rem; font-weight: 750; }
.field input:not([type="checkbox"]), .field textarea, .field select { width: 100%; padding: 11px 12px; border: 1px solid #cfd5dc; border-radius: 8px; background: white; font: inherit; }
.checkbox-field { grid-template-columns: auto 1fr; align-items: center; }
.checkbox-field label { grid-column: 2; grid-row: 1; }
.checkbox-field input { grid-column: 1; grid-row: 1; }
.field-error { color: #b12727; font-size: .8rem; }
.form-actions { display: flex; gap: 10px; margin-top: 26px; }
.back-link { display: inline-block; margin-bottom: 10px; font-size: .86rem; }
.calendar-toolbar { margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.calendar-toolbar strong { min-width: 170px; text-align: center; }
.schedule { display: grid; gap: 9px; }
.schedule-item { padding: 16px 18px; display: grid; grid-template-columns: 64px minmax(220px, 1fr) 140px 130px 90px; align-items: center; gap: 16px; border: 1px solid #e1e3e6; border-radius: 10px; background: white; color: inherit; text-decoration: none; }
.schedule-item:hover { border-color: #9db9e8; box-shadow: 0 5px 20px rgba(35, 104, 215, .07); }
.schedule-item time { font-size: 1.1rem; font-weight: 800; }
.schedule-item time small, .schedule-main span { margin-top: 4px; display: block; color: #89919c; font-size: .75rem; }
.schedule-main { min-width: 0; }
.status-cancelled, .status-no_show { background: #f5e9e9; color: #9b3434; }
.status-in_progress, .status-arrived { background: #fff2d9; color: #8a5a00; }
.status-ready, .status-converted, .status-closed { background: #e6f5eb; color: #247240; }
.wide-form { max-width: 820px; }
.service-choice-field ul { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; list-style: none; }
.service-choice-field li label { padding: 11px; display: flex; align-items: center; gap: 9px; border: 1px solid #d8dce1; border-radius: 8px; background: #fafbfc; }
.detail-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.item-list { margin: 12px 0 0; padding: 0; list-style: none; }
.item-list li { padding: 11px 0; display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid #eceef0; }
.item-list li:last-child { border-bottom: 0; }
.item-list .total { margin-top: 6px; padding-top: 16px; font-size: 1.1rem; }
.command-bar { margin-top: 22px; padding: 16px; display: flex; flex-wrap: wrap; gap: 10px; border: 1px solid #e1e3e6; border-radius: 10px; background: white; }
.button.danger { border-color: #e2bcbc; color: #a22d2d; }
.planner-scroll { overflow-x: auto; border: 1px solid #dfe3e8; border-radius: 12px; background: white; box-shadow: 0 5px 24px rgba(25, 32, 42, .05); }
.planner { min-width: 760px; }
.planner-header, .planner-body { display: grid; grid-template-columns: 76px repeat(var(--employee-count), minmax(180px, 1fr)); }
.planner-body { position: relative; }
.planner-header { position: relative; z-index: 10; border-bottom: 1px solid #dfe3e8; background: #fff; }
.planner-corner, .planner-employee-head { min-height: 68px; padding: 13px; display: flex; flex-direction: column; justify-content: center; }
.planner-corner { color: #8a929d; font-size: .72rem; text-transform: uppercase; }
.planner-employee-head { border-left: 1px solid #e5e8ec; }
.planner-employee-head div span { margin-top: 4px; color: #8a929d; font-size: .72rem; }
.time-ruler { position: relative; background: #fafbfc; }
.time-ruler span { position: absolute; right: 9px; z-index: 2; padding: 2px 4px; transform: translateY(-50%); border-radius: 4px; background: #fafbfc; color: #78818d; font-size: .78rem; font-weight: 700; }
.time-ruler span.first-tick { transform: translateY(0); }
.time-ruler span.last-tick { transform: translateY(-100%); }
.planner-column { position: relative; border-left: 1px solid #e5e8ec; background: #fff; }
.planner-column.is-clickable { cursor: crosshair; }
.planner-line { position: absolute; right: 0; left: 0; height: 1px; border-top: 1px dashed #edf0f3; pointer-events: none; }
.planner-line.hour-line { border-top-style: solid; border-color: #dfe3e7; }
.slot-hover { position: absolute; right: 3px; left: 3px; z-index: 2; border: 1px dashed #3a78dd; border-radius: 6px; background: rgba(53, 120, 229, .09); pointer-events: none; }
.slot-hover span { padding: 5px 7px; display: inline-block; color: #2864c3; font-size: .72rem; font-weight: 800; }
.booking-card { position: absolute; right: 5px; left: 5px; z-index: 4; min-height: 36px; padding: 7px 9px; overflow: hidden; border-left: 4px solid #3188c9; border-radius: 7px; background: #dff1ff; color: #17334a; text-decoration: none; box-shadow: 0 2px 6px rgba(20, 50, 75, .08); }
.booking-card:hover { z-index: 5; outline: 2px solid rgba(35, 104, 215, .25); }
.booking-card > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-card strong { margin: 3px 0; font-size: .82rem; }
.booking-card span:not(.booking-time), .booking-card small { font-size: .7rem; }
.booking-time { font-size: .68rem; font-weight: 800; }
.status-card-in_progress { border-color: #da9a20; background: #fff0bd; color: #6d4c0f; }
.status-card-completed { border-color: #25a678; background: #dff8ee; color: #165e47; }
.status-card-waiting { border-color: #3188c9; background: #dff1ff; color: #17334a; }
.appointment-form { display: grid; gap: 22px; }
.form-section { margin: 0; padding: 22px; border: 1px solid #e1e4e8; border-radius: 10px; }
.form-section legend { padding: 0 7px; font-size: 1rem; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.choice-tabs ul { margin: 0 0 18px; padding: 0; display: flex; gap: 8px; list-style: none; }
.choice-tabs label { padding: 9px 12px; display: flex; align-items: center; gap: 7px; border: 1px solid #d4d9df; border-radius: 8px; cursor: pointer; }
#client-search { width: 100%; padding: 11px 12px; border: 1px solid #cfd5dc; border-radius: 8px; background: #fbfcfd; font: inherit; }
[hidden] { display: none !important; }

/* Theme tokens. New themes can override these variables under .theme-<theme_key>. */
.theme-light_blue {
  --crm-primary: #1677ff;
  --crm-primary-soft: #eaf3ff;
  --crm-primary-hover: #0868e8;
  --crm-bg: #f6f9fe;
  --crm-panel: #ffffff;
  --crm-border: #dfe7f2;
  --crm-text: #10264a;
  --crm-muted: #71819a;
  --crm-sidebar-width: 250px;
}
.crm-layout { background: var(--crm-bg); color: var(--crm-text); }
.crm-layout .sidebar {
  width: var(--crm-sidebar-width); padding: 26px 14px 18px; background: var(--crm-panel);
  color: var(--crm-text); border-right: 1px solid var(--crm-border); box-shadow: 4px 0 20px rgba(30, 83, 158, .025);
}
.crm-layout .sidebar-brand { padding: 4px 12px; color: var(--crm-text); font-size: 1.3rem; letter-spacing: -.025em; }
.crm-layout .sidebar-brand span { color: var(--crm-primary); }
.crm-layout .sidebar-tenant { margin: 6px 12px 28px; color: var(--crm-muted); font-size: .78rem; letter-spacing: 0; text-transform: none; }
.crm-layout .sidebar nav { gap: 7px; }
.crm-layout .sidebar nav a { padding: 12px 14px; align-items: center; justify-content: flex-start; gap: 12px; color: #586b87; border-radius: 10px; font-weight: 650; }
.crm-layout .sidebar nav a:hover, .crm-layout .sidebar nav a.active { background: var(--crm-primary-soft); color: var(--crm-primary); }
.nav-icon { width: 22px; display: inline-grid; place-items: center; color: currentColor; font-size: 1.22rem; line-height: 1; }
.crm-layout .sidebar-user { border-color: var(--crm-border); color: var(--crm-text); }
.crm-layout .sidebar-user small { color: var(--crm-muted); }
.crm-layout .crm-main { margin-left: var(--crm-sidebar-width); }
.crm-layout .topbar { height: 54px; border-color: var(--crm-border); background: var(--crm-panel); }
.crm-layout .dark-link { color: #5d6e87; }
.crm-layout .crm-content { max-width: 1500px; padding-top: 30px; }
.crm-layout .page-heading h1 { color: #0b2146; font-size: clamp(2rem, 3vw, 2.8rem); }
.crm-layout .page-heading p { color: var(--crm-muted); font-size: 1rem; }
.button.primary, .button.dark { border-color: var(--crm-primary); background: var(--crm-primary); color: white; box-shadow: 0 5px 14px rgba(22, 119, 255, .2); }
.button.primary:hover, .button.dark:hover { border-color: var(--crm-primary-hover); background: var(--crm-primary-hover); }
.large-button { padding: 13px 22px; border-radius: 10px; font-size: .95rem; }
.plus { margin-right: 5px; font-size: 1.25rem; font-weight: 400; }
.calendar-shell { overflow: hidden; border: 1px solid var(--crm-border); border-radius: 13px; background: var(--crm-panel); box-shadow: 0 8px 30px rgba(35, 92, 167, .055); }
.calendar-shell .calendar-toolbar { min-height: 76px; margin: 0; padding: 13px 14px; border-bottom: 1px solid var(--crm-border); }
.icon-button { width: 42px; height: 42px; padding: 0; font-size: 1.7rem; }
.date-button { min-width: 210px; height: 42px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: flex-start; gap: 11px; border: 1px solid var(--crm-border); border-radius: 9px; color: #213755; background: white; text-align: left; }
.date-button span { color: var(--crm-primary); }
.view-switch { margin-left: auto; padding: 3px; display: flex; border: 1px solid var(--crm-border); border-radius: 9px; background: #f9fbfe; color: #4d607c; font-size: .84rem; font-weight: 700; }
.view-switch span { min-width: 76px; padding: 8px 12px; text-align: center; }
.view-switch .active { border-radius: 7px; background: var(--crm-primary-soft); color: var(--crm-primary); }
.calendar-shell .planner-scroll { border: 0; border-radius: 0; box-shadow: none; }
.planner-header, .planner-body { grid-template-columns: 78px repeat(var(--employee-count), minmax(220px, 1fr)); }
.planner-header { border-color: var(--crm-border); }
.planner-corner, .planner-employee-head { min-height: 82px; padding: 15px; }
.planner-employee-head { display: flex; align-items: center; gap: 11px; border-left: 1px solid var(--crm-border); }
.planner-employee-head > div { min-width: 0; display: grid; gap: 3px; }
.planner-employee-head strong { overflow: hidden; color: #142b50; text-overflow: ellipsis; white-space: nowrap; }
.planner-employee-head div span { color: var(--crm-muted); font-size: .76rem; }
.planner-employee-head.unassigned { background: #fafbfc; }
.employee-avatar { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; color: white; font-size: .82rem; font-weight: 850; }
.employee-color { width: 9px; height: 9px; margin-right: 7px; display: inline-block; border-radius: 50%; }
.employee-avatar.color-blue, .employee-color.color-blue { background: #2485f7; }
.employee-avatar.color-purple, .employee-color.color-purple { background: #8556e8; }
.employee-avatar.color-orange, .employee-color.color-orange { background: #f3a11a; }
.employee-avatar.color-green, .employee-color.color-green { background: #20a87d; }
.employee-avatar.color-gray, .employee-color.color-gray { background: #7f8ea6; }
.time-ruler { background: #fbfcfe; }
.planner-column { border-color: var(--crm-border); }
.planner-line { border-color: #e8eef6; }
.planner-line.hour-line { border-color: #dce5f0; }
.slot-hover { right: 8px; left: 8px; border-color: var(--crm-primary); border-radius: 9px; background: rgba(22, 119, 255, .07); }
.slot-hover span { color: var(--crm-primary); }
.booking-card { right: 7px; left: 7px; padding: 9px 11px; border-left-width: 4px; border-color: #2485f7; border-radius: 9px; background: #e6f2ff; color: #193c69; box-shadow: 0 3px 10px rgba(31, 96, 180, .08); }
.booking-card.color-purple { border-color: #8556e8; background: #f0eaff; color: #4e358e; }
.booking-card.color-orange { border-color: #f3a11a; background: #fff3dc; color: #765014; }
.booking-card.color-green { border-color: #20a87d; background: #e3f7f0; color: #215f4d; }
.booking-card.color-gray { border-color: #7f8ea6; background: #edf1f6; color: #40516a; }
.booking-top { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; }
.booking-status { padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,.56); font-size: .62rem !important; font-weight: 800; }
.booking-card strong { margin: 6px 0 3px; font-size: .9rem; }
.status-card-in_progress { border-color: #f3a11a; background: #fff3dc; color: #765014; }
.status-card-completed { border-color: #20a87d; background: #e3f7f0; color: #215f4d; }
.status-card-waiting { border-color: #2485f7; background: #e6f2ff; color: #193c69; }
.status-card-no_show { border-color: #8c98aa !important; background: #edf1f5 !important; color: #586577 !important; }
.status-no_show { background: #edf1f5; color: #586577; }
.booking-badges { display: grid !important; justify-items: end; gap: 3px; }
.booking-payment { padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.7); font-size: .59rem !important; font-weight: 800; }
.payment-card-paid { color: #15734e; }
.payment-card-unpaid, .payment-card-partial, .payment-card-refunded { color: #c33434; }
.metric-card.positive > strong { color: #168257; }
.table-card, .info-card, .empty-card, .form-card, .command-bar { border-color: var(--crm-border); box-shadow: 0 6px 22px rgba(35, 92, 167, .04); }
.form-section { border-color: var(--crm-border); }
.field input:not([type="checkbox"]):focus, .field textarea:focus, .field select:focus, #client-search:focus { outline: 3px solid rgba(22, 119, 255, .12); border-color: var(--crm-primary); }
.service-card-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.service-select-card { position: relative; min-height: 78px; padding: 12px; display: grid; gap: 10px; align-content: start; border: 1px solid var(--crm-border); border-radius: 10px; background: #fbfdff; transition: border-color .15s, background .15s, box-shadow .15s; }
.service-select-card > label { position: relative; min-height: 46px; padding-right: 34px; display: flex; align-items: center; cursor: pointer; }
.service-select-card:hover { border-color: #9cc4fb; background: #f5f9ff; }
.service-select-card:has(input:checked) { border-color: var(--crm-primary); background: var(--crm-primary-soft); box-shadow: 0 0 0 2px rgba(22,119,255,.08); }
.service-select-card > label > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.service-select-card > label > span:last-child { display: grid; gap: 5px; }
.service-select-card small { color: var(--crm-muted); font-weight: 550; }
.service-check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #cbd8e8; border-radius: 6px; background: white; color: transparent; }
.service-select-card input:checked + .service-check { border-color: var(--crm-primary); background: var(--crm-primary); color: white; }
.service-class-choice { padding-top: 9px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; border-top: 1px solid var(--crm-border); }
.service-class-choice > span { color: var(--crm-muted); font-size: .75rem; font-weight: 700; }
.service-class-choice select { min-width: 0; width: 100%; }
.service-class-choice.is-hidden { display: none; }
.vehicle-price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.service-expand-button { padding: 0; display: inline-flex; align-items: center; gap: 9px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.service-expand-button > span { color: var(--crm-primary); font-size: 1.25rem; transition: transform .2s ease; }
.service-expand-button[aria-expanded="true"] > span { transform: rotate(90deg); }
.service-price-detail > td { padding: 0 !important; background: #f8fbff; }
.service-class-price-list { padding: 14px 22px 18px 48px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 24px; animation: expand-row .2s ease both; }
.service-class-price-list > form { position: relative; padding: 9px 0; display: grid; grid-template-columns: minmax(100px, 1fr) 110px auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--crm-border); }
.service-class-price-list label { display: flex; align-items: center; gap: 5px; }
.service-class-price-list input { width: 90px; padding: 7px 9px; border: 1px solid var(--crm-border); border-radius: 7px; font: inherit; }
.service-class-price-list small { position: absolute; top: 100%; right: 0; color: #168257; }
@keyframes expand-row { from { transform: translateY(-6px); } to { transform: translateY(0); } }
.inline-stock-form { position: relative; width: 154px; height: 36px; display: grid; grid-template-columns: 82px 28px 30px; align-items: center; gap: 5px; }
.inline-stock-form .inline-stock-value { grid-column: 1; grid-row: 1; padding: 7px 9px; border-radius: 7px; font-weight: 700; cursor: text; }
.inline-stock-form input { width: 82px; height: 34px; grid-column: 1; grid-row: 1; padding: 6px 8px; border: 1px solid var(--crm-primary); border-radius: 7px; background: #fff; font: inherit; opacity: 0; pointer-events: none; }
.inline-stock-form > span:not(.inline-stock-value) { grid-column: 2; grid-row: 1; white-space: nowrap; }
.inline-stock-form button { width: 28px; height: 28px; grid-column: 3; grid-row: 1; border: 0; border-radius: 7px; background: var(--crm-primary); color: #fff; cursor: pointer; opacity: 0; pointer-events: none; }
.inline-stock-form:hover .inline-stock-value, .inline-stock-form:focus-within .inline-stock-value, .inline-stock-form.is-editing .inline-stock-value { opacity: 0; }
.inline-stock-form:hover input, .inline-stock-form:focus-within input, .inline-stock-form:hover button, .inline-stock-form:focus-within button, .inline-stock-form.is-editing input, .inline-stock-form.is-editing button { opacity: 1; pointer-events: auto; }
.inline-stock-form.is-saving button { opacity: .55; pointer-events: none; }
.inline-stock-form small { position: absolute; top: 100%; left: 0; color: #c33434; white-space: nowrap; }
.working-hours-list { display: grid; gap: 8px; }
.working-hours-row { padding: 12px 14px; display: grid; grid-template-columns: minmax(140px, 1fr) 170px 170px 130px; align-items: end; gap: 12px; border: 1px solid var(--crm-border); border-radius: 10px; }
.working-hours-row label { display: grid; gap: 5px; color: var(--crm-muted); font-size: .78rem; font-weight: 700; }
.working-hours-row input[type="time"] { padding: 9px 10px; border: 1px solid var(--crm-border); border-radius: 8px; font: inherit; }
.working-hours-row .closed-day { padding-bottom: 9px; display: flex; align-items: center; gap: 8px; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }
.service-total { padding: 12px 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-radius: 9px; background: #f5f8fc; color: var(--crm-muted); font-size: .82rem; }
.service-total strong { color: var(--crm-text); }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.inventory-heading-actions { flex: 0 0 auto; flex-wrap: nowrap; }
.inventory-heading-actions .button { min-height: 44px; white-space: nowrap; }
.client-inline-link { color: inherit; font-weight: 700; text-decoration: none; }
.client-inline-link:hover { color: var(--crm-primary); }
.status-waiting { background: #e8f2ff; color: #1769c8; }
.status-in_progress { background: #fff0d3; color: #8a5a00; }
.status-completed, .payment-paid { background: #e3f6ec; color: #21724e; }
.payment-unpaid { background: #f0f2f5; color: #657186; }
.payment-partial { background: #fff0d3; color: #8a5a00; }
.payment-refunded { background: #eee9fb; color: #6748a8; }
.client-history-panel { margin-top: 24px; scroll-margin-top: 20px; }
.compact-heading { margin: 0 0 15px; }
.compact-heading p, .section-heading p { margin: 4px 0 0; color: var(--crm-muted); }
.history-card { padding-top: 8px; padding-bottom: 8px; }
.visit-history { display: grid; }
.visit-row { padding: 15px 4px; display: grid; grid-template-columns: 105px minmax(210px, 1fr) minmax(130px, .7fr) auto 90px; align-items: center; gap: 16px; border-bottom: 1px solid #e9eef5; color: inherit; text-decoration: none; }
.visit-row:last-child { border-bottom: 0; }
.visit-row:hover { color: var(--crm-primary); }
.visit-row > time, .visit-row > span { min-width: 0; }
.visit-row small { margin-top: 4px; display: block; overflow: hidden; color: var(--crm-muted); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.visit-row > strong:last-child { text-align: right; white-space: nowrap; }

@media (max-width: 760px) {
  .crm-layout .sidebar { position: static; width: auto; }
  .sidebar nav { grid-template-columns: repeat(3, 1fr); }
  .sidebar nav a { padding: 8px; font-size: .78rem; }
  .sidebar-user { margin-top: 14px; display: grid; }
  .crm-layout .crm-main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .crm-content { padding: 25px 15px 50px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .toolbar { flex-wrap: wrap; }
  .search { min-width: 100%; }
  th, td { padding: 12px; }
  .schedule-item { grid-template-columns: 55px 1fr; }
  .schedule-item > span, .schedule-item > strong { grid-column: 2; }
  .detail-layout { grid-template-columns: 1fr; }
  .planner-page-heading .button { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .heading-actions { align-items: flex-start; flex-direction: column; }
  .visit-row { grid-template-columns: 85px 1fr; }
  .visit-row > :nth-child(n+3) { grid-column: 2; }
}

/* Shared interactive controls and the current light-blue product theme. */
.crm-layout .sidebar nav { min-height: 0; overflow-y: auto; }
.custom-select { position: relative; width: 100%; }
.enhanced-native-select { position: absolute !important; inset: 0; z-index: -1; opacity: 0; pointer-events: none; }
.custom-select-button { width: 100%; min-height: 43px; padding: 10px 38px 10px 12px; border: 1px solid #cfd5dc; border-radius: 8px; background: #fff; color: var(--crm-text, #132133); font: inherit; text-align: left; cursor: pointer; }
.custom-select-button::after { content: "⌄"; position: absolute; top: 9px; right: 13px; color: #718099; font-size: 1.05rem; }
.custom-select-button:disabled { background: #f2f5f8; color: #8490a1; cursor: default; }
.custom-select.open .custom-select-button { border-color: var(--crm-primary, #1677ff); box-shadow: 0 0 0 3px rgba(22,119,255,.12); }
.custom-select-menu { position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 120; max-height: 260px; padding: 6px; overflow-y: auto; border: 1px solid var(--crm-border, #dce5f0); border-radius: 10px; background: white; box-shadow: 0 16px 38px rgba(25, 55, 95, .16); }
.custom-select-option { width: 100%; padding: 10px 11px; border: 0; border-radius: 7px; background: transparent; color: #203654; font: inherit; text-align: left; cursor: pointer; }
.custom-select-option:hover, .custom-select-option[aria-selected="true"] { background: var(--crm-primary-soft, #eaf3ff); color: var(--crm-primary, #1677ff); }
.custom-select-option:disabled { color: #a6afbb; cursor: default; }
.help-text { color: var(--crm-muted, #718099); font-size: .76rem; line-height: 1.45; }

.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; padding: 28px; display: grid; place-items: center; background: rgba(11, 33, 70, .36); backdrop-filter: blur(3px); }
.modal-backdrop[hidden] { display: none; }
.modal-panel { width: min(760px, 100%); max-height: calc(100vh - 56px); padding: 27px; overflow-y: auto; border: 1px solid rgba(255,255,255,.8); border-radius: 17px; background: #fff; box-shadow: 0 28px 80px rgba(13, 38, 78, .25); }
.modal-loading { padding: 70px; color: var(--crm-muted); text-align: center; }
.modal-head { display: flex; justify-content: space-between; gap: 20px; }
.modal-head h2 { margin: 6px 0 4px; color: #0b2146; font-size: 1.75rem; }
.modal-head p { margin: 0; color: var(--crm-muted); }
.modal-close { width: 38px; height: 38px; flex: 0 0 38px; border: 0; border-radius: 50%; background: #f0f4f9; color: #51637d; font-size: 1.65rem; line-height: 1; cursor: pointer; }
.modal-status-line { margin: 20px 0; display: flex; gap: 8px; }
.modal-detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.modal-detail-grid > div { padding: 13px; display: grid; gap: 5px; border-radius: 9px; background: #f6f9fd; }
.modal-detail-grid span { color: var(--crm-muted); font-size: .75rem; }
.modal-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--crm-border); }
.modal-section h3 { margin: 0 0 10px; color: #173154; }
.modal-section-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.text-action { color: var(--crm-primary); font-size: .85rem; font-weight: 750; text-decoration: none; }
.compact-items { margin-top: 4px; }
.modal-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 9px; }
.split-actions { padding-top: 18px; border-top: 1px solid var(--crm-border); }
.modal-actions form { margin: 0; }
.modal-form { margin-top: 22px; }
.modal-form .service-card-list { max-height: 260px; overflow-y: auto; }
.modal-form[data-appointment-edit] .service-card-list {
  max-height: min(440px, 52vh);
  padding: 4px 7px 4px 2px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-items: start;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
.modal-form[data-appointment-edit] .service-select-card {
  min-width: 0;
  min-height: 96px;
  height: auto;
  align-self: start;
  overflow: hidden;
}
.modal-form[data-appointment-edit] .service-class-choice {
  position: relative;
  min-width: 0;
  grid-template-columns: 1fr;
  align-items: stretch;
}
.modal-form[data-appointment-edit] .service-class-choice .custom-select,
.modal-form[data-appointment-edit] .service-class-choice .custom-select-button { min-width: 0; width: 100%; }

.stat-strip { margin-bottom: 18px; padding: 15px 18px; display: grid; grid-template-columns: .5fr 1.5fr 1fr; gap: 16px; border: 1px solid var(--crm-border); border-radius: 12px; background: white; }
.stat-strip > div { display: grid; gap: 4px; }
.stat-strip span { color: var(--crm-muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.stat-strip strong { color: #173154; font-size: .9rem; }
.variance { padding: 5px 8px; border-radius: 999px; background: #eef2f7; color: #52627a; font-weight: 750; }
.variance.negative { background: #fff0f0; color: #ac3838; }
.variance.positive { background: #e7f7ef; color: #24714f; }

.period-tabs { width: fit-content; margin: -10px 0 20px; padding: 4px; display: flex; gap: 3px; border: 1px solid var(--crm-border); border-radius: 10px; background: #fff; }
.period-tabs a { padding: 9px 18px; border-radius: 7px; color: #566a87; font-size: .86rem; font-weight: 750; text-decoration: none; }
.period-tabs a.active { background: var(--crm-primary-soft); color: var(--crm-primary); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-height: 135px; padding: 19px; display: flex; flex-direction: column; border: 1px solid var(--crm-border); border-radius: 13px; background: white; box-shadow: 0 6px 22px rgba(35,92,167,.04); }
.metric-card > span { color: var(--crm-muted); font-size: .8rem; font-weight: 700; }
.metric-card strong { margin: 15px 0 7px; color: #112b50; font-size: 1.65rem; }
.metric-card small { color: var(--crm-muted); }
.metric-card.accent { border-color: #b9d7ff; background: linear-gradient(135deg, #f7fbff, #e9f3ff); }
.metric-card.accent strong { color: var(--crm-primary); }
.metric-card.danger strong { color: #b43c3c; }
.analytics-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.breakdown-list, .expense-list { margin: 0; padding: 0; list-style: none; }
.breakdown-list li, .expense-list li { padding: 12px 0; display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid #e9eef5; }
.breakdown-list li:last-child, .expense-list li:last-child { border-bottom: 0; }
.expense-list li > div { display: grid; gap: 3px; }
.expense-list small, .table-subtitle { display: block; color: var(--crm-muted); font-size: .74rem; }
.analytics-table { margin-top: 16px; }
.analytics-table .section-heading { margin: 0; padding: 20px 20px 0; }
.service-average { margin: 2px 4px 2px 0; padding: 4px 7px; display: inline-block; border-radius: 6px; background: #f0f5fb; color: #50647f; font-size: .72rem; }
.permission-field ul { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; list-style: none; }
.permission-field li label { min-height: 46px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--crm-border); border-radius: 9px; background: #fbfdff; cursor: pointer; }
.permission-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.permission-tags span { padding: 5px 8px; border-radius: 6px; background: var(--crm-primary-soft); color: #42658f; font-size: .7rem; }
.role-card { min-height: 180px; }
.embedded-table { border: 0; box-shadow: none; }
.sidebar-user form { margin-top: 8px; }
.sidebar-logout { width: 100%; padding: 8px 0; border: 0; background: transparent; color: #677a94; font: inherit; font-size: .78rem; font-weight: 750; text-align: left; cursor: pointer; }
.sidebar-logout:hover { color: var(--crm-primary); }
.service-editor { max-width: 960px; }
.service-norm-section { margin-top: 8px; }
.service-norm-section h2 { margin: 0 0 4px; color: #173154; font-size: 1.15rem; }
.service-norm-section p { margin: 0; color: var(--crm-muted); font-size: .82rem; }
.norm-list { margin-top: 18px; display: grid; gap: 9px; }
.norm-row { padding: 13px; display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(145px, .7fr) 130px 34px; align-items: end; gap: 10px; border: 1px solid var(--crm-border); border-radius: 10px; background: #fbfdff; }
.norm-row[hidden] { display: none; }
.norm-row .field { margin: 0; }
.norm-cost { min-height: 43px; display: grid; align-content: center; gap: 3px; }
.norm-cost span { color: var(--crm-muted); font-size: .7rem; }
.norm-cost strong { color: #173154; }
.icon-remove { width: 34px; height: 42px; border: 0; border-radius: 8px; background: #f1f4f8; color: #76849a; font-size: 1.25rem; cursor: pointer; }
.icon-remove:hover { background: #ffecec; color: #a93434; }
.norm-empty { padding: 20px; border: 1px dashed #cad6e5; border-radius: 10px; color: var(--crm-muted); text-align: center; }
.service-cost-summary { margin-top: 14px; padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-radius: 10px; background: var(--crm-primary-soft); color: #345b8b; }
.service-cost-summary strong { color: var(--crm-primary); font-size: 1.25rem; }
.stock-summary { grid-template-columns: repeat(3, 1fr); }
.negative-text { color: #ac3838 !important; }
.positive-text { color: #24714f !important; }
.metric-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-card-head > span { color: var(--crm-muted); font-size: .8rem; font-weight: 700; }
.metric-history-button { padding: 4px 8px; border: 1px solid #bbd7fa; border-radius: 7px; background: rgba(255,255,255,.75); color: var(--crm-primary); font: inherit; font-size: .7rem; font-weight: 800; cursor: pointer; }
.revenue-history-modal { width: min(1080px, 100%); }
.revenue-history-table { margin-top: 22px; max-height: 58vh; overflow: auto; }

/* Calendars use page scrolling and a detailed 15-minute grid. */
.calendar-shell { overflow: visible; }
.calendar-shell .planner-scroll { overflow: visible; }
.calendar-shell .planner { min-width: calc(78px + var(--employee-count) * 220px); }
.date-picker-wrap { position: relative; }
.date-popover { position: absolute; top: calc(100% + 8px); left: 0; z-index: 160; width: 294px; padding: 13px; border: 1px solid var(--crm-border); border-radius: 12px; background: white; box-shadow: 0 18px 46px rgba(23,49,84,.2); }
.date-popover-head { margin-bottom: 10px; display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 6px; }
.date-popover-head strong { min-width: 0; font-size: .88rem; text-align: center; text-transform: capitalize; }
.date-popover-head button, .date-day { border: 0; border-radius: 7px; background: transparent; color: var(--crm-text); font: inherit; cursor: pointer; }
.date-popover-head button { height: 34px; font-size: 1.3rem; }
.date-popover-head button:hover, .date-day:hover { background: var(--crm-primary-soft); color: var(--crm-primary); }
.date-weekdays, .date-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.date-weekdays span { padding: 5px 0; color: var(--crm-muted); font-size: .66rem; font-weight: 750; text-align: center; }
.date-day { height: 34px; font-size: .78rem; }
.date-day.outside { color: #b5bfcd; }
.date-day.today { box-shadow: inset 0 0 0 1px #a7c9f7; }
.date-day.selected { background: var(--crm-primary); color: white; font-weight: 800; }
.time-ruler span { font-size: .68rem; }
.current-time-line { position: absolute; right: 0; left: 78px; z-index: 8; height: 2px; background: #ef4b4b; pointer-events: none; }
.current-time-line::before { content: ""; position: absolute; left: 72px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ef4b4b; }
.current-time-line::before { left: -5px; }
.current-time-line span { position: absolute; right: calc(100% + 8px); left: auto; top: -10px; width: 66px; color: #d93434; background: #fff; font-size: .7rem; font-weight: 850; text-align: right; }

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.salary-settings { margin: 18px 0; }
.salary-settings[hidden] { display: none; }
.employee-service-list { display: grid; gap: 9px; }
.employee-service-row { padding: 12px 14px; display: grid; grid-template-columns: 22px minmax(0,1fr) 180px; align-items: center; gap: 12px; border: 1px solid var(--crm-border); border-radius: 10px; background: #fbfdff; }
.employee-service-row > span { display: grid; gap: 3px; }
.employee-service-row small { color: var(--crm-muted); font-size: .72rem; }
.service-rate-field { grid-template-columns: 1fr auto !important; align-items: center; gap: 7px !important; }
.service-rate-field input { min-width: 0; }
.assignee-picker { position: relative; grid-column: 1 / -1; }
.assignee-picker-button { width: 100%; min-height: 43px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--crm-border); border-radius: 9px; background: #fff; color: var(--crm-text); font: inherit; text-align: left; cursor: pointer; }
.assignee-picker-panel { position: absolute; z-index: 120; right: 0; left: 0; top: 70px; padding: 7px; border: 1px solid var(--crm-border); border-radius: 11px; background: #fff; box-shadow: 0 16px 40px rgba(23,49,84,.18); }
.assignee-check-row { padding: 9px 10px; display: grid; grid-template-columns: 20px 1fr 20px; align-items: center; gap: 9px; border-radius: 8px; cursor: pointer; }
.assignee-check-row:hover { background: var(--crm-primary-soft); }
.assignee-check-row span { display: grid; gap: 2px; }
.assignee-check-row small { color: var(--crm-muted); font-size: .7rem; }
.assignee-check-row i { visibility: hidden; color: var(--crm-primary); font-style: normal; font-weight: 900; }
.assignee-check-row input:checked ~ i { visibility: visible; }
.salary-split-toggle { margin-top: 6px; padding: 4px 0; border: 0; background: transparent; color: var(--crm-primary); font: inherit; font-size: .72rem; font-weight: 750; cursor: pointer; }
.salary-split-panel { margin-top: 7px; padding: 10px; display: grid; gap: 7px; border: 1px solid var(--crm-border); border-radius: 9px; background: #f8fbff; }
.salary-split-panel[hidden] { display: none; }
.salary-split-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.salary-split-row span:last-child { display: flex; align-items: center; gap: 5px; }
.salary-split-row input { width: 90px; }
.sidebar-user-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-user-head > div { min-width: 0; display: grid; gap: 2px; }
.sidebar-user-head span { overflow: hidden; text-overflow: ellipsis; }
.sidebar-settings { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 8px; color: #71839a; text-decoration: none; font-size: 1.05rem; }
.sidebar-settings:hover { background: var(--crm-primary-soft); color: var(--crm-primary); }
.placeholder-block { margin-top: 18px; padding: 18px; border: 1px dashed var(--crm-border); border-radius: 10px; color: var(--crm-muted); }
.placeholder-block p { margin: 5px 0 0; }
.cash-shift-card { padding: 26px 28px; }
.cash-shift-heading { margin: 0 0 24px; }
.cash-shift-heading h2 { margin: 0 0 5px; }
.cash-shift-heading p { margin: 0; }
.cash-current { display: grid; gap: 3px; text-align: right; }
.cash-current span { color: var(--crm-muted); font-size: .75rem; }
.cash-current strong { color: var(--crm-primary); font-size: 1.3rem; }
.cash-close-fields, .cash-collection-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.cash-close-fields .field, .cash-collection-form .field { margin-bottom: 0; }
.cash-close-fields textarea, .cash-collection-form textarea { min-height: 45px; height: 45px; resize: vertical; }
.cash-shift-actions { margin-top: 20px; display: flex; align-items: center; gap: 10px; }
.cash-shift-actions .button { min-height: 44px; white-space: nowrap; }
.cash-collection-panel { margin-top: 20px; padding: 20px; border: 1px solid var(--crm-border); border-radius: 11px; background: #f8fbff; }
.cash-collection-panel[hidden] { display: none; }
.cash-collection-form .form-actions { margin: 0; align-self: end; }
.damage-section { margin-top: 18px; }
.damage-count { color: var(--crm-muted); font-size: .78rem; }
.vehicle-map { position: relative; margin-top: 12px; border: 1px solid var(--crm-border); border-radius: 12px; background: #fff; user-select: none; }
.vehicle-map > img { width: 100%; display: block; border-radius: inherit; cursor: not-allowed; }
.vehicle-map.valid-target > img { cursor: crosshair; }
.damage-marker-wrap { position: absolute; z-index: 5; transform: translate(-50%, -50%); }
.damage-marker { position: relative; width: 25px; height: 25px; padding: 0; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; background: #e33f48; color: transparent; box-shadow: 0 2px 8px rgba(120,15,25,.35); font-size: 0; cursor: pointer; }
.damage-marker::before, .damage-marker::after, .damage-photo > form button::before, .damage-photo > form button::after { content: ""; position: absolute; top: 50%; left: 50%; width: 11px; height: 2px; border-radius: 999px; background: #fff; transform: translate(-50%, -50%) rotate(45deg); }
.damage-marker::after, .damage-photo > form button::after { transform: translate(-50%, -50%) rotate(-45deg); }
.damage-popover, .damage-create-popover { position: absolute; z-index: 40; top: 18px; left: 18px; width: min(320px, 70vw); padding: 14px; border: 1px solid var(--crm-border); border-radius: 11px; background: #fff; color: var(--crm-text); box-shadow: 0 18px 45px rgba(18,43,75,.22); user-select: text; }
.damage-popover[hidden], .damage-create-popover[hidden], .damage-edit-form[hidden] { display: none; }
.damage-marker-wrap.align-right .damage-popover, .damage-create-popover.align-right { right: 18px; left: auto; }
.damage-marker-wrap.align-bottom .damage-popover, .damage-create-popover.align-bottom { top: auto; bottom: 18px; }
.damage-popover-close { position: absolute; top: 6px; right: 7px; width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--crm-muted); font-size: 1.2rem; cursor: pointer; }
.damage-popover p { margin: 7px 0 10px; font-size: .82rem; line-height: 1.45; }
.damage-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.damage-photo { position: relative; }
.damage-photo > button:first-child { width: 100%; padding: 0; display: block; border: 0; background: transparent; cursor: zoom-in; }
.damage-photos img { width: 100%; height: 72px; display: block; object-fit: cover; border-radius: 7px; }
.damage-photo > form { position: absolute; top: 3px; right: 3px; margin: 0; }
.damage-photo > form button { position: relative; width: 22px; height: 22px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.9); border-radius: 50%; background: rgba(174,43,50,.9); color: transparent; font-size: 0; cursor: pointer; }
.damage-lightbox { position: fixed; inset: 0; z-index: 1500; padding: 48px 80px; display: grid; grid-template-columns: 48px minmax(0,1fr) 48px; align-items: center; gap: 18px; background: rgba(5,15,30,.9); }
.damage-lightbox[hidden] { display: none; }
.damage-lightbox img { max-width: 100%; max-height: calc(100vh - 96px); justify-self: center; object-fit: contain; cursor: zoom-out; }
.damage-lightbox-close, .damage-lightbox-nav { border: 0; background: transparent; color: white; cursor: pointer; }
.damage-lightbox-close { position: absolute; top: 20px; right: 24px; width: 42px; height: 42px; font-size: 2rem; }
.damage-lightbox-nav { width: 48px; height: 70px; border-radius: 12px; background: rgba(255,255,255,.1); font-size: 2.2rem; }
.damage-lightbox-nav:hover { background: rgba(255,255,255,.2); }
.damage-actions { margin-top: 11px; padding-top: 9px; display: flex; align-items: center; gap: 13px; border-top: 1px solid var(--crm-border); }
.damage-actions form { margin: 0; display: flex; align-items: center; }
.text-button { min-height: 26px; padding: 0; display: inline-flex; align-items: center; border: 0; background: transparent; color: var(--crm-primary); font: inherit; font-size: .76rem; line-height: 1; font-weight: 750; cursor: pointer; }
.damage-edit-form, .damage-create-popover form { margin-top: 12px; display: grid; gap: 9px; }
.damage-edit-form .field, .damage-create-popover .field { margin: 0; }
.damage-edit-form textarea, .damage-create-popover textarea { min-height: 70px; }
.damage-create-popover { transform: translate(0, 0); }
.damage-create-popover.align-right { transform: translateX(-100%); }
.damage-create-popover.align-bottom { transform: translateY(-100%); }
.damage-create-popover.align-right.align-bottom { transform: translate(-100%, -100%); }
.booking-card[draggable="true"] { cursor: grab; }
.booking-card { right: auto; left: calc(7px + (100% - 14px) / var(--lane-count) * var(--lane)); width: calc((100% - 14px) / var(--lane-count) - 4px); }
.booking-card.is-dragging { opacity: .38; cursor: grabbing; }
.planner-column.drag-target { background: rgba(22,119,255,.025); }
.post-settings-grid { margin-top: 22px; }

.client-autocomplete { position: relative; }
.client-suggestions { position: absolute; right: 22px; left: 22px; z-index: 80; margin-top: -4px; padding: 6px; border: 1px solid var(--crm-border); border-radius: 11px; background: white; box-shadow: 0 18px 42px rgba(25,55,95,.17); }
.client-suggestions button { width: 100%; padding: 10px 12px; display: grid; gap: 3px; border: 0; border-radius: 8px; background: white; color: #203654; font: inherit; text-align: left; cursor: pointer; }
.client-suggestions button:hover { background: var(--crm-primary-soft); }
.client-suggestions small { color: var(--crm-muted); }

.custom-select-add { margin-top: 5px; border-top: 1px solid var(--crm-border); border-radius: 0 0 7px 7px; color: var(--crm-primary); font-weight: 750; }
.payroll-filter { margin-bottom: 18px; display: flex; align-items: flex-end; gap: 12px; }
.payroll-filter .field { margin: 0; }
.payroll-filter input { min-height: 44px; }
.payroll-calculate { min-width: 148px; min-height: 44px; align-self: flex-end; white-space: nowrap; }
.payroll-notice { margin: -4px 0 18px; padding: 13px 15px; border: 1px solid #f0d39a; border-radius: 10px; background: #fff8e8; color: #74551c; font-size: .84rem; }
.payroll-notice a { margin-left: 4px; color: #986400; font-weight: 800; }
.payroll-list { display: grid; gap: 14px; }
.payroll-card { min-height: auto; }
.payroll-card-head { display: flex; justify-content: space-between; gap: 18px; }
.payroll-card-head a { color: inherit; text-decoration: none; }
.payroll-card-head h2 { margin: 0 0 4px; }
.payroll-card-head p { margin: 0; color: var(--crm-muted); }
.payroll-total { display: grid; gap: 5px; text-align: right; }
.payroll-total span { color: var(--crm-muted); font-size: .78rem; }
.payroll-total strong { color: var(--crm-primary); font-size: 1.25rem; }
.payroll-card details { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--crm-border); }
.payroll-card summary { color: var(--crm-primary); font-weight: 750; cursor: pointer; }
.payroll-breakdown { margin-top: 15px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.payroll-breakdown h3 { margin: 0 0 6px; color: #173154; font-size: .95rem; }
.payroll-breakdown a { color: #2c557f; text-decoration: none; }

.other-service-fields { margin-top: 14px; padding: 14px 14px 0; border: 1px solid #bdd8fb; border-radius: 10px; background: #f7fbff; }
.role-card .compact-heading { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 9px; }
.role-card .table-link { width: fit-content; flex: 0 0 auto; }
.schedule-toolbar strong { min-width: 170px; text-align: center; }
.schedule-table { overflow-x: auto; }
.schedule-table th { min-width: 145px; text-align: center; }
.schedule-table th:first-child { min-width: 180px; text-align: left; }
.schedule-table th small, .schedule-table td:first-child small { margin-top: 4px; display: block; color: var(--crm-muted); text-transform: none; }
.shift-cell { min-width: 125px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 7px; }
.shift-cell > span { font-size: .75rem; font-weight: 750; }
.shift-cell input[type="time"] { grid-column: 1 / -1; width: 100%; padding: 7px 8px; border: 1px solid var(--crm-border); border-radius: 7px; background: white; color: var(--crm-text); font: inherit; font-size: .75rem; }
.shift-cell > small { grid-column: 1 / -1; color: var(--crm-muted); font-size: .67rem; text-align: center; }
.shift-cell-closed { min-height: 88px; align-content: center; color: var(--crm-muted); }
.planner-unavailable { position: absolute; right: 0; left: 0; z-index: 1; display: grid; place-items: center; overflow: hidden; background: repeating-linear-gradient(-45deg, #f0f3f7 0, #f0f3f7 8px, #e8edf3 8px, #e8edf3 16px); color: #8793a4; cursor: not-allowed; pointer-events: none; }
.planner-unavailable span { padding: 5px 8px; border-radius: 6px; background: rgba(255,255,255,.78); font-size: .68rem; font-weight: 750; }

.appointment-create-form { margin-top: 18px; }
.appointment-create-columns { min-height: 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: stretch; gap: 24px; }
.appointment-create-column { min-width: 0; padding: 18px; border: 1px solid var(--crm-border); border-radius: 12px; background: #fff; }
.appointment-work-column, .appointment-client-column { display: flex; flex-direction: column; }
.appointment-work-column { min-height: 720px; overflow: hidden; }
.appointment-work-column .service-choice-field { min-height: 0; margin-bottom: 0; display: flex; flex: 1; flex-direction: column; }
.appointment-create-column .modal-section-title { margin-bottom: 14px; }
.appointment-create-column .modal-section-title h3 { margin: 0 0 4px; color: #173154; }
.appointment-create-column .modal-section-title p { margin: 0; color: var(--crm-muted); font-size: .77rem; }
.appointment-create-form .service-list-window { height: 360px; min-height: 0; display: flex; flex: 1 1 360px; flex-direction: column; overflow: hidden; border: 1px solid var(--crm-border); border-radius: 12px; background: #f8fbff; }
.appointment-create-form .service-card-list { min-height: 0; max-height: none; padding: 10px; overflow-x: hidden; overflow-y: auto; flex: 1; grid-template-columns: 1fr; grid-auto-rows: max-content; align-content: start; scrollbar-gutter: stable; }
.appointment-create-form .service-select-card { overflow: hidden; flex: 0 0 auto; background: #fff; }
.appointment-create-form .service-list-window .other-service-fields { margin: 0; padding: 10px 10px 0; border-top: 1px solid var(--crm-border); background: #fff; }
.appointment-create-form .service-list-window .other-service-fields .field { margin-bottom: 10px; }
.appointment-create-form .service-list-window .service-total { flex: 0 0 auto; border-top: 1px solid var(--crm-border); border-radius: 0; }
.appointment-create-form .service-class-choice.is-hidden { display: none !important; }
.appointment-create-form .assignee-picker { margin-top: 15px; }
.appointment-client-column { min-height: max-content; overflow: visible; }
.appointment-client-column .vehicle-field { align-self: start; width: 100%; }
.appointment-client-column .vehicle-field input,
.appointment-client-column .vehicle-field .custom-select-button { min-height: 44px; height: 44px; }
.appointment-client-column .appointment-comment-field { min-height: 142px; margin-bottom: 0; }
.appointment-client-column .appointment-comment-field textarea { min-height: 112px; resize: vertical; }
.modal-messages { display: grid; gap: 7px; margin: 12px 0; }
.modal-messages .message { margin: 0; }
.calendar-shell .planner-body { border-radius: 0 0 12px 12px; overflow: hidden; }
.calendar-shell .planner-scroll, .calendar-shell .planner { border-radius: 0 0 12px 12px; }
.calendar-shell .planner-body > .time-ruler { border-radius: 0 0 0 12px; overflow: hidden; }
.calendar-shell .planner-body > .planner-column:last-child { border-radius: 0 0 12px 0; overflow: hidden; }
.danger-zone { border-color: #f2c9c9; }
.danger-zone summary { color: #b42318; font-weight: 750; cursor: pointer; }
.appointment-price-box { margin: 20px 0 16px; padding: 18px; display: grid; gap: 5px; border-radius: 12px; background: linear-gradient(135deg, #f2f8ff, #e5f1ff); }
.appointment-price-box span { color: var(--crm-muted); font-size: .78rem; font-weight: 750; }
.appointment-price-box strong { color: var(--crm-primary); font-size: 2rem; line-height: 1.15; }
.appointment-price-box small { color: #58708f; }
.modal-panel:has(.appointment-create-form) { width: min(1180px, 100%); }
.standalone-appointment-card:has(.appointment-create-form) { max-width: 1180px; }

input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.assignee-list { display: grid; gap: 8px; }
.assignee-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 120px; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--crm-border); border-radius: 9px; background: #fff; }
.assignee-row > span { display: grid; gap: 2px; font-weight: 750; }
.assignee-row small { color: var(--crm-muted); font-size: .72rem; font-weight: 500; }
.assignee-row input[type="number"] { width: 100%; padding: 8px; }
.inline-payment-form { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; border: 1px solid var(--crm-border); border-radius: 10px; background: #f8fbff; }
.inline-payment-form .field { margin: 0; }
.inline-payment-form .field:last-of-type, .inline-payment-form .button { grid-column: 1 / -1; }
.payment-list li { align-items: center; }
.payment-list li > span { min-width: 0; flex: 1; }
.payment-list li > form { margin: 0; }
.icon-action { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 8px; background: #f2f5f9; color: #6f7f94; font: inherit; font-size: 1.2rem; cursor: pointer; }
.icon-action:hover { background: #ffeded; color: #b42318; }
.client-metrics { margin-bottom: 20px; }
.copy-link-row { margin: 10px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.copy-link-row input { min-width: 0; padding: 10px 12px; border: 1px solid var(--crm-border); border-radius: 8px; background: #f8fbff; color: var(--crm-muted); }
.trend-bars { display: grid; gap: 8px; }
.trend-row { display: grid; grid-template-columns: 48px minmax(80px, 1fr) 100px; align-items: center; gap: 10px; font-size: .8rem; }
.trend-row > i, .progress-cell > i { height: 9px; overflow: hidden; display: block; border-radius: 999px; background: #eaf1fa; }
.trend-row > i b, .progress-cell > i b { height: 100%; min-width: 2px; display: block; border-radius: inherit; background: var(--crm-primary); }
.trend-row strong { text-align: right; }
.progress-cell { min-width: 150px; display: grid; grid-template-columns: 1fr 44px; align-items: center; gap: 8px; }
.public-feedback-page { min-height: calc(100vh - 66px); padding: 40px 18px; display: grid; place-items: center; background: var(--crm-bg); }
.public-feedback-card { width: min(520px, 100%); padding: 30px; border: 1px solid var(--crm-border); border-radius: 18px; background: white; box-shadow: 0 18px 50px rgba(31, 74, 130, .12); }
.public-feedback-card h1 { margin: 6px 0 8px; color: var(--crm-text); }
.public-feedback-card > p { margin: 0 0 24px; color: var(--crm-muted); }
.public-feedback-card #id_score { display: flex; gap: 8px; }
.public-feedback-card #id_score label { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--crm-border); border-radius: 10px; cursor: pointer; }
.feedback-success { padding: 18px; border-radius: 12px; background: #e3f7f0; color: #215f4d; }
.notification-list { display: grid; gap: 10px; }
.notification-card { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid var(--crm-border); border-left: 4px solid #9aa8bb; border-radius: 11px; background: white; }
.notification-card.unread { box-shadow: 0 7px 20px rgba(35, 92, 167, .07); }
.notification-card.severity-warning { border-left-color: #f3a11a; }
.notification-card.severity-critical { border-left-color: #d84a4a; }
.notification-card h3 { margin: 4px 0; }
.notification-card h3 a { color: var(--crm-text); text-decoration: none; }
.notification-card p { margin: 0; color: var(--crm-muted); }
.nav-badge { min-width: 20px; margin-left: auto; padding: 2px 6px; border-radius: 999px; background: #d84a4a; color: white; font-size: .68rem; text-align: center; }
.standalone-appointment-card { width: 100%; max-height: none; margin: 0; }
.standalone-appointment-card .modal-close { display: none; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal-panel { width: 100%; max-height: 94vh; padding: 20px; border-radius: 18px 18px 0 0; }
  .modal-detail-grid, .analytics-grid, .metric-grid, .permission-field ul { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr; }
  .norm-row { grid-template-columns: 1fr; }
  .assignee-row, .inline-payment-form { grid-template-columns: 1fr; }
  .copy-link-row, .trend-row { grid-template-columns: 1fr; }
  .payroll-filter, .payroll-card-head { align-items: stretch; flex-direction: column; }
  .payroll-calculate { width: 100%; align-self: stretch; }
  .payroll-total { text-align: left; }
  .payroll-breakdown { grid-template-columns: 1fr; }
  .norm-cost { min-height: auto; }
  .icon-remove { width: 100%; }
  .working-hours-row { grid-template-columns: 1fr 1fr; }
  .working-hours-row > strong, .working-hours-row .closed-day { grid-column: 1 / -1; }
  .service-class-price-list > form { grid-template-columns: 1fr auto; }
  .service-class-price-list > form > span { grid-column: 1 / -1; }
  .appointment-create-columns { height: auto; min-height: 0; grid-template-columns: 1fr; }
  .appointment-create-column { padding: 14px; }
  .appointment-work-column { min-height: 0; overflow: visible; }
  .appointment-create-form .service-list-window { height: min(480px, 60vh); flex: none; }
  .appointment-client-column { overflow: visible; }
  .damage-lightbox { padding: 56px 12px 20px; grid-template-columns: 34px minmax(0,1fr) 34px; gap: 6px; }
  .damage-lightbox-nav { width: 34px; }
  .cash-shift-card { padding: 20px; }
  .cash-shift-heading { align-items: flex-start; }
  .cash-current { text-align: left; }
  .cash-close-fields, .cash-collection-form { grid-template-columns: 1fr; }
  .cash-shift-actions { align-items: stretch; flex-direction: column; }
}

/* Daylight Liquid Glass visual theme. This layer changes presentation only. */
.theme-light_blue {
  --crm-primary: var(--crm-custom-primary, #087cff);
  --crm-primary-hover: color-mix(in srgb, var(--crm-primary) 86%, #001b3b);
  --crm-primary-soft: color-mix(in srgb, var(--crm-primary) 13%, transparent);
  --crm-background-color: var(--crm-custom-background, #dcebfa);
  --crm-surface-color: var(--crm-custom-surface, #ffffff);
  --crm-bg: #eaf3ff;
  --crm-panel: rgba(255, 255, 255, .72);
  --crm-panel-strong: rgba(255, 255, 255, .91);
  --crm-panel-solid: #f8fbff;
  --crm-border: rgba(128, 161, 203, .25);
  --crm-border-strong: rgba(104, 145, 198, .36);
  --crm-text: #10294d;
  --crm-muted: #6b7f9e;
  --crm-glass-highlight: rgba(255, 255, 255, .86);
  --crm-glass-shadow: 0 18px 55px rgba(65, 105, 156, .13), inset 0 1px 0 rgba(255, 255, 255, .78);
  --crm-card-shadow: 0 9px 30px rgba(61, 101, 151, .09), inset 0 1px 0 rgba(255, 255, 255, .72);
  --crm-control-shadow: 0 5px 15px rgba(63, 104, 158, .08), inset 0 1px 0 rgba(255, 255, 255, .88);
  --crm-blur: blur(24px) saturate(155%);
  --crm-blur-compact: blur(16px) saturate(145%);
  --crm-radius-xl: 26px;
  --crm-radius-lg: 20px;
  --crm-radius-md: 14px;
  --crm-radius-sm: 11px;
  --crm-sidebar-width: 258px;
}

body.crm-layout {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  background: transparent;
  overflow-x: hidden;
  color: var(--crm-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}

body.crm-layout::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--crm-background-color);
  background-image:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--crm-background-color) 18%, transparent),
      color-mix(in srgb, var(--crm-background-color) 34%, transparent)
    ),
    url("../img/interface-background.png");
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  pointer-events: none;
  transform: translateZ(0);
}

.crm-layout .sidebar {
  inset: 0 auto 14px 14px;
  width: var(--crm-sidebar-width);
  padding: 17px 13px 13px;
  overflow: hidden;
  border: 1px solid var(--crm-glass-highlight);
  border-radius: 0 0 var(--crm-radius-xl) var(--crm-radius-xl);
  background: linear-gradient(
    155deg,
    color-mix(in srgb, var(--crm-surface-color) 66%, transparent),
    color-mix(in srgb, var(--crm-surface-color) 40%, transparent)
  );
  -webkit-backdrop-filter: var(--crm-blur);
  backdrop-filter: var(--crm-blur);
  box-shadow: var(--crm-glass-shadow);
}

.crm-layout .sidebar-brand {
  min-height: 54px;
  padding: 10px 0 4px;
  display: grid;
  gap: 5px;
  color: var(--crm-text);
  letter-spacing: -.02em;
}

.sidebar-brand-visual { min-width: 0; width: 100%; min-height: 43px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--crm-text) !important; }
.sidebar-brand-visual > b { overflow: hidden; color: var(--crm-text); font-size: .94rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-brand-visual > img { width: 100%; aspect-ratio: 3 / 1; display: block; object-fit: cover; object-position: center; border-radius: 10px; background: rgba(255, 255, 255, .42); }
.sidebar-company-name {
  min-height: 1.65em;
  margin-top: 9px;
  padding: 0 2px 3px;
  overflow: hidden;
  color: var(--crm-muted);
  font-size: .69rem;
  font-weight: 620;
  line-height: 1.42;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-layout .sidebar-brand .sidebar-brand-mark {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 13px;
  background: linear-gradient(145deg, #29a0ff, #056cf0 72%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 112, 244, .24), inset 0 1px 1px rgba(255, 255, 255, .45);
  font-size: .84rem;
  font-weight: 820;
  text-shadow: 0 1px 2px rgba(0, 61, 149, .22);
}

.sidebar-brand-copy { min-width: 0; display: grid; gap: 3px; color: var(--crm-text) !important; }
.sidebar-brand-copy b { overflow: hidden; font-size: .96rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-brand-copy small { overflow: hidden; color: var(--crm-muted); font-size: .7rem; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }
.crm-layout .sidebar-tenant { margin: 13px 11px 9px; color: #8798b2; font-size: .63rem; letter-spacing: .09em; text-transform: uppercase; }

.crm-layout .sidebar nav {
  min-height: 0;
  padding: 3px 1px 8px;
  gap: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 134, 170, .22) transparent;
}

.crm-layout .sidebar nav a {
  min-width: 0;
  min-height: 39px;
  padding: 8px 10px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #496381;
  font-size: .82rem;
  font-weight: 590;
  line-height: 1.2;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.crm-layout .sidebar nav a:hover {
  border-color: rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .54);
  color: #185ba8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .88);
  transform: translateX(2px);
}

.crm-layout .sidebar nav a.active {
  border-color: rgba(78, 154, 250, .28);
  background: linear-gradient(135deg, rgba(255, 255, 255, .68), rgba(91, 162, 255, .17));
  color: var(--crm-primary);
  box-shadow: 0 7px 20px rgba(57, 125, 210, .09), inset 0 1px 0 rgba(255, 255, 255, .92);
}

.nav-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  display: grid;
  place-items: center;
  color: currentColor;
}
.nav-icon svg, .sidebar-settings svg, .sidebar-logout svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-badge { min-width: 20px; margin-left: auto; border: 1px solid rgba(255, 255, 255, .8); background: linear-gradient(145deg, #ff625d, #ed3434); box-shadow: 0 4px 10px rgba(225, 52, 55, .2); }

.crm-layout .sidebar-user {
  margin-top: auto;
  padding: 11px 9px 3px;
  gap: 8px;
  border-top: 1px solid rgba(114, 149, 192, .18);
  color: var(--crm-text);
}
.sidebar-user-head { justify-content: flex-start; }
.sidebar-user-avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .76); border-radius: 50%; background: linear-gradient(145deg, #b8cae1, #819ab8); color: white; object-fit: cover; font-size: .78rem; font-weight: 760; box-shadow: 0 5px 13px rgba(56, 93, 138, .16); }
.sidebar-user-head > div { flex: 1; }
.crm-layout .sidebar-user span:not(.sidebar-user-avatar) { color: #284363; font-size: .7rem; }
.crm-layout .sidebar-user small { color: #7b8da7; font-size: .66rem; }
.sidebar-settings { width: 31px; height: 31px; flex-basis: 31px; color: #55708f; }
.sidebar-settings:hover { background: rgba(255, 255, 255, .65); box-shadow: inset 0 1px 0 #fff; }
.sidebar-settings svg { width: 18px; height: 18px; }
.sidebar-logout { width: 100%; padding: 7px 5px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 9px; background: transparent; color: #526b88; font: inherit; font-size: .72rem; cursor: pointer; }
.sidebar-logout:hover { background: rgba(255, 255, 255, .58); color: #155eae; }
.sidebar-logout svg { width: 17px; height: 17px; }

.crm-layout .crm-main {
  min-height: calc(100vh - 14px);
  margin: 0 14px 14px calc(var(--crm-sidebar-width) + 28px);
  overflow: visible;
  border: 1px solid var(--crm-glass-highlight);
  border-radius: 0 0 var(--crm-radius-xl) var(--crm-radius-xl);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--crm-surface-color) 58%, transparent),
    color-mix(in srgb, var(--crm-surface-color) 42%, transparent)
  );
  /* A filtered ancestor changes the containing block of fixed dialogs in Safari. */
  box-shadow: var(--crm-glass-shadow);
}
.crm-layout .crm-content { max-width: 1500px; padding: 27px 27px 58px; }
.crm-layout .page-heading { margin-bottom: 21px; }
.crm-layout .page-heading h1 { margin-bottom: 4px; color: #0a2348; font-size: clamp(2rem, 3vw, 2.65rem); font-weight: 760; line-height: 1.02; letter-spacing: -.045em; }
.crm-layout .page-heading p { color: var(--crm-muted); font-size: .91rem; }
.section-heading h2 { color: #122f56; font-size: 1.15rem; letter-spacing: -.015em; }
.section-heading h3 { color: #17365d; }
.section-heading p, .compact-heading p { color: var(--crm-muted); }

.button, .date-button, .custom-select-button, .icon-action {
  border-color: rgba(111, 149, 197, .27);
  border-radius: var(--crm-radius-sm);
  background: linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(244, 249, 255, .76));
  color: #233f61;
  box-shadow: var(--crm-control-shadow);
  transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.button:hover, .date-button:hover, .icon-action:hover { border-color: rgba(45, 126, 226, .36); background: rgba(255, 255, 255, .98); color: var(--crm-primary); box-shadow: 0 8px 20px rgba(57, 110, 178, .13), inset 0 1px 0 #fff; transform: translateY(-1px); }
.button:active, .date-button:active, .icon-action:active { transform: translateY(0) scale(.985); box-shadow: inset 0 2px 5px rgba(57, 92, 137, .1); }
.button.primary, .button.dark, .primary-button {
  border-color: color-mix(in srgb, var(--crm-primary) 72%, black);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--crm-primary) 72%, white) 0%,
    var(--crm-primary) 54%,
    color-mix(in srgb, var(--crm-primary) 84%, black) 100%
  );
  color: #fff;
  box-shadow: 0 9px 23px color-mix(in srgb, var(--crm-primary) 27%, transparent), inset 0 1px 1px rgba(255, 255, 255, .42);
  text-shadow: 0 1px 1px rgba(0, 62, 145, .18);
}
.button.primary:hover, .button.dark:hover, .primary-button:hover { border-color: var(--crm-primary-hover); background: linear-gradient(145deg, color-mix(in srgb, var(--crm-primary) 68%, white), var(--crm-primary-hover)); color: #fff; box-shadow: 0 11px 26px color-mix(in srgb, var(--crm-primary) 30%, transparent), inset 0 1px 1px rgba(255, 255, 255, .48); }
.button.ghost { background: rgba(255, 255, 255, .38); }
.button.danger { border-color: rgba(210, 65, 72, .26); background: rgba(255, 246, 247, .78); color: #b52e38; }
.large-button { min-height: 46px; padding-inline: 20px; border-radius: 13px; }

.table-card, .info-card, .empty-card, .form-card, .command-bar, .metric-card, .stat-strip, .role-card, .notification-card, .public-feedback-card {
  border-color: var(--crm-glass-highlight);
  border-radius: var(--crm-radius-lg);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--crm-surface-color) 58%, transparent),
    color-mix(in srgb, var(--crm-surface-color) 32%, transparent)
  );
  -webkit-backdrop-filter: var(--crm-blur-compact);
  backdrop-filter: var(--crm-blur-compact);
  box-shadow: var(--crm-card-shadow);
}
.table-card { border: 1px solid var(--crm-glass-highlight); }
table { color: #183454; }
th { color: #71849f; font-size: .68rem; font-weight: 720; letter-spacing: .08em; }
th, td { border-bottom-color: rgba(124, 154, 192, .16); }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: rgba(235, 245, 255, .52); }
.embedded-table { border-color: rgba(118, 153, 197, .17); background: rgba(255, 255, 255, .2); box-shadow: none; }
.metric-card { min-height: 128px; }
.metric-card.accent { border-color: rgba(87, 158, 247, .28); background: linear-gradient(145deg, rgba(255, 255, 255, .62), rgba(211, 233, 255, .39)); }
.stat-strip { border-color: rgba(255, 255, 255, .9); }
.message { border-color: rgba(71, 177, 124, .24); border-radius: var(--crm-radius-md); background: rgba(232, 251, 242, .78); box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.message.error { border-color: rgba(203, 64, 64, .25); background: rgba(255, 235, 235, .86); color: #ae2525; }
.message.warning { border-color: rgba(207, 151, 38, .26); background: rgba(255, 247, 220, .88); color: #845600; }
.payroll-notice { border-color: rgba(229, 173, 60, .24); border-radius: var(--crm-radius-md); background: rgba(255, 248, 225, .78); }

.field input:not([type="checkbox"]), .field textarea, .field select, #client-search, .search, .copy-link-row input, .service-class-price-list input, .assignee-row input[type="number"] {
  border-color: rgba(109, 145, 190, .31);
  border-radius: 12px;
  background: rgba(255, 255, 255, .9);
  color: var(--crm-text);
  box-shadow: inset 0 1px 2px rgba(38, 72, 111, .035), 0 1px 0 rgba(255, 255, 255, .82);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field input:not([type="checkbox"]):hover, .field textarea:hover, .field select:hover, #client-search:hover, .search:hover { border-color: rgba(64, 129, 214, .42); }
.field input:not([type="checkbox"]):focus, .field textarea:focus, .field select:focus, #client-search:focus, .search:focus, .custom-select.open .custom-select-button {
  outline: 0;
  border-color: color-mix(in srgb, var(--crm-primary) 68%, transparent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--crm-primary-soft), inset 0 1px 1px rgba(44, 82, 127, .03);
}
.field input:disabled, .field textarea:disabled, .field select:disabled, .custom-select-button:disabled { border-color: rgba(135, 158, 187, .18); background: rgba(234, 240, 247, .8); color: #8998ad; box-shadow: none; }
.field label { color: #244363; font-weight: 690; }
.help-text, .muted { color: var(--crm-muted); }
input[type="checkbox"] { accent-color: var(--crm-primary); }

.custom-select-menu, .client-suggestions, .date-popover, .damage-popover, .damage-create-popover, .assignee-picker-panel {
  border-color: rgba(255, 255, 255, .88);
  border-radius: var(--crm-radius-md);
  background: rgba(250, 253, 255, .88);
  -webkit-backdrop-filter: var(--crm-blur-compact);
  backdrop-filter: var(--crm-blur-compact);
  box-shadow: 0 20px 50px rgba(45, 84, 133, .18), inset 0 1px 0 rgba(255,255,255,.9);
}
.custom-select-option, .client-suggestions button { border-radius: 10px; background: transparent; }
.custom-select-option:hover, .custom-select-option[aria-selected="true"], .client-suggestions button:hover { background: var(--crm-primary-soft); color: var(--crm-primary); }

.calendar-shell {
  border-color: rgba(255, 255, 255, .9);
  border-radius: 22px;
  background: rgba(255, 255, 255, .24);
  -webkit-backdrop-filter: var(--crm-blur-compact);
  backdrop-filter: var(--crm-blur-compact);
  box-shadow: 0 8px 24px rgba(57, 99, 152, .08), inset 0 1px 0 rgba(255,255,255,.94);
}
.calendar-shell .calendar-toolbar { min-height: 68px; padding: 11px 12px; gap: 9px; border-bottom-color: rgba(114, 151, 198, .19); background: linear-gradient(135deg, rgba(255, 255, 255, .31), rgba(228, 238, 248, .16)); }
.calendar-shell .calendar-toolbar .button, .date-button { min-height: 42px; }
.date-button { min-width: 220px; }
.date-button span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; background: var(--crm-primary-soft); }
.date-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.planner { background: rgba(252, 254, 255, .3); }
.planner-header { border-bottom-color: rgba(111, 148, 193, .2); background: rgba(248, 252, 255, .31); }
.planner-corner, .planner-employee-head { min-height: 78px; }
.planner-employee-head { align-items: center; border-left-color: rgba(111, 148, 193, .2); text-align: center; }
.planner-employee-head > div { justify-items: center; }
.planner-employee-head strong { color: #142f52; font-size: .86rem; }
.planner-employee-head div span { color: #7586a0; font-size: .69rem; }
.employee-avatar { width: 38px; height: 38px; flex-basis: 38px; border: 1px solid rgba(255,255,255,.76); border-radius: 50%; object-fit: cover; box-shadow: 0 5px 14px rgba(60, 96, 143, .14), inset 0 1px 0 rgba(255,255,255,.5); }
.employee-avatar.color-blue, .employee-color.color-blue { background: linear-gradient(145deg, #83baff, #3f8df1); }
.employee-avatar.color-purple, .employee-color.color-purple { background: linear-gradient(145deg, #c7a8ff, #8d68e9); }
.employee-avatar.color-orange, .employee-color.color-orange { background: linear-gradient(145deg, #ffc87a, #ee961a); }
.employee-avatar.color-green, .employee-color.color-green { background: linear-gradient(145deg, #8ce6c4, #36b889); }
.employee-avatar.color-gray, .employee-color.color-gray { background: linear-gradient(145deg, #c6d1e0, #8c9db5); }
.time-ruler { background: rgba(247, 251, 255, .29); }
.time-ruler span { background: rgba(247, 251, 255, .24); color: #73849d; }
.planner-column { border-left-color: rgba(111, 148, 193, .2); background: rgba(253, 254, 255, .27); }
.planner-line { border-color: rgba(120, 155, 197, .14); }
.planner-line.hour-line { border-color: rgba(97, 137, 187, .23); }
.planner-unavailable { background: repeating-linear-gradient(-45deg, rgba(231, 237, 245, .85) 0, rgba(231, 237, 245, .85) 8px, rgba(222, 230, 240, .83) 8px, rgba(222, 230, 240, .83) 16px); color: #78889f; }
.planner-unavailable span { background: rgba(255, 255, 255, .78); box-shadow: 0 2px 7px rgba(69,99,137,.08); }
.slot-hover { border-color: color-mix(in srgb, var(--crm-primary) 52%, transparent); border-radius: 11px; background: color-mix(in srgb, var(--crm-primary) 7%, transparent); box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); }
.current-time-line { background: linear-gradient(90deg, #ff5151, #ff6b64); box-shadow: 0 1px 5px rgba(225, 49, 49, .18); }
.current-time-line::before { background: #ff5151; box-shadow: 0 0 0 3px rgba(255,255,255,.92), 0 2px 7px rgba(215,48,48,.25); }

.booking-card {
  padding: 8px 10px;
  border-width: 1px 1px 1px 4px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(224, 240, 255, .96), rgba(200, 226, 255, .85));
  box-shadow: 0 7px 17px rgba(42, 91, 150, .1), inset 0 1px 0 rgba(255,255,255,.68);
  transition: filter .18s ease, box-shadow .18s ease, transform .18s ease, outline-color .18s ease;
}
.booking-card:hover { z-index: 6; outline: 1px solid rgba(39, 121, 225, .24); filter: saturate(1.04) brightness(1.015); box-shadow: 0 11px 24px rgba(40, 86, 144, .15), inset 0 1px 0 rgba(255,255,255,.78); transform: translateY(-1px); }
.booking-card.color-purple { background: linear-gradient(145deg, rgba(241, 233, 255, .96), rgba(222, 207, 255, .88)); }
.booking-card.color-orange { background: linear-gradient(145deg, rgba(255, 246, 220, .97), rgba(255, 226, 172, .87)); }
.booking-card.color-green { background: linear-gradient(145deg, rgba(225, 249, 240, .97), rgba(190, 239, 221, .88)); }
.booking-card.color-gray, .status-card-no_show { background: linear-gradient(145deg, rgba(239, 244, 250, .97), rgba(218, 226, 237, .9)) !important; }
.booking-status, .booking-payment, .status-pill { border: 1px solid rgba(255,255,255,.65); border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255,255,255,.62); }
.booking-status { background: rgba(255,255,255,.55); }
.booking-payment { background: rgba(255,255,255,.67); }

.modal-backdrop { background: rgba(17, 39, 71, .28); -webkit-backdrop-filter: blur(10px) saturate(120%); backdrop-filter: blur(10px) saturate(120%); }
.modal-panel {
  border-color: rgba(255, 255, 255, .92);
  border-radius: 23px;
  background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(241,248,255,.89));
  -webkit-backdrop-filter: var(--crm-blur);
  backdrop-filter: var(--crm-blur);
  box-shadow: 0 30px 90px rgba(21, 52, 91, .24), inset 0 1px 0 #fff;
}
.modal-head { padding-bottom: 15px; border-bottom-color: rgba(114, 151, 198, .18); }
.modal-head h2 { color: #0e2b51; letter-spacing: -.025em; }
.modal-close { border-radius: 12px; background: rgba(255,255,255,.5); color: #617590; }
.modal-close:hover { background: rgba(228, 240, 255, .85); color: var(--crm-primary); }
.modal-section { border-top-color: rgba(112, 148, 192, .17); }
.modal-detail-grid > div, .appointment-create-column, .service-list-window, .inline-payment-form, .assignee-row, .salary-split-panel, .cash-collection-panel {
  border-color: rgba(110, 149, 197, .2);
  background: rgba(255, 255, 255, .58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}
.appointment-create-column { border-radius: 17px; }
.appointment-price-box { border: 1px solid rgba(102, 158, 226, .18); border-radius: 16px; background: linear-gradient(145deg, rgba(245,250,255,.94), rgba(221,238,255,.82)); box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.service-select-card { border-color: rgba(112, 150, 197, .22); border-radius: 13px; background: rgba(255,255,255,.82); }
.service-select-card:hover { border-color: rgba(55, 135, 235, .38); background: rgba(248,252,255,.96); box-shadow: 0 7px 16px rgba(63,104,155,.07); }
.service-select-card:has(input:checked) { border-color: rgba(8,124,255,.54); background: rgba(226, 241, 255, .78); box-shadow: 0 0 0 3px rgba(8,124,255,.07); }
.service-check { border-color: rgba(108,145,190,.32); border-radius: 7px; }
.service-select-card input:checked + .service-check { background: linear-gradient(145deg, color-mix(in srgb, var(--crm-primary) 70%, white), var(--crm-primary)); }

.notification-card { border-left-width: 3px; }
.notification-card.unread { background: linear-gradient(145deg, rgba(255,255,255,.9), rgba(232,243,255,.75)); }
.damage-section, .vehicle-map { border-color: rgba(255,255,255,.86); }
.vehicle-map { overflow: visible; background: rgba(255,255,255,.77); box-shadow: var(--crm-card-shadow); }
.cash-shift-card { background: linear-gradient(145deg, rgba(255,255,255,.87), rgba(239,247,255,.68)); }
.public-feedback-page { background: transparent; }
.public-feedback-card { border-radius: 24px; }

.auth-card {
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 24px;
  background: rgba(255,255,255,.75);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
  backdrop-filter: blur(24px) saturate(155%);
  box-shadow: var(--crm-glass-shadow);
}

.button:focus-visible,
.crm-layout .sidebar nav a:focus-visible,
.sidebar-settings:focus-visible,
.sidebar-logout:focus-visible,
.date-button:focus-visible,
.custom-select-button:focus-visible,
.modal-close:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--crm-primary) 25%, transparent);
  outline-offset: 2px;
}

/* Consistent Safari geometry and restrained motion for transient surfaces. */
.theme-light_blue { --crm-ease-out: cubic-bezier(.22, 1, .36, 1); --crm-ease: cubic-bezier(.2, .7, .3, 1); }
.crm-layout .crm-content { min-width: 0; padding-bottom: 32px; }
.crm-layout .crm-content:has(> .planner-page-heading) { padding-bottom: 27px; }
.page-heading > div { min-width: 0; }
.heading-actions { flex-wrap: wrap; justify-content: flex-end; }
.heading-actions .button { white-space: nowrap; }
.button { justify-content: center; }
.date-button { font: inherit; font-size: .86rem; font-weight: 650; }
.calendar-toolbar .icon-button { flex: 0 0 42px; position: relative; font-size: 0; }
.calendar-toolbar .icon-button::before { content: ""; width: 9px; height: 9px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: translateX(-2px) rotate(45deg); }
.calendar-toolbar .icon-button[aria-label^="Предыдущ"]::before,
.calendar-toolbar .icon-button[aria-label^="Previous"]::before { transform: translateX(2px) rotate(-135deg); }
.calendar-shell .calendar-toolbar { border-radius: 21px 21px 0 0; }
.calendar-shell .planner-scroll, .calendar-shell .planner, .calendar-shell .planner-body { border-radius: 0 0 21px 21px; }
.calendar-shell .planner { overflow: hidden; }
.calendar-shell .planner-body > .time-ruler { border-bottom-left-radius: 21px; }
.calendar-shell .planner-body > .planner-column:last-child { border-bottom-right-radius: 21px; }
.custom-select { min-width: 0; }
.custom-select.open { z-index: 130; }
.custom-select-button { position: relative; }
.custom-select-button::after { content: ""; width: 7px; height: 7px; top: 50%; right: 16px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: translateY(-70%) rotate(45deg); transition: transform .22s var(--crm-ease); }
.custom-select.open .custom-select-button::after { transform: translateY(-30%) rotate(225deg); }
.custom-select-menu { max-height: min(260px, 45vh); overscroll-behavior: contain; background: #fbfdff; }
.custom-select.opens-up .custom-select-menu { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }
.client-suggestions { margin-top: 0; }
.assignee-picker-button { min-height: 44px; border-radius: 12px; background: rgba(255,255,255,.9); box-shadow: var(--crm-control-shadow); }
.text-action { padding: 6px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--crm-primary); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.text-action:hover { background: var(--crm-primary-soft); }
.service-select-card:has(.custom-select.open) { overflow: visible; z-index: 130; }
.modal-backdrop { padding: 24px; height: 100dvh; background: rgba(22, 40, 65, .23); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.modal-panel { max-height: calc(100dvh - 48px); overscroll-behavior: contain; background: #f9fcff; -webkit-backdrop-filter: none; backdrop-filter: none; }
.modal-backdrop > .modal-panel { margin: 0; }
.modal-close, .damage-popover-close, .damage-lightbox-close { position: relative; padding: 0; display: grid; place-items: center; font-size: 0; }
.damage-popover-close, .damage-lightbox-close { position: absolute; }
.modal-close::before, .modal-close::after, .damage-popover-close::before, .damage-popover-close::after, .damage-lightbox-close::before, .damage-lightbox-close::after { content: ""; position: absolute; width: 15px; height: 2px; background: currentColor; border-radius: 2px; transform: rotate(45deg); }
.modal-close::after, .damage-popover-close::after, .damage-lightbox-close::after { transform: rotate(-45deg); }
.modal-status-line { flex-wrap: wrap; }
.modal-head > div { min-width: 0; }
.modal-head p { overflow-wrap: anywhere; }
.modal-actions .button { white-space: normal; }
.appointment-create-column { height: auto; }
.appointment-create-form .form-actions { clear: both; }
.payroll-filter .payroll-calculate { height: 44px; align-self: end; }
.cash-close-fields .field > input, .cash-close-fields .field > textarea { margin: 0; min-height: 45px; }
.cash-shift-actions { flex-wrap: wrap; }
.damage-actions { flex-wrap: wrap; }
.damage-popover, .damage-create-popover { overflow-y: auto; overscroll-behavior: contain; }
.damage-popover { opacity: 1; transition: opacity .15s ease, translate .15s ease; }
.damage-popover.is-fading { opacity: 0; translate: 0 -3px; pointer-events: none; }
.field input[type="file"] { padding: 8px; font-size: .76rem; }
.field input[type="file"]::file-selector-button { margin-right: 8px; padding: 7px 10px; border: 0; border-radius: 7px; background: var(--crm-primary-soft, #eaf3ff); color: var(--crm-primary, #087cff); font: inherit; cursor: pointer; }
.damage-lightbox img { max-height: calc(100dvh - 96px); }
.text-button { text-decoration: none; }
.inline-stock-form input { min-width: 0; }
.field { min-width: 0; align-content: start; }
.field input:not([type="checkbox"]):not([type="hidden"]):not([type="file"]) { min-height: 44px; }
.service-rate-field input { width: 100%; padding: 9px 10px; border: 1px solid var(--crm-border); border-radius: 10px; background: #fff; color: var(--crm-text); font: inherit; }
.service-rate-field input:disabled { background: #eef3f9; color: var(--crm-muted); }
.service-rate-field input:focus { outline: 3px solid rgba(8,124,255,.12); border-color: var(--crm-primary); }
.permission-field > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.permission-field > div > div label { min-height: 46px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--crm-border); border-radius: 10px; background: #fbfdff; cursor: pointer; }
.permission-field input[type="checkbox"] { flex: 0 0 auto; }
.schedule-table table { min-width: 900px; table-layout: fixed; }
.schedule-table th, .schedule-table td { min-width: 0; padding: 14px 10px; }
.schedule-table th:first-child { min-width: 0; width: 150px; }
.schedule-table .shift-cell { min-width: 0; }
.section-heading > .button, .modal-section-title > .button { flex: 0 0 auto; white-space: nowrap; }
.modal-section-title > div { min-width: 0; }
.service-class-price-list { padding: 18px 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px 24px; }
.service-class-price-list > form { grid-template-columns: minmax(0, 1fr) 110px auto; }
.service-summary-row td:nth-child(2) { white-space: nowrap; }
.inventory-summary + .table-card td:nth-child(3), .inventory-summary + .table-card td:nth-child(4), .inventory-summary + .table-card td:nth-child(6), .inventory-summary + .table-card td:nth-child(7) { white-space: nowrap; }
.table-card a:not(.button) { color: #286ac3; text-decoration: none; }
.table-card a:not(.button):hover { text-decoration: underline; }
.analytics-trend, .profile-placeholder + .working-hours-form { margin-top: 18px; }
.analytics-grid > .embedded-table > .compact-heading {
  margin: 0 0 15px;
  padding: 20px 20px 0;
}
.analytics-grid > .embedded-table > .compact-heading h2 {
  line-height: 1.24;
}
.metric-card > span, .metric-card-head { min-height: 24px; display: flex; align-items: center; }
.payroll-filter ~ .stat-strip { grid-template-columns: minmax(210px, 1fr) 1fr 1fr; }
.public-feedback-card #id_score { flex-wrap: wrap; }
.public-feedback-card #id_score label { position: relative; transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
.public-feedback-card #id_score input[type="radio"] { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; opacity: 0; }
.public-feedback-card #id_score label:has(input:checked) { border-color: var(--crm-primary); background: var(--crm-primary); color: #fff; }
.public-feedback-card #id_score label:has(input:focus-visible) { outline: 3px solid rgba(8,124,255,.25); outline-offset: 3px; }

.settings-tabs { width: fit-content; margin: -4px 0 20px; padding: 4px; display: flex; flex-wrap: wrap; gap: 4px; border: 1px solid rgba(255, 255, 255, .86); border-radius: 14px; background: rgba(239, 247, 255, .72); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9); }
.settings-tabs a { min-height: 40px; padding: 9px 14px; display: inline-flex; align-items: center; border-radius: 10px; color: #54708f; font-size: .8rem; font-weight: 700; text-decoration: none; transition: background-color .18s ease, color .18s ease, box-shadow .18s ease; }
.settings-tabs a:hover { color: var(--crm-primary); }
.settings-tabs a.active { background: rgba(255, 255, 255, .9); color: var(--crm-primary); box-shadow: 0 5px 14px rgba(54, 102, 159, .1), inset 0 1px 0 #fff; }
.settings-layout { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); align-items: start; gap: 18px; }
.settings-card { margin-top: 0; }
.settings-card + .settings-card { margin-top: 18px; }
.settings-layout .settings-card + .settings-card { margin-top: 0; }
.settings-card .section-heading { margin-bottom: 18px; }
.profile-editor { margin-bottom: 18px; padding-bottom: 18px; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 18px; border-bottom: 1px solid rgba(111, 148, 193, .18); }
.profile-photo-preview { width: 88px; height: 88px; display: grid; place-items: center; overflow: hidden; border: 3px solid rgba(255, 255, 255, .9); border-radius: 50%; background: linear-gradient(145deg, #8fc6ff, #2384f5); color: white; font-size: 2rem; font-weight: 800; box-shadow: 0 9px 24px rgba(42, 113, 198, .19); }
.profile-photo-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.profile-photo-fields .field { margin-bottom: 8px; }
.check-field { display: inline-flex; align-items: center; gap: 8px; color: #58708d; font-size: .78rem; cursor: pointer; }
.check-field input { margin: 0; }
.settings-form-grid { align-items: start; }
.settings-form-grid .field:last-child { grid-column: 1 / -1; }
.error-text { margin-top: 6px; display: block; color: #c63737; font-size: .74rem; line-height: 1.35; }
.password-help { line-height: 1.45; }
.password-help ul { margin: 7px 0 0; padding-left: 18px; }
.company-settings-form { max-width: 1040px; }
.company-brand-editor { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(0, 1fr); align-items: start; gap: 26px; }
.company-logo-preview { padding: 10px; display: grid; justify-items: center; gap: 9px; border: 1px solid rgba(111, 148, 193, .22); border-radius: 16px; background: rgba(245, 250, 255, .82); }
.company-logo-preview img, .company-logo-preview > span { width: 100%; aspect-ratio: 3 / 1; display: grid; place-items: center; object-fit: cover; object-position: center; border-radius: 10px; background: linear-gradient(145deg, #fafdff, #e9f4ff); color: #176fcf; font-size: 1.05rem; font-weight: 820; }
.company-logo-preview strong { max-width: 100%; overflow: hidden; color: #314f71; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.company-interface-settings { margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(111, 148, 193, .18); }
.company-interface-settings .section-heading { margin-bottom: 12px; }
.company-interface-settings h3 { margin: 0 0 4px; }
.interface-settings-form { max-width: 1040px; }
.interface-choice-grid { margin-bottom: 24px; }
.interface-colors-heading { padding-top: 20px; border-top: 1px solid rgba(111, 148, 193, .18); }
.interface-color-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.interface-color-field { min-width: 0; padding: 14px; display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 5px 12px; border: 1px solid rgba(111, 148, 193, .2); border-radius: 13px; background: color-mix(in srgb, var(--crm-surface-color) 38%, transparent); }
.interface-color-field > span { grid-column: 1 / -1; color: #244363; font-size: .78rem; font-weight: 700; }
.interface-color-field input[type="color"] { width: 52px; height: 44px; padding: 3px; border: 1px solid rgba(109, 145, 190, .31); border-radius: 10px; background: rgba(255,255,255,.72); cursor: pointer; }
.interface-color-field small { overflow: hidden; color: var(--crm-muted); font-size: .76rem; text-overflow: ellipsis; }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .company-brand-editor { grid-template-columns: 1fr; }
  .company-logo-preview { max-width: 360px; }
  .interface-color-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .profile-editor { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .profile-photo-fields { width: 100%; text-align: left; }
  .settings-tabs { width: 100%; }
  .settings-tabs a { flex: 1; justify-content: center; text-align: center; }
}

@keyframes crm-surface-enter { from { translate: 0 -6px; scale: .985; } to { translate: 0 0; scale: 1; } }
@keyframes crm-dialog-enter { from { translate: 0 16px; scale: .98; } to { translate: 0 0; scale: 1; } }
.custom-select-menu:not([hidden]), .date-popover:not([hidden]), .client-suggestions:not([hidden]), .assignee-picker-panel:not([hidden]), .damage-popover:not([hidden]), .damage-create-popover:not([hidden]) { transform-origin: top center; animation: crm-surface-enter .24s var(--crm-ease-out); }
.modal-backdrop:not([hidden]) > .modal-panel { animation: crm-dialog-enter .32s var(--crm-ease-out); }
.damage-lightbox:not([hidden]) img { animation: crm-surface-enter .24s var(--crm-ease-out); }
.salary-split-panel:not([hidden]), .cash-collection-panel:not([hidden]), details[open] > :not(summary), .service-class-choice:not(.is-hidden) { animation: crm-surface-enter .25s var(--crm-ease-out); }
.custom-select-option, .assignee-check-row, .date-day, .modal-close, .text-button { transition: background-color .18s ease, color .18s ease, box-shadow .18s ease; }

/* Dark Liquid Glass theme. Layout and component geometry stay identical. */
.theme-dark {
  color-scheme: dark;
  --crm-primary: color-mix(in srgb, var(--crm-custom-primary, #5a9cff) 82%, #8fc1ff);
  --crm-primary-hover: color-mix(in srgb, var(--crm-primary) 82%, white);
  --crm-primary-soft: color-mix(in srgb, var(--crm-primary) 18%, transparent);
  --crm-background-color: color-mix(in srgb, var(--crm-custom-background, #dcebfa) 12%, #07101d);
  --crm-surface-color: color-mix(in srgb, var(--crm-custom-surface, #ffffff) 10%, #121b29);
  --crm-bg: #07101d;
  --crm-panel: rgba(18, 28, 42, .82);
  --crm-panel-strong: rgba(22, 33, 49, .94);
  --crm-panel-solid: #151f2e;
  --crm-border: rgba(155, 184, 220, .18);
  --crm-border-strong: rgba(160, 194, 235, .29);
  --crm-text: #edf5ff;
  --crm-muted: #9baec7;
  --crm-glass-highlight: rgba(191, 216, 247, .16);
  --crm-glass-shadow: 0 20px 60px rgba(0, 4, 12, .42), inset 0 1px 0 rgba(255, 255, 255, .09);
  --crm-card-shadow: 0 10px 32px rgba(0, 4, 12, .28), inset 0 1px 0 rgba(255, 255, 255, .07);
  --crm-control-shadow: 0 6px 18px rgba(0, 3, 10, .25), inset 0 1px 0 rgba(255, 255, 255, .07);
  --crm-blur: blur(24px) saturate(135%);
  --crm-blur-compact: blur(16px) saturate(125%);
  --crm-radius-xl: 26px;
  --crm-radius-lg: 20px;
  --crm-radius-md: 14px;
  --crm-radius-sm: 11px;
  --crm-sidebar-width: 258px;
  --crm-ease-out: cubic-bezier(.22, 1, .36, 1);
  --crm-ease: cubic-bezier(.2, .7, .3, 1);
}

body.theme-dark::before {
  background-image:
    linear-gradient(135deg, rgba(4, 10, 20, .76), rgba(10, 19, 32, .86)),
    url("../img/interface-background.png");
  filter: saturate(.68) brightness(.62);
}

.theme-dark .sidebar,
.theme-dark .crm-main {
  background: linear-gradient(145deg, rgba(22, 33, 49, .9), rgba(11, 19, 31, .82));
}
.theme-dark .crm-main { background: linear-gradient(145deg, rgba(19, 29, 44, .92), rgba(11, 19, 31, .86)); }
.theme-dark .sidebar-brand-visual,
.theme-dark .sidebar-brand-visual > b,
.theme-dark .sidebar-user,
.theme-dark .sidebar-user span:not(.sidebar-user-avatar),
.theme-dark .page-heading h1,
.theme-dark .section-heading h2,
.theme-dark .section-heading h3,
.theme-dark .modal-head h2,
.theme-dark .planner-employee-head strong,
.theme-dark table,
.theme-dark .field label,
.theme-dark .interface-color-field > span { color: var(--crm-text); }
.theme-dark .modal-section h3,
.theme-dark .modal-section-title h3,
.theme-dark .service-norm-section h2,
.theme-dark .norm-cost strong,
.theme-dark .stat-strip strong,
.theme-dark .metric-card strong,
.theme-dark .payroll-breakdown h3 { color: var(--crm-text); }
.theme-dark .sidebar-tenant,
.theme-dark .sidebar-user small,
.theme-dark .sidebar-company-name,
.theme-dark .help-text,
.theme-dark .muted,
.theme-dark th,
.theme-dark .planner-employee-head div span,
.theme-dark .time-ruler span { color: var(--crm-muted); }
.theme-dark .sidebar nav a,
.theme-dark .sidebar-settings,
.theme-dark .sidebar-logout { color: #b2c2d7; }
.theme-dark .sidebar nav a:hover,
.theme-dark .sidebar-settings:hover,
.theme-dark .sidebar-logout:hover { background: rgba(117, 161, 215, .12); color: #e9f3ff; }
.theme-dark .sidebar nav a.active { border-color: color-mix(in srgb, var(--crm-primary) 34%, transparent); background: linear-gradient(135deg, rgba(100, 158, 225, .18), rgba(47, 87, 138, .12)); color: var(--crm-primary); box-shadow: inset 0 1px 0 rgba(255,255,255,.09); }

.theme-dark .table-card,
.theme-dark .info-card,
.theme-dark .empty-card,
.theme-dark .form-card,
.theme-dark .command-bar,
.theme-dark .metric-card,
.theme-dark .stat-strip,
.theme-dark .role-card,
.theme-dark .notification-card,
.theme-dark .public-feedback-card,
.theme-dark .cash-shift-card {
  border-color: var(--crm-glass-highlight);
  background: linear-gradient(145deg, rgba(25, 37, 55, .88), rgba(16, 26, 41, .76));
}
.theme-dark .embedded-table,
.theme-dark .modal-detail-grid > div,
.theme-dark .appointment-create-column,
.theme-dark .service-list-window,
.theme-dark .inline-payment-form,
.theme-dark .assignee-row,
.theme-dark .salary-split-panel,
.theme-dark .cash-collection-panel { border-color: var(--crm-border); background: rgba(26, 39, 58, .76); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.theme-dark tbody tr:hover { background: rgba(108, 153, 211, .1); }
.theme-dark th,
.theme-dark td { border-bottom-color: rgba(149, 181, 220, .12); }
.theme-dark .table-card a:not(.button) { color: var(--crm-primary); }

.theme-dark .button,
.theme-dark .date-button,
.theme-dark .custom-select-button,
.theme-dark .icon-action,
.theme-dark .assignee-picker-button {
  border-color: rgba(151, 183, 222, .2);
  background: linear-gradient(145deg, rgba(39, 54, 75, .96), rgba(23, 35, 52, .9));
  color: #e9f3ff;
  box-shadow: var(--crm-control-shadow);
}
.theme-dark .button:hover,
.theme-dark .date-button:hover,
.theme-dark .icon-action:hover { border-color: color-mix(in srgb, var(--crm-primary) 48%, transparent); background: rgba(48, 67, 92, .98); color: var(--crm-primary); }
.theme-dark .button.ghost { background: rgba(35, 49, 69, .7); }
.theme-dark .button.danger { border-color: rgba(238, 104, 112, .28); background: rgba(104, 35, 45, .43); color: #ffabb2; }

.theme-dark .field input:not([type="checkbox"]),
.theme-dark .field textarea,
.theme-dark .field select,
.theme-dark #client-search,
.theme-dark .search,
.theme-dark .copy-link-row input,
.theme-dark .service-class-price-list input,
.theme-dark .assignee-row input[type="number"],
.theme-dark .service-rate-field input {
  border-color: rgba(145, 177, 216, .22);
  background: rgba(13, 23, 36, .84);
  color: var(--crm-text);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.25), 0 1px 0 rgba(255,255,255,.035);
}
.theme-dark .field input:not([type="checkbox"]):focus,
.theme-dark .field textarea:focus,
.theme-dark .field select:focus,
.theme-dark #client-search:focus,
.theme-dark .search:focus,
.theme-dark .custom-select.open .custom-select-button { background: #101c2b; }
.theme-dark .field input:disabled,
.theme-dark .field textarea:disabled,
.theme-dark .field select:disabled,
.theme-dark .custom-select-button:disabled,
.theme-dark .service-rate-field input:disabled { background: rgba(28, 39, 54, .72); color: #71839c; }
.theme-dark input::placeholder,
.theme-dark textarea::placeholder { color: #6f829c; }

.theme-dark .custom-select-menu,
.theme-dark .client-suggestions,
.theme-dark .date-popover,
.theme-dark .damage-popover,
.theme-dark .damage-create-popover,
.theme-dark .assignee-picker-panel,
.theme-dark .modal-panel { border-color: rgba(174, 203, 238, .18); background: #141f2e; color: var(--crm-text); box-shadow: 0 24px 65px rgba(0, 3, 10, .5), inset 0 1px 0 rgba(255,255,255,.06); }
.theme-dark .custom-select-option,
.theme-dark .client-suggestions button { color: var(--crm-text); }
.theme-dark .modal-backdrop { background: rgba(0, 5, 14, .55); }
.theme-dark .modal-close { background: rgba(77, 100, 130, .17); color: #aebfd5; }
.theme-dark .modal-section { border-top-color: var(--crm-border); }

.theme-dark .calendar-shell { border-color: var(--crm-glass-highlight); background: rgba(15, 25, 39, .83); }
.theme-dark .calendar-shell .calendar-toolbar { border-bottom-color: var(--crm-border); background: linear-gradient(135deg, rgba(34, 49, 69, .82), rgba(20, 32, 48, .7)); }
.theme-dark .planner,
.theme-dark .planner-header,
.theme-dark .time-ruler,
.theme-dark .time-ruler span,
.theme-dark .planner-column { background: rgba(13, 23, 36, .76); }
.theme-dark .planner-header,
.theme-dark .planner-employee-head,
.theme-dark .planner-column { border-color: var(--crm-border); }
.theme-dark .planner-line { border-color: rgba(145, 177, 216, .1); }
.theme-dark .planner-line.hour-line { border-color: rgba(145, 177, 216, .18); }
.theme-dark .planner-unavailable { background: repeating-linear-gradient(-45deg, rgba(31, 43, 59, .9) 0, rgba(31, 43, 59, .9) 8px, rgba(25, 36, 51, .9) 8px, rgba(25, 36, 51, .9) 16px); color: #8294ac; }
.theme-dark .planner-unavailable span { background: rgba(19, 29, 43, .9); }
.theme-dark .booking-card { color: #14283e; }

.theme-dark .appointment-price-box { border-color: rgba(107, 157, 219, .24); background: linear-gradient(145deg, rgba(32,48,70,.95), rgba(20,38,60,.92)); }
.theme-dark .service-select-card,
.theme-dark .permission-field > div > div label { border-color: var(--crm-border); background: rgba(22, 34, 51, .88); color: var(--crm-text); }
.theme-dark .service-select-card:hover { border-color: color-mix(in srgb, var(--crm-primary) 45%, transparent); background: rgba(31, 46, 67, .96); }
.theme-dark .notification-card.unread,
.theme-dark .metric-card.accent { background: linear-gradient(145deg, rgba(37, 56, 80, .94), rgba(23, 42, 65, .84)); }
.theme-dark .vehicle-map { border-color: var(--crm-border); background: rgba(240, 246, 252, .9); }
.theme-dark .settings-tabs { border-color: var(--crm-border); background: rgba(18, 29, 44, .82); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.theme-dark .settings-tabs a { color: #9fb2ca; }
.theme-dark .settings-tabs a.active { background: rgba(70, 94, 124, .3); color: var(--crm-primary); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.theme-dark .profile-editor,
.theme-dark .interface-colors-heading { border-color: var(--crm-border); }
.theme-dark .company-logo-preview,
.theme-dark .interface-color-field { border-color: var(--crm-border); background: rgba(19, 30, 45, .75); }
.theme-dark .company-logo-preview strong,
.theme-dark .check-field { color: #c4d2e4; }
.theme-dark .message { box-shadow: inset 0 1px 0 rgba(255,255,255,.07); }
.theme-dark .message.error { background: rgba(104, 33, 42, .72); color: #ffb0b6; }
.theme-dark .message.warning,
.theme-dark .payroll-notice { background: rgba(102, 72, 19, .62); color: #ffd88a; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .crm-layout .sidebar, .crm-layout .crm-main, .table-card, .info-card, .empty-card, .form-card, .command-bar, .metric-card, .stat-strip, .role-card, .notification-card, .modal-panel, .custom-select-menu, .client-suggestions, .date-popover, .damage-popover, .damage-create-popover, .assignee-picker-panel, .auth-card { background-color: #f7fbff; }
  .theme-dark .sidebar, .theme-dark .crm-main, .theme-dark .table-card, .theme-dark .info-card, .theme-dark .empty-card, .theme-dark .form-card, .theme-dark .command-bar, .theme-dark .metric-card, .theme-dark .stat-strip, .theme-dark .role-card, .theme-dark .notification-card, .theme-dark .modal-panel, .theme-dark .custom-select-menu, .theme-dark .client-suggestions, .theme-dark .date-popover, .theme-dark .damage-popover, .theme-dark .damage-create-popover, .theme-dark .assignee-picker-panel { background-color: #141f2e; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (max-width: 1050px) {
  .crm-layout .crm-content { padding-inline: 22px; }
  .crm-layout .sidebar nav a { font-size: .78rem; }
}

@media (max-width: 760px) {
  .permission-field > div { grid-template-columns: 1fr; }
  .payroll-filter ~ .stat-strip { grid-template-columns: 1fr; }
  .crm-layout .sidebar { position: static; width: auto; margin: 10px; padding: 12px; border-radius: 20px; }
  .crm-layout .sidebar-brand { min-height: 48px; }
  .crm-layout .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
  .crm-layout .sidebar nav a { min-width: 0; min-height: 43px; padding: 9px 10px; }
  .crm-layout .sidebar-user { margin-top: 10px; }
  .crm-layout .crm-main { min-height: auto; margin: 10px; border-radius: 20px; }
  .crm-layout .crm-content { padding: 22px 15px 42px; }
  .crm-layout .page-heading h1 { font-size: 2rem; }
  .calendar-shell { border-radius: 18px; }
  .calendar-shell .calendar-toolbar { align-items: center; flex-wrap: wrap; }
  .calendar-shell .planner-scroll { overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }
  .date-button { min-width: min(210px, 56vw); }
  .modal-backdrop { padding: 12px; }
  .modal-panel { max-height: calc(100dvh - 24px); border-radius: 18px; }
  .modal-form[data-appointment-edit] .service-card-list { grid-template-columns: 1fr; }
}

/* External channels and the embeddable booking form. */
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.integration-card { max-width: none; }
.integration-card-wide { grid-column: 1 / -1; }
.integration-card-head { margin-bottom: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.integration-card-head > div { min-width: 0; display: flex; align-items: center; gap: 13px; }
.integration-card-head h2 { margin: 0 0 4px; color: var(--crm-text); font-size: 1.08rem; }
.integration-card-head p, .integration-future-card > p { margin: 0; color: var(--crm-muted); font-size: .8rem; line-height: 1.5; }
.integration-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px; background: var(--crm-primary-soft); color: var(--crm-primary); font-size: .85rem; font-weight: 850; }
.integration-toggle { margin: 0 0 18px; }
.integration-leads { margin-top: 18px; overflow-x: auto; }
.integration-leads .section-heading { padding: 22px 22px 0; }
.integration-leads td form { margin: 0; }

.public-booking-body { --crm-primary: var(--crm-custom-primary, #087cff); --crm-primary-soft: color-mix(in srgb, var(--crm-primary) 12%, white); min-height: 100vh; margin: 0; background-color: var(--crm-custom-background, #edf5fd); background-image: linear-gradient(color-mix(in srgb, var(--crm-custom-background, #dcebfa) 25%, transparent), color-mix(in srgb, var(--crm-custom-background, #dcebfa) 25%, transparent)), url("../img/interface-background.png"); background-position: center; background-size: cover; background-attachment: fixed; background-repeat: no-repeat; color: #102c51; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; }
.public-booking-shell { min-height: 100vh; padding: 24px; display: grid; place-items: center; box-sizing: border-box; }
.public-booking-card { width: min(720px, 100%); padding: 28px; box-sizing: border-box; border: 1px solid rgba(255,255,255,.9); border-radius: 24px; background: rgba(249,252,255,.84); -webkit-backdrop-filter: blur(24px) saturate(145%); backdrop-filter: blur(24px) saturate(145%); box-shadow: 0 24px 70px rgba(31,68,112,.16), inset 0 1px 0 #fff; }
.public-booking-logo { width: min(260px, 55%); aspect-ratio: 3 / 1; display: block; object-fit: cover; border-radius: 12px; }
.public-booking-company { display: block; color: var(--crm-primary); }
.public-booking-head { margin: 24px 0 22px; }
.public-booking-head h1, .booking-success h1 { margin: 0 0 8px; color: #0f2e55; font-size: clamp(1.6rem, 5vw, 2.25rem); }
.public-booking-head p, .booking-success p { margin: 0; color: #687f9e; line-height: 1.55; }
.public-booking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.public-booking-grid .booking-comment { grid-column: 1 / -1; }
.public-booking-submit { width: 100%; justify-content: center; }
.booking-honeypot { position: fixed !important; left: -10000px !important; opacity: 0 !important; }
.booking-success { padding: 44px 10px; text-align: center; }
.booking-success > span { width: 58px; height: 58px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: #dff7eb; color: #16835a; font-size: 1.6rem; font-weight: 850; }

.theme-dark .integration-icon { background: rgba(50, 92, 145, .32); }
@media (max-width: 760px) {
  .integration-grid, .public-booking-grid { grid-template-columns: 1fr; }
  .integration-card-wide, .public-booking-grid .booking-comment { grid-column: auto; }
  .integration-card-head { align-items: flex-start; flex-direction: column; }
  .public-booking-shell { padding: 12px; }
  .public-booking-card { padding: 21px; border-radius: 20px; }
}
