/* Шрифты лежат на нашем сервере: страница не обращается к Google (Inter и Roboto Condensed, лицензия OFL) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Roboto Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/roboto-condensed-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Roboto Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/roboto-condensed-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Roboto Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/roboto-condensed-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Roboto Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/roboto-condensed-cyrillic-700-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Roboto Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/roboto-condensed-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Roboto Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/roboto-condensed-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  color-scheme: dark;
  --bg: #0c0d0f;
  --panel: #15171a;
  --panel2: #1b1e22;
  --panel3: #23272c;
  --line: #2a2e34;
  --text: #e9ebee;
  --muted: #8d949e;
  --accent: #ff6b1a;
  --accent-h: #ff8440;
  --accent-bg: rgba(255, 107, 26, .12);
  --ok: #3ecf8e;
  --warn: #f5b942;
  --bad: #ef5350;
  --info: #4aa3ff;
  --nav-text: #b9bec6;
  --hover: #2c3137;
  --hover-line: #3a4048;
  --chip-text: #c3c8cf;
  --on-accent: #140a03;
  --grid-half: #1f2227;
  --tint: rgba(255, 255, 255, .03);
  --overlay: rgba(0, 0, 0, .65);
  --shadow: rgba(0, 0, 0, .5);
  --glow: rgba(255, 107, 26, .14);
  --off-bg: #121316;
  --off-name: #131518;
  --off-text: #5d646e;
  --off-label: #6b727c;
  --off-stripe: rgba(255, 255, 255, .04);
  --offpart: rgba(10, 11, 12, .62);
  --radius: 10px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --head: 'Roboto Condensed', 'Arial Narrow', Impact, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f3f6;
  --panel: #ffffff;
  --panel2: #f6f7f9;
  --panel3: #eceef2;
  --line: #dcdfe5;
  --text: #171a1f;
  --muted: #667080;
  --accent: #e8590c;
  --accent-h: #ff6b1a;
  --accent-bg: rgba(232, 89, 12, .1);
  --ok: #0f9d63;
  --warn: #b97a06;
  --bad: #d3362f;
  --info: #1b74d1;
  --nav-text: #4a525e;
  --hover: #e3e6eb;
  --hover-line: #cdd1d8;
  --chip-text: #3c434e;
  --on-accent: #ffffff;
  --grid-half: #eceef2;
  --tint: rgba(0, 0, 0, .035);
  --overlay: rgba(20, 24, 32, .45);
  --shadow: rgba(30, 40, 60, .2);
  --glow: rgba(232, 89, 12, .12);
  --off-bg: #eceef1;
  --off-name: #e7e9ed;
  --off-text: #9aa1ab;
  --off-label: #8b929c;
  --off-stripe: rgba(0, 0, 0, .05);
  --offpart: rgba(212, 216, 223, .72);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }
h1, h2, h3 { font-family: var(--head); text-transform: uppercase; letter-spacing: .04em; margin: 0; font-weight: 700; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }

/* layout */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand .logo { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; transform: skewX(-6deg); }
.brand .logo svg { width: 22px; height: 22px; }
.brand b { font: 700 24px var(--head); letter-spacing: .08em; text-transform: uppercase; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-top: -3px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--nav-text); font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--panel2); color: var(--text); }
.nav a.on { background: var(--accent-bg); color: var(--accent); }
.nav a .cnt { margin-left: auto; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; }
.side .me { margin-top: 6px; border-top: 1px solid var(--line); padding: 12px 8px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel3); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.me .who { line-height: 1.2; min-width: 0; }
.me .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: 12px; color: var(--muted); }
.me .out { margin-left: auto; }
.main { padding: 26px 32px 60px; min-width: 0; width: 100%; }
.topbar { display: none; }

.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .grow { flex: 1; }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 4px; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 7px; background: var(--panel3); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 500; transition: .12s; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: var(--hover-line); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-h); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: rgba(239, 83, 80, .12); border-color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel2); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; outline: none; transition: border-color .12s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238d949e' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
textarea { resize: vertical; min-height: 70px; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=color] { padding: 2px; height: 36px; }
label.f { display: block; }
label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.sp { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 34px; }

/* cards, tables */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; }
.cols { display: grid; gap: 16px; grid-template-columns: 1.6fr 1fr; align-items: start; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--panel2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.stat .v { font: 700 30px/1.15 var(--head); letter-spacing: .02em; margin-top: 4px; }
.stat .v small { font-size: 14px; color: var(--muted); font-family: var(--font); font-weight: 500; }
.stat.hot .v { color: var(--accent); }
.stat.bad .v { color: var(--bad); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--panel3); white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; background: var(--panel3); color: var(--chip-text); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.tabs button { background: none; border: 0; padding: 6px 12px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 500; }
.tabs button.on { background: var(--panel3); color: var(--text); }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 5px 13px; cursor: pointer; font-size: 13px; color: var(--muted); }
.pill.on { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.pill b { color: var(--text); margin-left: 4px; }

/* мессенджеры */
.msgr { display: inline-flex; gap: 6px; }
.msgr a, .msgr button { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer; color: #fff; padding: 0; transition: transform .12s, filter .12s; }
.msgr a:hover, .msgr button:hover { transform: translateY(-1px); filter: brightness(1.12); color: #fff; }
.msgr svg { width: 17px; height: 17px; }
.msgr .wa { background: #25d366; }
.msgr .tg { background: #29a9ea; }
.msgr .mx { background: linear-gradient(135deg, #3f8cff, #8a4dff); }
.msgr .off { background: var(--panel3); color: var(--muted); cursor: not-allowed; pointer-events: none; }
.msgr.big a, .msgr.big button { width: 38px; height: 38px; }
.msgr.big svg { width: 21px; height: 21px; }

/* канбан */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-height: 120px; }
.col-h { padding: 11px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--radius) var(--radius) 0 0; font-weight: 600; }
.col-h .n { margin-left: auto; color: var(--muted); font-weight: 500; }
.col-b { padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.ocard { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; cursor: pointer; transition: .12s; }
.ocard:hover { border-color: var(--accent); transform: translateY(-1px); }
.ocard .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.ocard .s { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ocard .f { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; font-size: 12.5px; }
.debt { color: var(--bad); font-weight: 600; }
.paid { color: var(--ok); }

/* календарь: мастера слева, время сверху */
.cal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.tl { min-width: 100%; }
.tl-head, .tl-row { display: flex; }
.tl-head { background: var(--panel2); border-bottom: 1px solid var(--line); }
.tl-row { border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-name { flex: none; width: 160px; position: sticky; left: 0; z-index: 5; background: var(--panel2); border-right: 1px solid var(--line); padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; line-height: 1.3; }
.tl-name b { display: flex; align-items: center; gap: 7px; }
.tl-hour { flex: none; text-align: center; padding: 11px 0; font-size: 12px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tl-hour:first-of-type { border-left: 0; }
.tl-track { position: relative; flex: none; cursor: pointer;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px), linear-gradient(to right, var(--grid-half) 1px, transparent 1px);
  background-size: var(--hw) 100%, calc(var(--hw) / 2) 100%; }
.tl-track:hover { background-color: rgba(255, 107, 26, .035); }
.appt { position: absolute; border-radius: 7px; padding: 5px 8px; background: var(--c, var(--accent)); color: #0c0d0f; font-size: 12px; line-height: 1.25; overflow: hidden; cursor: pointer; z-index: 2; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.appt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt:hover { filter: brightness(1.08); }
.appt.came { opacity: .55; }
.appt.cancelled, .appt.noshow { opacity: .35; text-decoration: line-through; }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); z-index: 4; pointer-events: none; }
.now-line::before { content: ''; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

/* модалка и тосты */
.modal-bg { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: start center; padding: 5vh 14px; z-index: 50; overflow-y: auto; backdrop-filter: blur(2px); }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px var(--shadow); }
.modal.wide { max-width: 760px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.form-err { color: var(--bad); margin-right: auto; font-size: 13px; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--panel3); border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 8px; padding: 10px 14px; box-shadow: 0 8px 24px var(--shadow); animation: tin .2s; max-width: 340px; }
.toast.err { border-left-color: var(--bad); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* подбор клиента */
.picker { position: relative; }
.picker-list { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--panel3); border: 1px solid var(--line); border-radius: 9px; max-height: 240px; overflow-y: auto; box-shadow: 0 10px 30px var(--shadow); }
.picker-list div { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.picker-list div:hover { background: var(--accent-bg); }
.picked { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.picked .x { margin-left: auto; }
.sub-form { background: var(--panel2); border: 1px dashed var(--line); border-radius: 9px; padding: 12px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 70% -10%, var(--glow), transparent), var(--bg); }
.login .box { width: 100%; max-width: 380px; }
.login .brand { justify-content: center; padding-bottom: 8px; }
.login .brand b { font-size: 36px; }
.login .brand .logo { width: 46px; height: 46px; }
.login .brand .logo svg { width: 30px; height: 30px; }
.login .card { padding: 24px; margin-top: 18px; }

/* акт */
.act-wrap { background: #fff; color: #111; max-width: 860px; margin: 0 auto; padding: 36px 44px; border-radius: 6px; font: 13px/1.5 Arial, sans-serif; }
.act-wrap h1 { font: 700 20px Arial, sans-serif; text-transform: none; letter-spacing: 0; text-align: center; margin: 18px 0 4px; }
.act-wrap table { margin: 10px 0 6px; }
.act-wrap th, .act-wrap td { border: 1px solid #333; padding: 5px 8px; color: #111; font-size: 12.5px; background: none; }
.act-wrap th { background: #eee; text-transform: none; letter-spacing: 0; font-weight: 700; }
.act-wrap .sum { text-align: right; margin: 3px 0; }
.act-wrap .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 44px; }
.act-wrap .sign div { border-top: 1px solid #333; padding-top: 4px; font-size: 11.5px; }
.act-wrap .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 30px; margin: 10px 0; }
.act-tools { max-width: 860px; margin: 0 auto 14px; display: flex; gap: 10px; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax var(--overlay); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .topbar b { font: 700 20px var(--head); letter-spacing: .08em; text-transform: uppercase; }
  .main { padding: 16px 14px 60px; }
  h1 { font-size: 24px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 100px 1fr; }
  .act-wrap { padding: 20px 16px; }
}
@media print {
  body { background: #fff; }
  .side, .topbar, .act-tools, #toasts { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .act-wrap { padding: 0; box-shadow: none; max-width: none; }
}

/* график работы */
.sch { border-collapse: separate; border-spacing: 0; width: auto; min-width: 100%; }
.sch th, .sch td { border-bottom: 1px solid var(--line); }
.sch tr:last-child td { border-bottom: 0; }
.sch-name { position: sticky; left: 0; z-index: 3; background: var(--panel); min-width: 180px; padding: 8px 14px !important; border-right: 1px solid var(--line); }
.sch-d { min-width: 46px; width: 46px; text-align: center; font-size: 13px; padding: 7px 0 !important; color: var(--text); letter-spacing: 0; text-transform: none; }
.sch-d small { display: block; font-size: 10px; color: var(--muted); font-weight: 500; }
.sch-d.we small { color: var(--bad); }
.sch-d.today { color: var(--accent); }
.sch-sum { padding: 8px 14px !important; white-space: nowrap; text-align: right; min-width: 140px; border-left: 1px solid var(--line); }
td.sc { text-align: center; font-size: 11px; line-height: 1.2; height: 48px; padding: 0 !important; border-left: 1px solid var(--line); font-variant-numeric: tabular-nums; color: var(--muted); }
td.sc[data-cell] { cursor: pointer; }
td.sc[data-cell]:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
td.sc.we { background: var(--tint); }
td.sc.work { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
td.sc.vacation { background: rgba(74, 163, 255, .13); color: var(--info); }
td.sc.sick { background: rgba(245, 185, 66, .13); color: var(--warn); }
td.sc.today { box-shadow: inset 0 0 0 1px rgba(255, 107, 26, .55); }
tr.mine .sch-name { box-shadow: inset 3px 0 0 var(--accent); }

/* календарь: нерабочее время мастера */
.tl-name.off b, .tl-name.off span { color: var(--off-text); }
.tl-row.off .tl-name { background: var(--off-name); }
.tl-track.off { cursor: not-allowed; background-color: var(--off-bg);
  background-image: repeating-linear-gradient(135deg, transparent 0 9px, var(--off-stripe) 9px 18px); background-size: auto; }
.tl-track.off:hover { background-color: var(--off-bg); }
.tl-offpart { position: absolute; top: 0; bottom: 0; z-index: 1; pointer-events: none; background-color: var(--offpart);
  background-image: repeating-linear-gradient(135deg, transparent 0 9px, var(--off-stripe) 9px 18px); }
.tl-offlabel { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); z-index: 1; pointer-events: none; color: var(--off-label); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }

/* переключатель темы */
.nav-btn { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--nav-text); font-weight: 500; background: none; border: 0; width: 100%; cursor: pointer; text-align: left; }
.nav-btn svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-btn:hover { background: var(--panel2); color: var(--text); }
.side .nav-btn.theme { margin-top: auto; }
.theme-fab { position: fixed; top: 16px; right: 16px; }
:root[data-theme="light"] .btn.primary:hover { background: var(--accent-h); }
:root[data-theme="light"] .card, :root[data-theme="light"] .stat, :root[data-theme="light"] .col { box-shadow: 0 1px 2px rgba(30, 40, 60, .05); }

/* календарь: записи заполняют строку мастера, цвет = статус */
.tl-row { overflow: visible; }
.appt { background: var(--c, var(--accent)); color: var(--fg, #0c0d0f); cursor: grab; user-select: none; -webkit-user-select: none; padding: 0; display: flex; }
.appt .ab { flex: 1; min-width: 0; padding: 5px 10px; line-height: 1.25; }
.appt.ro { cursor: pointer; }
.appt .rh { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; z-index: 3; touch-action: none; }
.appt .rh.l { left: 0; }
.appt .rh.r { right: 0; }
.appt .rh::after { content: ''; position: absolute; top: 50%; width: 3px; height: 18px; transform: translateY(-50%); border-radius: 2px; background: currentColor; opacity: 0; transition: opacity .12s; }
.appt .rh.l::after { left: 2px; }
.appt .rh.r::after { right: 2px; }
.appt:hover .rh::after { opacity: .45; }
.appt.dragging { z-index: 20; cursor: grabbing; box-shadow: 0 8px 24px var(--shadow); opacity: .94; }
.tl-track.drop { background-color: var(--accent-bg); }
.tl-track.nodrop { background-color: rgba(239, 83, 80, .12); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px; }
.legend .lg { display: inline-flex; align-items: center; gap: 7px; color: var(--text); }
.legend .lg i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.legend .lg.zero { color: var(--muted); }
.legend .lg b { background: var(--panel3); border-radius: 99px; padding: 0 7px; font-size: 11px; }

/* выпадающий список марок и моделей */
.combo { position: relative; }
.picker-list div.on { background: var(--accent-bg); }
.picker-list div.hint { cursor: default; color: var(--muted); font-size: 13px; line-height: 1.4; }
.picker-list div.hint:hover { background: transparent; }
.appt.dragging { pointer-events: none; }

/* каталог работ */
.cat-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.cat-tree { padding: 6px; position: sticky; top: 14px; max-height: calc(100vh - 40px); overflow-y: auto; }
.fold { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; background: none; border: 0; color: var(--nav-text); padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.fold span { font-size: 11px; color: var(--muted); background: var(--panel3); border-radius: 99px; padding: 0 7px; }
.fold:hover { background: var(--panel2); color: var(--text); }
.fold.on { background: var(--accent-bg); color: var(--accent); }
.fold-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.star { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 4px; }
.star:hover { color: var(--warn); }
.star.on { color: var(--warn); }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 16px; }
.pk { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.pk ul { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pk li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.row-edit { display: grid; grid-template-columns: 1.2fr 1.2fr .7fr auto; gap: 8px; align-items: center; }
.row-edit.part, .row-edit.pk-row { grid-template-columns: 1fr 110px auto; }
@media (max-width: 860px) {
  .cat-layout { grid-template-columns: 1fr; }
  .cat-tree { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; }
  .fold { width: auto; }
  .row-edit { grid-template-columns: 1fr 1fr; }
}
tbody tr.sel td { background: var(--accent-bg); }

/* форма записи: занятость мастера и пункты работ */
.row-edit.item { grid-template-columns: 1fr auto; }
.avail { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.avail.bad { border-color: var(--bad); }
.avail .av-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: none; border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; text-align: left; color: var(--text); }
.avail .av-row:hover { background: var(--accent-bg); }
.avail .av-row.off { cursor: not-allowed; opacity: .6; }
.avail .av-row.off:hover { background: none; }
.avail .slots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.avail .slot { border-radius: 99px; padding: 2px 10px; font-size: 12.5px; border: 1px solid var(--line); background: var(--panel3); color: var(--text); }
.avail .slot.busy { border-color: rgba(245, 185, 66, .5); color: var(--warn); background: rgba(245, 185, 66, .1); }
.avail .slot.free { cursor: pointer; border-color: rgba(62, 207, 142, .5); color: var(--ok); background: rgba(62, 207, 142, .1); }
.avail .slot.free:hover { background: rgba(62, 207, 142, .22); }
.avail .av-warn { color: var(--bad); font-weight: 500; }
.sug { background: var(--accent-bg); border: 1px solid var(--accent); border-radius: 9px; padding: 9px 12px; display: flex; flex-direction: column; gap: 6px; }

/* зарплата: карточки-кубики сотрудников */
.pay-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.cube { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cube b { font: 700 20px/1.15 var(--head); letter-spacing: .02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cube b small { font: 500 13px var(--font); color: var(--muted); }
.cube span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.cube.big { background: var(--panel); padding: 16px 18px; gap: 6px; }
.cube.big span { order: -1; }
.cube.big b { font-size: 30px; }
.cube.hot b { color: var(--accent); }
.cube.hot { border-color: var(--accent); }
.pt-cubes .cube { padding: 10px 12px; }
.pt-cubes .cube b { font-size: 17px; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.pay-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: transform .15s, box-shadow .15s; }
.pay-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 28px var(--shadow); }
.pt-head { display: flex; align-items: center; gap: 12px; }
.pt-av { width: 42px; height: 42px; font-size: 14px; background: var(--panel3); color: var(--text); flex: none; }
.pt-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.pt-who b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-state { font-size: 11px; padding: 3px 9px; border-radius: 99px; background: var(--panel3); color: var(--muted); white-space: nowrap; font-weight: 600; }
.pt-state.warn { color: var(--text); }
.pt-due { display: flex; flex-direction: column; margin-top: 4px; }
.pt-due .l { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pt-due b { font: 700 38px/1.1 var(--head); letter-spacing: .01em; color: var(--text); font-variant-numeric: tabular-nums; }
.pt-bar { height: 8px; border-radius: 99px; background: var(--panel3); overflow: hidden; }
.pt-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.pt-bar-l { display: flex; justify-content: space-between; margin-top: -4px; }
.pt-seg { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; margin-top: 4px; }
.pt-seg i { display: block; min-width: 4px; }
.pt-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.pt-legend i, .sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.pt-legend b { color: var(--text); font-weight: 600; }
.pt-cubes { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin-top: 2px; }
.pt-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.pt-actions .btn { flex: 1; justify-content: center; }
@media (max-width: 1100px) { .pay-summary { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pay-grid { grid-template-columns: 1fr; } .cube.big b { font-size: 24px; } }

/* карточка записи в карточке клиента */
.appt-panel { margin-bottom: 16px; border-color: var(--accent); }
.appt-panel h2 { text-transform: none; letter-spacing: 0; font-size: 22px; }

/* подсветка только что созданной записи */
@keyframes apptPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 107, 26, .95), 0 2px 8px rgba(0, 0, 0, .35); transform: scale(1); }
  40%  { box-shadow: 0 0 0 12px rgba(255, 107, 26, 0), 0 6px 24px rgba(255, 107, 26, .55); transform: scale(1.06); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 26, 0), 0 2px 8px rgba(0, 0, 0, .35); transform: scale(1); }
}
@keyframes rowGlow {
  0%, 100% { background-color: transparent; }
  30%, 70% { background-color: var(--accent-bg); }
}
.appt.flash { animation: apptPulse 1.15s ease-in-out 3; outline: 2px solid var(--accent); outline-offset: 2px; z-index: 15; }
.tl-row.flash-row .tl-track { animation: rowGlow 4.2s ease-in-out 1; }
.tl-row.flash-row .tl-name b { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .appt.flash, .tl-row.flash-row .tl-track { animation: none; } }

/* таблицы работ и запчастей в заказ-наряде */
.wt { overflow-x: auto; }
.wt-head, .wt-row, .wt-foot { display: grid; align-items: center; gap: 12px; padding: 0 18px; min-width: 780px;
  grid-template-columns: minmax(190px, 2.4fr) minmax(130px, 1.2fr) 112px 84px 112px 124px 76px; }
.wt.parts .wt-head, .wt.parts .wt-row, .wt.parts .wt-foot { min-width: 560px; grid-template-columns: minmax(220px, 3fr) 90px 112px 124px 76px; }
.wt-head { height: 38px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.wt-row { min-height: 66px; border-bottom: 1px solid var(--line); transition: background .12s; }
.wt-row:hover { background: var(--panel2); }
.wt-name { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.wt-name b { font-size: 14.5px; font-weight: 600; }
.wt-name .chip { font-size: 11px; padding: 0 7px; }
.wt-master { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.wt-master span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.wt .c { text-align: center; }
.wt .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wt-act { display: flex; justify-content: flex-end; gap: 2px; opacity: .55; transition: opacity .12s; }
.wt-row:hover .wt-act { opacity: 1; }
.qty-pill { background: var(--panel3); border-radius: 99px; padding: 3px 11px; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.norm-pill { display: inline-flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding-right: 12px; transition: border-color .12s, box-shadow .12s; cursor: text; }
.norm-pill:hover { border-color: var(--hover-line); }
.norm-pill:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.norm-pill input { width: 62px; border: 0; background: transparent; padding: 7px 4px 7px 12px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; -moz-appearance: textfield; box-shadow: none; }
.norm-pill input:focus { border: 0; outline: none; }
.norm-pill input::-webkit-outer-spin-button, .norm-pill input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.norm-pill span { color: var(--muted); font-size: 12.5px; }
.wt-foot { height: 52px; background: var(--panel2); font-weight: 500; }
.wt-foot b { font-size: 15px; }

/* календарь: недельный и месячный виды */
.wk { min-width: 1000px; }
.wk-head, .wk-row { display: grid; grid-template-columns: 160px repeat(7, minmax(120px, 1fr)); }
.wk-head > div { padding: 10px 8px; background: var(--panel2); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); text-align: center; }
.wk-head .wk-corner { border-left: 0; text-align: left; padding-left: 14px; position: sticky; left: 0; z-index: 5; }
.wk-day { cursor: pointer; font-weight: 500; }
.wk-day b { font-size: 15px; }
.wk-day:hover { background: var(--accent-bg); }
.wk-day.today { color: var(--accent); }
.wk-day span { margin-left: 4px; }
.wk-row { border-bottom: 1px solid var(--line); }
.wk-row:last-child { border-bottom: 0; }
.wk-name { position: sticky; left: 0; z-index: 4; background: var(--panel2); border-right: 1px solid var(--line); padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; line-height: 1.3; }
.wk-name b { display: flex; align-items: center; gap: 7px; }
.wk-cell { position: relative; border-left: 1px solid var(--line); min-height: 92px; padding: 6px 6px 26px; display: flex; flex-direction: column; gap: 4px; transition: background .12s; }
.wk-cell.we { background: var(--tint); }
.wk-cell.today { box-shadow: inset 0 0 0 1px rgba(255, 107, 26, .55); }
.wk-cell.off { background-color: var(--off-bg); background-image: repeating-linear-gradient(135deg, transparent 0 9px, var(--off-stripe) 9px 18px); }
.wk-cell .sh { font-size: 10.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.wk-cell.off .sh { color: var(--off-text); }
.wk-cell.drop, .mo-cell.drop { background: var(--accent-bg); }
.wk-cell.nodrop, .mo-cell.nodrop { background: rgba(239, 83, 80, .14); }
.wk-chip { background: var(--c, var(--accent)); color: var(--fg, #0c0d0f); border-radius: 7px; padding: 4px 8px; font-size: 12px; line-height: 1.25; cursor: grab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.wk-chip.ro { cursor: pointer; }
.wk-chip.dragging { opacity: .35; }
.wk-chip.flash { animation: apptPulse 1.15s ease-in-out 3; outline: 2px solid var(--accent); outline-offset: 2px; }
.wk-add { position: absolute; right: 6px; bottom: 4px; width: 22px; height: 22px; border-radius: 50%; border: 1px dashed var(--hover-line); background: var(--panel); color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; opacity: 0; transition: opacity .12s; }
.wk-cell:hover .wk-add, .mo-cell:hover .wk-add { opacity: 1; }
.wk-add:hover { color: var(--accent); border-color: var(--accent); }
@media (hover: none) { .wk-add { opacity: .75; } }
.drag-ghost { position: fixed; z-index: 300; pointer-events: none; margin: 0; opacity: .95; transform: rotate(-2deg) scale(1.05); box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
.mo { min-width: 780px; }
.mo-head, .mo-grid { display: grid; grid-template-columns: repeat(7, minmax(104px, 1fr)); }
.mo-head div { padding: 9px 8px; text-align: center; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--panel2); border-bottom: 1px solid var(--line); }
.mo-cell { position: relative; min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .12s; }
.mo-cell:nth-child(7n) { border-right: 0; }
.mo-cell.we { background: var(--tint); }
.mo-cell.out { opacity: .45; }
.mo-cell .wk-add { position: static; opacity: 0; }
.mo-num { width: 26px; height: 26px; border-radius: 50%; border: 0; background: none; color: var(--text); cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; }
.mo-num:hover { background: var(--panel3); }
.mo-cell.today .mo-num { background: var(--accent); color: var(--on-accent); }
.mo-chip { font-size: 11.5px; padding: 3px 7px; }
.mo-more { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 11.5px; text-align: left; padding: 0 4px; }
.mo-more:hover { color: var(--accent); }
.wk-cell.flash-row, .mo-cell.flash-row { animation: rowGlow 4.2s ease-in-out 1; }
.pill.drop { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); transform: scale(1.08); }
@media (pointer: coarse) { .appt .rh { width: 20px; } }
.appt, .wk-chip { -webkit-touch-callout: none; }

/* логотип */
.brand .logo-img { width: 46px; height: 46px; object-fit: contain; flex: none; }
.topbar .logo-img.sm { width: 30px; height: 30px; object-fit: contain; }
.login-logo { display: block; width: min(230px, 62vw); height: auto; margin: 0 auto; }
.login .box .card { margin-top: 10px; }
.pw { position: relative; }
.pw input { padding-right: 84px; }
.pw .btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

/* телефон: нижняя панель */
.tabbar { display: none; }
.m-spacer { height: 96px; }
.sec { margin: 22px 0 10px; font-size: 13px; letter-spacing: .1em; }

/* экран механика */
.job { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin: 0 auto; }
.job-head { display: flex; flex-direction: column; gap: 4px; }
.job-head h1 { font-size: 26px; line-height: 1.15; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; min-height: 64px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-weight: 600; font-size: 12.5px; cursor: pointer; text-align: center; line-height: 1.2; }
.seg button i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: block; }
.seg button.on { border-color: var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 14%, var(--panel)); box-shadow: inset 0 0 0 1px var(--c); }
.seg button:disabled { opacity: .5; }
.jl { display: flex; flex-direction: column; }
.jl-item { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); min-height: 64px; }
.jl-item:last-child { border-bottom: 0; }
.jl-item.tap { cursor: pointer; }
.jl-item.tap:active { background: var(--panel2); }
.jl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.jl-main b { font-size: 15px; font-weight: 600; }
.todo { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.todo li { position: relative; padding: 12px 14px 12px 42px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; font-size: 15px; font-weight: 500; }
.todo li::before { content: ''; position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 5px; border: 2px solid var(--accent); }
.note-box { margin-top: 12px; padding: 10px 12px; background: var(--panel2); border-radius: 10px; }
.m-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 34; display: flex; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.m-actions .btn { flex: 1; justify-content: center; min-height: 50px; font-size: 15px; font-weight: 600; }
.btn.big { min-height: 54px; font-size: 16px; }

/* список записей механика */
.vlist { display: flex; flex-direction: column; gap: 10px; }
.vcard { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--c, var(--accent)); border-radius: 14px; color: var(--text); transition: transform .12s, border-color .12s; }
.vcard:hover { border-color: var(--c); color: var(--text); }
.vcard:active { transform: scale(.985); }
.vc-time { display: flex; flex-direction: column; align-items: center; min-width: 58px; }
.vc-time b { font: 700 24px/1.1 var(--head); letter-spacing: .02em; }
.vc-time span { font-size: 11px; color: var(--muted); }
.vc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vc-bike { font-size: 16px; }
.vc-items { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.vc-items span { background: var(--panel3); border-radius: 99px; padding: 2px 10px; font-size: 12.5px; }
.vc-items .more { color: var(--muted); }
.vc-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.vc-state i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

/* выбор запчасти */
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.chips .pill { flex: none; padding: 8px 14px; }
.plist { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow-y: auto; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; min-height: 58px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-align: left; color: var(--text); width: 100%; }
.prow.on { border-color: var(--accent); background: var(--accent-bg); }
.prow.out { opacity: .5; }
.pr-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pr-main b { font-size: 14.5px; font-weight: 600; }
.pr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.stk { font-weight: 700; font-variant-numeric: tabular-nums; }
.stk.warn { color: var(--warn); }
.stk.bad { color: var(--bad); }
.psel { background: var(--panel2); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel3); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer; flex: none; }
.stepper button:active { background: var(--accent-bg); }
.stepper input { text-align: center; font-size: 22px; font-weight: 700; height: 52px; min-width: 0; flex: 1; }

/* телефонный вид */
@media (max-width: 860px) {
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 33; background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; font-size: 10.5px; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar a.on { color: var(--accent); }
  .main { padding-bottom: 92px; }
  .m-actions { bottom: calc(58px + env(safe-area-inset-bottom)); padding-bottom: 10px; }
  .topbar { padding-top: calc(10px + env(safe-area-inset-top)); }
  h1 { font-size: 22px; }
}
@media (max-width: 640px) {
  .modal-bg { padding: 0; place-items: end center; }
  .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 94vh; overflow-y: auto; animation: sheetUp .22s ease-out; }
  .modal.wide { max-width: none; }
  .modal-f { position: sticky; bottom: 0; background: var(--panel); }
  .modal-f .btn { min-height: 46px; }
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: .6; } }
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 42px; }
  .btn.sm { min-height: 38px; }
  .pill { min-height: 38px; }
}

/* таблицы работ и запчастей: на телефоне — карточками */
@media (max-width: 700px) {
  .wt-head { display: none; }
  .wt-head, .wt-row, .wt-foot, .wt.parts .wt-head, .wt.parts .wt-row, .wt.parts .wt-foot { min-width: 0; }
  .wt-row, .wt.parts .wt-row { grid-template-columns: 1fr auto; row-gap: 8px; padding: 12px 14px; }
  .wt-name { grid-column: 1 / 2; }
  .wt-act { grid-column: 2 / 3; grid-row: 1; }
  .wt-master { grid-column: 1 / -1; }
  .wt .c, .wt .r { text-align: left; }
  .wt-foot { grid-template-columns: 1fr auto; }
  .wt-foot span:empty { display: none; }
}

/* телефон: ничего не должно вылезать за экран */
html, body { overflow-x: hidden; }
@media (max-width: 860px) {
  .page-head .grow { flex-basis: 100%; }
  .vcard { flex-wrap: wrap; gap: 8px 14px; }
  .vc-main { flex: 1 1 0; }
  .vc-state { flex-basis: 100%; padding-left: 72px; margin-top: -4px; }
  .vcard > .badge { margin-left: 72px; }
  .job-head h1 { font-size: 24px; }
  .seg button { font-size: 11.5px; padding: 10px 2px; }
}
