:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #17202a;
  background: #eef1f4;
  font-synthesis: none;
  --border: #d8dde3;
  --muted: #667085;
  --blue: #1769e0;
  --blue-soft: #eaf2ff;
  --green: #087a55;
  --green-soft: #e6f5ef;
  --orange: #bd5b00;
  --orange-soft: #fff1df;
  --red: #c73737;
  --red-soft: #fff0f0;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1180px; background: #eef1f4; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(460px, 620px) minmax(460px, 1fr);
  background: #f7f9fb;
}
.login-panel { padding: 56px 84px; display: flex; flex-direction: column; background: white; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup strong { display: block; font-size: 22px; }
.brand-lockup span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid #111820; color: #111820; font-weight: 700; font-size: 20px; transform: rotate(45deg); }
.brand-mark::first-letter { transform: rotate(-45deg); }
.login-copy { margin-top: auto; max-width: 460px; }
.login-copy h1 { font-size: 34px; margin: 6px 0 10px; }
.login-copy p:last-child { color: var(--muted); line-height: 1.55; }
.eyebrow { margin: 0; color: var(--muted); text-transform: uppercase; font-size: 10px; font-weight: 700; }
.login-form { margin: 28px 0 auto; max-width: 420px; display: grid; gap: 16px; }
label { display: grid; gap: 6px; color: #344054; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cfd6df; border-radius: 5px; padding: 10px 11px; color: #17202a; background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(23,105,224,.12); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 43px; }
.password-toggle { position: absolute; top: 50%; right: 4px; width: 34px; height: 34px; padding: 0; transform: translateY(-50%); display: grid; place-items: center; border: 0; border-radius: 4px; color: #667085; background: transparent; }
.password-toggle:hover { color: #17202a; background: #f1f4f7; }
.password-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.password-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.password-icon-hide { display: none; }
.password-toggle[aria-pressed="true"] .password-icon-show { display: none; }
.password-toggle[aria-pressed="true"] .password-icon-hide { display: block; }
.login-hint { margin: -4px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.login-context { background: #17202a; color: white; padding: 76px 8vw; display: flex; flex-direction: column; justify-content: center; }
.login-context h2 { font-size: 26px; margin: 30px 0 10px; }
.login-context p { max-width: 560px; color: #cbd5df; line-height: 1.6; }
.context-visual { background: white; color: #17202a; border-radius: 8px; padding: 18px; max-width: 560px; box-shadow: 0 28px 80px rgba(0,0,0,.24); }
.mini-order { display: flex; justify-content: space-between; align-items: center; padding: 15px 14px; border-bottom: 1px solid var(--border); }
.mini-order:last-child { border: 0; }
.mini-order b { padding: 4px 7px; background: #eef1f4; border-radius: 4px; font-size: 12px; }
.mini-order .urgent { background: var(--orange-soft); color: var(--orange); }
.mini-order .overdue { background: var(--red-soft); color: var(--red); }

.button { border: 1px solid transparent; border-radius: 5px; min-height: 39px; padding: 0 16px; font-weight: 700; }
.button.primary { color: white; background: var(--blue); }
.button.primary:hover { background: #0d59c5; }
.button.secondary { color: #27303a; border-color: #cdd4dd; background: white; }
.button.secondary:hover { background: #f5f7f9; }
.button.wide { width: 100%; }
.button.small { min-height: 34px; font-size: 12px; }
.icon-button { width: 34px; height: 34px; border: 1px solid transparent; background: transparent; border-radius: 5px; font-size: 18px; color: #495463; }
.icon-button:hover { border-color: var(--border); background: #f5f7f9; }

.app { height: 100vh; min-height: 720px; display: grid; grid-template-rows: 58px 1fr; background: white; overflow: hidden; }
.topbar { display: grid; grid-template-columns: 310px 1fr auto; align-items: center; border-bottom: 1px solid var(--border); padding: 0 16px; background: white; }
.brand-lockup.compact .brand-mark { width: 28px; height: 28px; font-size: 13px; }
.brand-lockup.compact strong { font-size: 16px; }
.brand-lockup.compact span { font-size: 10px; }
.point-chip { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; background: #f5f7f9; border-radius: 5px; font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.network-state { font-size: 11px; font-weight: 700; color: var(--green); }
.network-state.offline { color: var(--orange); }
.user-menu { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.role-badge { padding: 3px 6px; border: 1px solid #b9d8d1; border-radius: 3px; color: #176b5b; background: #f0faf7; font-size: 8px; font-weight: 700; text-transform: uppercase; }

.workspace { min-height: 0; display: grid; grid-template-columns: 74px 310px minmax(700px, 1fr); }
.primary-nav { min-height: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 7px; border-right: 1px solid var(--border); background: #17202a; }
.primary-nav-button { width: 100%; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #b9c4cf; font-size: 9px; font-weight: 700; }
.primary-nav-button:hover { color: white; background: #25303b; }
.primary-nav-button.active { color: white; border-color: #44515f; background: #2a3642; }
.primary-nav-icon { font-size: 19px; line-height: 1; }
.orders-panel { min-height: 0; display: flex; flex-direction: column; background: #fbfcfd; }
.orders-panel { border-right: 1px solid var(--border); padding: 14px 12px 12px; }
.panel-title-row { display: flex; justify-content: space-between; align-items: center; }
.panel-title-row h2 { margin: 3px 0 0; font-size: 18px; }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-top: 12px; }
.tab { border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; padding: 9px 3px 8px; font-weight: 700; font-size: 12px; }
.tab.active { color: var(--blue); border-color: var(--blue); }
.order-type-tabs { display: grid; grid-template-columns: 1fr .8fr 1.2fr; gap: 3px; margin-top: 9px; padding: 3px; border: 1px solid #d7dde4; border-radius: 5px; background: #f1f3f5; }
.order-type-tabs button { min-width: 0; height: 29px; padding: 0 5px; overflow: hidden; border: 0; border-radius: 3px; color: #667085; background: transparent; font-size: 8.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.order-type-tabs button.active { color: #164f9d; background: white; box-shadow: 0 1px 2px rgba(25, 38, 55, .12); }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin: 10px 0; }
.search-row input { min-width: 0; padding: 8px 9px; font-size: 11px; }
.density-control { display: flex; border: 1px solid #cfd6df; border-radius: 5px; overflow: hidden; background: white; }
.density-button { width: 31px; border: 0; border-left: 1px solid #dde2e8; color: #647080; background: white; }
.density-button:first-child { border-left: 0; }
.density-button.active { color: var(--blue); background: var(--blue-soft); }
.orders-list { flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.order-list-item { position: relative; width: 100%; text-align: left; border: 1px solid transparent; border-bottom-color: #e4e8ed; background: transparent; color: #17202a; }
.orders-list.compact .order-list-item { min-height: 44px; padding: 2px 8px 2px 10px; line-height: 1.05; }
.orders-list.large .order-list-item { min-height: 94px; padding: 10px 11px; margin-bottom: 7px; border-color: #dfe4ea; border-radius: 5px; background: white; }
.order-list-item:hover { background: #f3f6fa; }
.order-list-item.selected { background: var(--blue-soft); border-color: #80adf2; }
.order-list-item.urgent::before, .order-list-item.overdue::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.order-list-item.urgent::before { background: #e57600; }
.order-list-item.overdue::before { background: var(--red); }
.order-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.order-line + .order-line { margin-top: 1px; }
.order-code { font-size: 11px; font-weight: 700; }
.order-time, .order-location, .order-item { color: var(--muted); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-client { max-width: 165px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-badge { display: inline-flex; align-items: center; min-height: 18px; padding: 2px 5px; border-radius: 3px; background: #eef1f4; color: #3c4652; font-size: 9px; font-weight: 700; }
.status-badge.work { color: #1457b8; background: #e9f1ff; }
.status-badge.ready { color: var(--green); background: var(--green-soft); }
.status-badge.urgent { color: var(--orange); background: var(--orange-soft); }
.status-badge.overdue { color: var(--red); background: var(--red-soft); }
.new-order { margin-top: 10px; }

.order-workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 15px 16px 0; background: white; }
.order-workspace.has-no-order > :not(.empty-order-workspace) { display: none; }
.order-workspace:not(.has-no-order) > .empty-order-workspace { display: none; }
.empty-order-workspace { flex: 1; display: grid; place-items: center; min-height: 320px; text-align: center; }
.empty-order-workspace > div { max-width: 360px; }
.empty-order-workspace h2 { margin: 0; font-size: 20px; }
.empty-order-workspace p { margin: 8px 0 18px; color: var(--muted); font-size: 11px; }
.order-header { display: flex; justify-content: space-between; align-items: center; }
.order-header h1 { margin: 3px 0 0; font-size: 22px; }
.status-select { width: 130px; padding: 8px; font-weight: 700; }
.section-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-top: 10px; }
.section-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 9px 0 8px; color: #4e5967; background: transparent; font-size: 11px; }
.section-tabs button.active { color: var(--blue); border-color: var(--blue); font-weight: 700; }
.order-form { flex: 1; min-height: 0; overflow: auto; padding: 10px 2px 12px; }
.form-section { border-bottom: 1px solid #e4e8ed; padding: 10px 0 12px; }
.form-section.two-columns { display: grid; grid-template-columns: 1fr 1.08fr; gap: 20px; }
.form-section h3 { margin: 0 0 9px; font-size: 13px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.field-grid.four { grid-template-columns: 1.4fr 1fr .7fr .7fr; }
.field-grid.payment-grid { grid-template-columns: 1fr 1fr 1fr .9fr .9fr; align-items: end; }
.field-grid input, .field-grid select { height: 34px; padding: 7px 9px; font-size: 11px; }
.due-field > span { display: block; margin-bottom: 4px; font-size: 10px; font-weight: 700; }
.due-field-inputs { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 6px; }
.due-field-inputs input { min-width: 0; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: span 4; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-heading h3 { margin-bottom: 0; }
.section-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.items-section { padding-top: 4px; }
.items-container { display: grid; gap: 12px; margin-top: 12px; }
.item-card { border: 1px solid #ccd5df; border-radius: 6px; background: white; overflow: hidden; }
.item-card-header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 13px; border-bottom: 1px solid #dce2e8; background: #f7f9fb; }
.item-card-header strong { font-size: 12px; }
.item-card-header span { margin-left: 8px; color: var(--muted); font-size: 9px; font-weight: 400; }
.item-remove-button { border: 0; color: #a52626; background: transparent; font-size: 10px; font-weight: 700; }
.item-details { display: grid; grid-template-columns: 1.25fr .9fr .65fr 1fr .75fr .65fr; gap: 10px; padding: 13px; }
.item-details label { min-width: 0; font-size: 10px; }
.item-details .item-defect-field { grid-column: 1 / -1; }
.item-loss-note { color: var(--muted); font-size: 8px; font-weight: 400; }
.item-works { padding: 0 13px 13px; }
.item-works-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 0 7px; }
.item-works-heading strong { font-size: 10px; }
.item-works .works-table { border-radius: 4px; }
.text-button { border: 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 700; }
.works-table { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.work-row { display: grid; grid-template-columns: 34px 1fr 1.7fr 110px 34px; border-top: 1px solid var(--border); }
.work-row.repair-work-row { grid-template-columns: 34px minmax(210px, 1.7fr) minmax(145px, .9fr) minmax(125px, .75fr) 130px 34px; }
.work-row:first-child { border-top: 0; }
.work-row > * { min-width: 0; border: 0; border-right: 1px solid var(--border); border-radius: 0; padding: 8px; background: white; font-size: 10.5px; }
.work-row > *:last-child { border-right: 0; }
.work-number { display: grid; place-items: center; color: var(--muted); }
.work-remove { color: #7b1f1f; }
.work-price-box { display: grid; gap: 2px; padding: 4px 7px !important; }
.work-price-box input { height: 25px; padding: 3px 5px; border: 1px solid #d7dde4; border-radius: 3px; font-weight: 700; }
.work-price-box span { color: var(--muted); font-size: 8px; white-space: nowrap; }
.work-row select:disabled, .work-row input:disabled { color: #89929d; background: #f5f7f9; }
.repair-work-columns { display: grid; grid-template-columns: 34px minmax(210px, 1.7fr) minmax(145px, .9fr) minmax(125px, .75fr) 130px 34px; color: var(--muted); background: #f3f5f7; border: 1px solid var(--border); border-bottom: 0; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.repair-work-columns span { padding: 5px 8px; border-right: 1px solid var(--border); }
.repair-work-columns span:last-child { border-right: 0; }
.work-catalog.needs-selection { color: var(--blue); background: #f1f6ff; font-weight: 700; }
.money-summary { min-height: 48px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; }
.money-summary span { color: var(--muted); font-size: 10px; }
.money-summary strong { font-size: 16px; margin-top: 4px; }
.money-summary.accent strong { color: var(--green); }
.history-note { color: var(--muted); font-size: 10px; }
.history-list { border-left: 2px solid #dce3eb; margin: 14px 0 0 8px; padding-left: 20px; }
.history-entry { position: relative; display: grid; grid-template-columns: 145px 1fr; gap: 16px; padding: 0 0 20px; }
.history-entry::before { content: ""; position: absolute; left: -26px; top: 3px; width: 10px; height: 10px; border: 2px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px #aeb8c4; }
.history-time { color: var(--muted); font-size: 10px; }
.history-content strong { display: block; font-size: 12px; }
.history-content span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.history-empty { color: var(--muted); font-size: 12px; padding: 18px 0; }
.form-actions { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); background: white; }
.form-actions span { margin-right: auto; color: var(--muted); font-size: 10px; }

.schedule-workspace, .price-workspace, .settings-workspace, .analytics-workspace { grid-column: 2 / -1; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 18px 20px 12px; background: white; }
.settings-workspace { overflow: auto; }
.schedule-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.schedule-header h1 { margin: 4px 0 0; font-size: 24px; }
.schedule-header-actions { display: flex; align-items: center; gap: 10px; }
.permission-chip { padding: 7px 9px; border: 1px solid #dce2e8; border-radius: 4px; color: var(--muted); background: #f7f9fb; font-size: 10px; font-weight: 700; }

.price-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.price-header h1 { margin: 4px 0 0; font-size: 24px; }
.price-header-actions { display: flex; align-items: center; gap: 14px; }
.price-version { display: grid; gap: 3px; text-align: right; }
.price-version span { color: var(--muted); font-size: 9px; }
.price-version strong { font-size: 11px; }
.price-rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 14px 0; overflow: hidden; border: 1px solid #dce2e8; border-radius: 5px; background: #dce2e8; }
.price-rules div { min-width: 0; padding: 10px 12px; background: #f7f9fb; }
.price-rules strong, .price-rules span { display: block; }
.price-rules strong { font-size: 10px; }
.price-rules span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.price-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 10px; }
.price-toolbar input { width: min(440px, 48%); height: 38px; font-size: 11px; }
.price-tabs { display: flex; overflow: hidden; border: 1px solid #cfd6df; border-radius: 5px; }
.price-tabs button { min-height: 36px; padding: 0 14px; border: 0; border-left: 1px solid #cfd6df; color: #4e5967; background: white; font-size: 10px; font-weight: 700; }
.price-tabs button:first-child { border-left: 0; }
.price-tabs button.active { color: var(--blue); background: var(--blue-soft); }
.brand-price-warning { margin-bottom: 10px; padding: 9px 11px; border: 1px solid #edc78e; border-radius: 5px; color: #865000; background: #fff7e8; font-size: 10px; font-weight: 700; }
.price-edit-actions { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; padding: 8px 10px; border: 1px solid #b9cce6; border-radius: 5px; background: #f1f6fd; }
.price-edit-actions span { margin-right: auto; color: #526071; font-size: 9px; }
.price-edit-actions select { width: 245px; height: 34px; padding: 5px 7px; font-size: 9.5px; }
.price-effective-field { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 9px; color: #526071; }
.price-effective-field input { width: 128px; height: 34px; padding: 5px 7px; font-size: 9.5px; }
.price-table-wrap { min-height: 0; overflow: auto; border: 1px solid var(--border); border-radius: 5px; }
.price-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.price-table th { position: sticky; top: 0; z-index: 1; padding: 9px 10px; border-bottom: 1px solid var(--border); color: #475467; background: #f1f4f7; text-align: left; }
.price-table td { padding: 8px 10px; border-bottom: 1px solid #e5e9ee; vertical-align: top; }
.price-table tr:last-child td { border-bottom: 0; }
.price-table th:first-child, .price-table td:first-child { width: 44px; text-align: center; }
.price-table th:nth-last-child(-n+3), .price-table td:nth-last-child(-n+3) { width: 120px; white-space: nowrap; }
.price-table td strong { display: block; line-height: 1.35; }
.price-table td small { display: block; max-width: 500px; margin-top: 4px; color: var(--muted); line-height: 1.35; }
.price-edit-row td { vertical-align: middle; }
.price-edit-row td:nth-child(3), .price-edit-row td:nth-child(4), .price-edit-row td:nth-child(5) { width: 120px; }
.price-edit-row td:last-child { width: 62px; text-align: center; }
.price-edit-main { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(280px, 1.7fr); gap: 6px; }
.price-edit-main input, .price-edit-main select, .price-number-input { height: 31px; padding: 5px 7px; border-radius: 4px; font-size: 9.5px; }
.price-edit-main input[data-price-field="note"] { grid-column: 1 / -1; }
.price-delete-row { width: 28px; height: 28px; border: 1px solid #e0bcbc; border-radius: 4px; color: #a32828; background: #fff7f7; font-size: 16px; }
.price-delete-row:hover { background: #ffeaea; }
.price-table .price-category-row th { position: static; padding: 8px 12px; border-top: 1px solid #cbd3dc; border-bottom: 1px solid #cbd3dc; color: #24303d; background: #e7ebef; font-size: 10.5px; text-align: left; }
.price-table .price-category-row:first-child th { border-top: 0; }
.price-edit-category-row th div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price-edit-category-row button { min-height: 25px; padding: 0 9px; border: 1px solid #b5c0cc; border-radius: 4px; color: #344256; background: white; font-size: 8.5px; font-weight: 700; }
.price-unavailable { color: #a1a8b0; }
.price-empty { padding: 32px !important; color: var(--muted); text-align: center !important; }

.settings-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.settings-header h1 { margin: 4px 0 0; font-size: 24px; }
.settings-section { padding: 18px 0; border-bottom: 1px solid #e1e5ea; }
.settings-section h2 { margin: 0 0 14px; font-size: 14px; }
.user-admin-panel { margin-bottom: 14px; padding: 12px; border: 1px solid #dce2e8; border-radius: 5px; background: #f7f9fb; }
.create-user-form { display: grid; grid-template-columns: 1.1fr .8fr .7fr .8fr .9fr auto; gap: 10px; align-items: end; }
.create-user-form input, .create-user-form select { height: 36px; font-size: 11px; }
.create-user-form button { white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; max-width: 1050px; }
.settings-grid .settings-wide { grid-column: span 2; }
.settings-locations { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 1150px; }
.settings-grid input, .settings-locations input { height: 38px; font-size: 11px; }
.settings-rules { display: flex; align-items: end; gap: 18px; }
.settings-rules label { width: 300px; }
.settings-rules select { height: 38px; margin-top: 5px; }
.settings-rules p { max-width: 650px; margin: 0 0 7px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.permission-matrix { max-width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: 5px; }
.permission-row { display: grid; grid-template-columns: minmax(250px, 1.4fr) repeat(8, minmax(120px, 1fr)); min-width: 1400px; align-items: stretch; border-top: 1px solid var(--border); }
.permission-row:first-child { border-top: 0; }
.permission-row > * { min-width: 0; padding: 10px; border-left: 1px solid var(--border); }
.permission-row > *:first-child { border-left: 0; }
.permission-row.header { color: var(--muted); background: #f3f5f7; font-size: 9px; font-weight: 700; }
.permission-employee strong, .permission-employee span { display: block; }
.permission-employee strong { font-size: 11px; }
.permission-employee span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.receipt-prefix-editor { display: grid; grid-template-columns: 74px auto; gap: 6px; align-items: center; margin-top: 7px; }
.receipt-prefix-editor input { height: 28px; padding: 5px 7px; font-size: 10px; }
.receipt-prefix-editor button { min-height: 28px; white-space: nowrap; }
.permission-cell { display: grid; place-items: center; }
.permission-cell input { width: 18px; height: 18px; }
.settings-footnote { color: var(--muted); font-size: 10px; }

.analytics-workspace { overflow: auto; }
.analytics-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.analytics-header h1 { margin: 4px 0 2px; font-size: 24px; }
.analytics-header span { color: var(--muted); font-size: 10px; }
.analytics-toolbar { display: grid; grid-template-columns: minmax(230px, 1.4fr) 180px 230px auto; align-items: end; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.analytics-toolbar label { font-size: 10px; font-weight: 700; }
.analytics-toolbar select { height: 38px; margin-top: 5px; font-size: 11px; }
.analytics-toolbar .button { height: 38px; }
.analytics-summary { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--border); }
.analytics-metric { min-height: 76px; padding: 14px 16px; border-right: 1px solid var(--border); }
.analytics-metric:first-child { padding-left: 0; }
.analytics-metric:last-child { border-right: 0; }
.analytics-metric span, .analytics-metric strong { display: block; }
.analytics-metric span { color: var(--muted); font-size: 9px; }
.analytics-metric strong { margin-top: 8px; font-size: 19px; }
.analytics-metric.alert strong { color: var(--red); }
.analytics-details { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding-top: 18px; }
.analytics-block h2 { margin: 0 0 10px; font-size: 13px; }
.analytics-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); font-size: 10px; }
.analytics-table th, .analytics-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.analytics-table th { color: var(--muted); background: #f3f5f7; }
.analytics-table td:last-child, .analytics-table th:last-child { text-align: right; }
.analytics-table tr:last-child td { border-bottom: 0; }

.schedule-toolbar { min-height: 58px; display: grid; grid-template-columns: 210px minmax(180px, 1fr) auto auto; align-items: center; gap: 14px; margin-top: 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.week-navigation { display: flex; align-items: center; gap: 7px; }
.icon-button.bordered { border-color: #cfd6df; background: white; font-size: 23px; }
.week-title { justify-self: center; font-size: 14px; }
.schedule-role-filter { display: inline-flex; border: 1px solid #cfd6df; border-radius: 5px; overflow: hidden; background: white; }
.schedule-role-filter button { min-height: 30px; padding: 0 11px; border: 0; border-left: 1px solid #dfe4ea; color: #596574; background: white; font-size: 9px; font-weight: 700; }
.schedule-role-filter button:first-child { border-left: 0; }
.schedule-role-filter button.active { color: #1457b8; background: var(--blue-soft); }
.schedule-legend { display: flex; align-items: center; justify-content: flex-end; gap: 13px; color: var(--muted); font-size: 9px; }
.schedule-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: #9aa4b1; }
.legend-dot.arrived { background: var(--green); }
.legend-dot.expected { background: #d49a00; }
.legend-dot.day-off { background: #b5bdc7; }
.schedule-summary { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); }
.schedule-summary div { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-right: 1px solid var(--border); }
.schedule-summary div:first-child { padding-left: 0; }
.schedule-summary div:last-child { border-right: 0; padding-right: 0; }
.schedule-summary span { color: var(--muted); font-size: 10px; }
.schedule-summary strong { font-size: 17px; }
.schedule-table-wrap { flex: 1; min-height: 0; overflow: auto; border-bottom: 1px solid var(--border); }
.schedule-table { width: 100%; min-width: 1040px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.schedule-table th { position: sticky; top: 0; z-index: 2; height: 52px; padding: 8px 10px; border-right: 1px solid #dfe4ea; border-bottom: 1px solid #ccd3db; background: #f7f9fb; text-align: left; vertical-align: middle; font-size: 11px; }
.schedule-table th:last-child { border-right: 0; }
.schedule-table th span, .schedule-table th small { display: block; }
.schedule-table th small { margin-top: 3px; color: var(--muted); font-size: 8.5px; font-weight: 400; }
.schedule-table .date-column { width: 104px; }
.schedule-table .manager-column { width: 205px; background: #f4faf8; }
.schedule-table .day-off-column { width: 155px; background: #f2f4f6; }
.schedule-table.filter-master .manager-column { display: none; }
.schedule-table.filter-manager .master-column { display: none; }
.schedule-table.filter-manager { min-width: 560px; }
.schedule-table.filter-manager .manager-column { width: auto; }
.schedule-table td { height: 72px; padding: 7px 8px; border-right: 1px solid #e0e5eb; border-bottom: 1px solid #e0e5eb; vertical-align: top; background: white; }
.schedule-table td:last-child { border-right: 0; background: #fafbfc; }
.schedule-row.today td { background: #f5f9ff; }
.schedule-row.today td:last-child { background: #f1f5fa; }
.schedule-row.today td.manager-column { background: #eef8f5; }
.schedule-date strong, .schedule-date span { display: block; }
.schedule-date strong { font-size: 12px; }
.schedule-date span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.today-label { display: inline-block; margin-top: 7px; padding: 2px 5px; border-radius: 3px; color: #1457b8; background: #e6f0ff; font-size: 8px; font-weight: 700; }
.shift-list { display: grid; gap: 5px; }
.shift-entry { min-height: 25px; display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid #dde3e9; border-radius: 4px; background: white; }
.schedule-workspace.editing .shift-entry { grid-template-columns: 7px minmax(0, 1fr) auto 22px; }
.shift-entry.replacement { border-color: #e7b360; background: #fffaf1; }
.shift-status { width: 7px; height: 7px; border-radius: 50%; background: #d49a00; }
.shift-entry.arrived .shift-status { background: var(--green); }
.shift-entry.late .shift-status { background: var(--red); }
.shift-entry.planned .shift-status { background: #8793a1; }
.shift-person { min-width: 0; font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-entry.master .shift-person { color: #245f9e; }
.shift-person small { margin-left: 5px; padding: 2px 4px; border-radius: 3px; color: #596574; background: #edf0f3; font-size: 7px; font-weight: 700; }
.shift-entry.manager { border-color: #b9d8d1; background: #f5fbf9; }
.shift-entry.manager .shift-person { color: #176b5b; }
.shift-entry.manager .shift-person small { color: #176b5b; background: #dff1ec; }
.schedule-workspace.editing .shift-entry, .schedule-workspace.editing .day-off-person { cursor: grab; }
.schedule-workspace.editing .shift-entry:active, .schedule-workspace.editing .day-off-person:active { cursor: grabbing; }
.shift-entry.dragging, .day-off-person.dragging { opacity: .45; }
.schedule-drop-zone.drag-over { outline: 2px solid #4b8fe8; outline-offset: -3px; background: #edf5ff !important; }
.shift-time { color: var(--muted); font-size: 8.5px; white-space: nowrap; }
.shift-note { grid-column: 2 / -1; color: var(--orange); font-size: 8px; font-weight: 700; }
.shift-remove-button { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #e1a5a5; border-radius: 3px; color: #a52626; background: #fff7f7; font-size: 14px; line-height: 1; }
.shift-remove-button:hover { color: white; background: var(--red); }
.day-off-list { display: flex; flex-wrap: wrap; gap: 4px; }
.day-off-person { padding: 4px 6px; border-radius: 3px; color: #5e6875; background: #eceff2; font-size: 9px; }
.empty-shift { display: inline-block; padding: 6px 0; color: #98a2ae; font-size: 9px; }
.cell-edit-button { width: 100%; min-height: 25px; border: 1px dashed #8bb2e8; border-radius: 4px; color: var(--blue); background: #f6f9ff; font-size: 9px; font-weight: 700; }
.cell-edit-button:hover { background: var(--blue-soft); }
.schedule-workspace.editing .schedule-table td:not(.schedule-date) { background: #fcfdff; }
.schedule-footer { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 9px; }

.modal { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 28px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 32, .62); }
.modal-panel { position: relative; width: min(820px, 94vw); height: min(880px, 92vh); display: flex; flex-direction: column; border-radius: 7px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.28); overflow: hidden; }
.modal-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 3px 0 0; font-size: 18px; }
.modal-actions { display: flex; align-items: center; gap: 8px; }
.receipt-print-summary { padding: 6px 8px; border: 1px solid #d3d9e0; border-radius: 4px; color: #586575; background: #f7f9fb; font-size: 10px; font-weight: 700; }
.order-type-panel { position: relative; width: min(650px, 94vw); border-radius: 7px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.28); overflow: hidden; }
.order-type-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 22px; }
.order-type-option { min-height: 190px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; padding: 22px; border: 1px solid #ccd4de; border-radius: 6px; color: #17202a; background: white; text-align: left; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.order-type-option:hover, .order-type-option:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,224,.12); transform: translateY(-1px); outline: none; }
.order-type-option.manufacture { border-top: 4px solid #1769e0; }
.order-type-option.repair { border-top: 4px solid #168267; }
.order-type-option strong { margin-top: 28px; font-size: 22px; }
.order-type-option > span:last-child { margin-top: 7px; color: var(--muted); font-size: 12px; }
.order-type-number { color: #7b8694; font-size: 11px; font-weight: 700; }
.client-lookup-panel { position: relative; width: min(540px, 94vw); border-radius: 7px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.28); overflow: hidden; }
.client-lookup-form { display: grid; gap: 14px; padding: 22px; }
.client-phone-field { font-size: 12px; font-weight: 700; }
.client-phone-field input { height: 50px; margin-top: 7px; font-size: 18px; }
.client-phone-field input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 2px rgba(201,56,56,.12); }
.field-error { margin: -7px 0 0; color: var(--red); font-size: 11px; font-weight: 700; }
.existing-client-result { display: grid; gap: 5px; padding: 16px; border: 1px solid #b9d8d1; border-left: 4px solid var(--green); border-radius: 5px; background: #f5fbf9; }
.existing-client-result strong { font-size: 18px; }
.existing-client-result > span:not(.result-label) { color: var(--muted); font-size: 12px; }
.result-label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.correction-trigger { justify-self: start; margin-top: 6px; padding: 0; }
.new-client-fields, .client-correction-fields { padding: 16px; border: 1px solid #d7dee7; border-radius: 5px; background: #f8fafc; }
.new-client-fields .field-grid, .client-correction-fields .field-grid { margin-top: 10px; }
.client-correction-fields { display: grid; gap: 10px; }
.client-correction-fields .button { justify-self: start; }
.correction-state { margin: 0; color: var(--green); font-size: 11px; font-weight: 700; }
.client-lookup-actions { display: flex; justify-content: flex-end; padding-top: 4px; }
.client-lookup-actions .button { min-width: 190px; }
.receipt-preview { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 22px; background: #e9edf1; }
.receipt-paper { width: 595px; min-height: 842px; background: white; color: #111; padding: 26px; box-shadow: 0 1px 4px rgba(0,0,0,.14); font-family: Arial, sans-serif; }
.receipt-document { width: 595px; display: grid; gap: 22px; color: #111; font-family: Arial, sans-serif; }
.receipt-page { position: relative; }
.receipt-half { min-height: 382px; }
.receipt-half + .receipt-half { border-top: 1px dashed #333; margin-top: 10px; padding-top: 10px; }
.receipt-title { text-align: center; font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.receipt-jwt-header { position: relative; }
.receipt-header-columns { display: grid; grid-template-columns: 1fr 1.08fr; gap: 16px; align-items: start; }
.receipt-header-columns .receipt-meta { grid-template-columns: 88px 1fr; gap: 3px; font-size: 8px; }
.receipt-company { display: grid; gap: 2px; font-size: 8px; line-height: 1.25; }
.receipt-company strong { font-size: 8.5px; }
.receipt-page-number { position: absolute; top: 26px; right: 26px; font-size: 8px; }
.receipt-continuation-meta { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid #555; border-bottom: 1px solid #555; font-size: 9px; }
.receipt-meta { display: grid; grid-template-columns: 120px 1fr; gap: 4px; font-size: 10px; }
.receipt-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 9px; }
.receipt-table th, .receipt-table td { border: 1px solid #555; padding: 3px; text-align: left; }
.receipt-total { display: flex; justify-content: space-between; margin-top: 10px; font-size: 10px; font-weight: 700; }
.receipt-sign { margin-top: 14px; font-size: 9px; text-align: center; }
.receipt-continued { margin-top: 14px; color: #444; font-size: 9px; text-align: right; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 18px); padding: 11px 16px; border-radius: 5px; background: #17202a; color: white; font-size: 12px; opacity: 0; pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.print-sheet { display: none; }

@media (max-width: 1360px) {
  .workspace { grid-template-columns: 68px 285px minmax(700px, 1fr); }
  .topbar { grid-template-columns: 285px 1fr auto; }
  .schedule-workspace { padding-left: 16px; padding-right: 16px; }
  .schedule-toolbar { grid-template-columns: 180px minmax(150px, 1fr) auto auto; gap: 9px; }
  .schedule-role-filter button { padding: 0 8px; }
  .schedule-legend { gap: 8px; }
}

@media (max-width: 640px) {
  .order-type-options { grid-template-columns: 1fr; }
  .order-type-option { min-height: 140px; }
}

@media print {
  @page { size: A4 portrait; margin: 7mm; }
  body { min-width: 0; background: white; }
  .login-screen, .app, .toast { display: none !important; }
  .print-sheet { display: block; color: #000; font-family: Arial, sans-serif; }
  .print-sheet .receipt-paper { width: 100%; padding: 0; box-shadow: none; }
  .print-sheet .compact-receipt { min-height: 0; }
  .print-sheet .receipt-document { width: 100%; display: block; }
  .print-sheet .receipt-page { min-height: 283mm; break-after: page; page-break-after: always; }
  .print-sheet .receipt-page:last-child { break-after: auto; page-break-after: auto; }
  .print-sheet .receipt-page-number { top: 0; right: 0; }
  .print-sheet .receipt-header-columns .receipt-meta { grid-template-columns: 23mm 1fr; gap: 3px; font-size: 8px; }
  .print-sheet .receipt-company { font-size: 8px; }
  .print-sheet .receipt-half { min-height: 132mm; }
  .print-sheet .receipt-title { font-size: 15px; margin-bottom: 10px; }
  .print-sheet .receipt-meta { grid-template-columns: 34mm 1fr; gap: 4px; font-size: 10px; }
  .print-sheet .receipt-table { margin-top: 12px; font-size: 9px; }
  .print-sheet .receipt-table th, .print-sheet .receipt-table td { padding: 7px; }
  .print-sheet .receipt-total { margin-top: 10px; font-size: 10px; }
  .print-sheet .receipt-sign { margin-top: 16px; font-size: 9px; }
  .print-sheet .receipt-half + .receipt-half { margin-top: 4mm; padding-top: 4mm; }
}
