:root {
  --ink: #17202e;
  --muted: #6e7888;
  --line: #e8e9ec;
  --canvas: #f5f6f8;
  --panel: #ffffff;
  --nav: #171d28;
  --nav-muted: #9ca6b6;
  --accent: #ed6b3f;
  --accent-dark: #d4542b;
  --accent-soft: #fff0ea;
  --blue: #4778e8;
  --blue-soft: #edf3ff;
  --green: #1f9d73;
  --green-soft: #e9f8f2;
  --yellow: #d99719;
  --yellow-soft: #fff7df;
  --red: #d95656;
  --red-soft: #ffeded;
  --violet: #7d62d9;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 30px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-width: 320px; overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--nav); color: white; display: flex; flex-direction: column; padding: 22px 14px 16px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 25px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent); font-weight: 900; font-size: 20px; transform: rotate(-4deg); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.brand strong { letter-spacing: .13em; font-size: 15px; }
.brand small, .workspace-switcher small { display: block; color: var(--nav-muted); font-size: 11px; margin-top: 2px; }
.nav { display: grid; gap: 4px; }
.nav a { min-height: 43px; display: grid; grid-template-columns: 27px 1fr auto; align-items: center; gap: 8px; padding: 0 11px; border-radius: 9px; color: #aeb7c5; font-size: 13px; font-weight: 580; transition: .16s ease; }
.nav a:hover { color: white; background: rgba(255,255,255,.05); }
.nav a.active { color: white; background: rgba(255,255,255,.1); }
.nav a.active .nav-icon { color: var(--accent); }
.nav-icon { font-size: 19px; width: 22px; text-align: center; }
.nav b { font-size: 10px; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.12); color: white; }
.nav i { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; display: none; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
.workspace-switcher { width: 100%; border: 0; background: transparent; color: white; display: grid; grid-template-columns: 35px 1fr auto; text-align: left; align-items: center; gap: 9px; padding: 8px; border-radius: 9px; cursor: pointer; }
.workspace-switcher:hover { background: rgba(255,255,255,.05); }
.workspace-switcher strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-size: 11px; font-weight: 750; color: #5c473f; background: #f4d9cd; }
.sync-state { color: #858f9f; font-size: 10px; padding: 8px 10px 0; }
.sync-state span { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #41bf8e; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 15%, #303949 0, var(--nav) 40%, #10151e 100%); }
.login-card { width: min(430px, 100%); padding: 38px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 35px; }
.login-brand strong { display: block; letter-spacing: .13em; }
.login-brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.login-card h1 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.login-copy { margin: 9px 0 25px; color: var(--muted); font-size: 12px; }
.login-button { width: 100%; margin-top: 5px; }
.login-error { margin: 0; padding: 10px 12px; border-radius: 8px; color: var(--red); background: var(--red-soft); font-size: 11px; }

.main, .content, .panel { min-width: 0; }
.topbar { height: 68px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 0 30px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.global-search { width: min(540px, 55vw); height: 39px; display: flex; align-items: center; gap: 10px; border: 1px solid #e1e3e7; border-radius: 9px; padding: 0 11px; background: #fafafa; color: #8b93a1; cursor: pointer; text-align: left; font-size: 12px; }
.global-search span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
kbd { font-size: 10px; border: 1px solid #d8dadd; border-bottom-width: 2px; background: white; border-radius: 5px; padding: 2px 6px; color: #79808b; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); background: white; border-radius: 9px; cursor: pointer; font-size: 18px; }
.icon-button:hover { background: #f6f7f8; }
.notification-button { position: relative; }
.notification-button span { position: absolute; right: 8px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); border: 1px solid white; }
.primary-button, .secondary-button, .ghost-button { min-height: 39px; border-radius: 8px; padding: 0 15px; border: 1px solid transparent; display: inline-flex; justify-content: center; align-items: center; gap: 7px; font-weight: 680; font-size: 12px; cursor: pointer; }
.primary-button { color: white; background: var(--accent); box-shadow: 0 3px 10px rgba(237,107,63,.2); }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button { background: white; border-color: #dfe2e7; }
.secondary-button:hover { background: #f8f8f9; }
.ghost-button { background: transparent; color: var(--muted); padding: 0 8px; }
.mobile-menu { display: none; }

.content { padding: 29px 30px 50px; max-width: 1540px; margin: auto; }
.page-loader { min-height: 60vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.page-loader span { width: 32px; height: 32px; border: 3px solid #eceef1; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-weight: 760; font-size: 10px; }
.page-head h1 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.page-head p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.page-actions { display: flex; gap: 8px; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 22px; }
.kpi-card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 17px; box-shadow: 0 1px 1px rgba(16,24,40,.02); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.kpi-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; font-size: 14px; }
.kpi-icon.orange { color: var(--accent); background: var(--accent-soft); }
.kpi-icon.blue { color: var(--blue); background: var(--blue-soft); }
.kpi-icon.green { color: var(--green); background: var(--green-soft); }
.kpi-icon.red { color: var(--red); background: var(--red-soft); }
.kpi-icon.yellow { color: var(--yellow); background: var(--yellow-soft); }
.kpi-value { display: block; font-size: 23px; letter-spacing: -.04em; margin-top: 9px; }
.kpi-note { margin-top: 4px; font-size: 10px; color: #959ca7; }
.kpi-note strong { color: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr); gap: 16px; }
.dashboard-grid .span-2 { grid-column: 1 / -1; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); overflow: hidden; }
.panel-header { min-height: 59px; padding: 13px 17px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 14px; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.panel-body { padding: 17px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th { height: 40px; padding: 0 14px; background: #fafafa; border-bottom: 1px solid var(--line); color: #858d9a; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; text-align: left; font-weight: 760; }
td { padding: 12px 14px; border-bottom: 1px solid #eff0f2; font-size: 11px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: .12s ease; }
tbody tr:hover { background: #fcfcfd; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: #fffaf8; }
.cell-title { font-weight: 700; font-size: 11px; }
.cell-subtitle { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 720; white-space: nowrap; background: #f1f3f5; color: #6b7280; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.orange { color: #cc6038; background: var(--accent-soft); }
.status.blue { color: #3566cf; background: var(--blue-soft); }
.status.green { color: #18815e; background: var(--green-soft); }
.status.red { color: #c74848; background: var(--red-soft); }
.status.yellow { color: #a97513; background: var(--yellow-soft); }
.status.violet { color: #6f54c1; background: #f1edff; }
.priority { font-size: 9px; font-weight: 700; color: var(--muted); }
.priority.pilny { color: var(--red); }
.employee { display: inline-flex; align-items: center; gap: 7px; }
.employee-dot { width: 7px; height: 7px; border-radius: 50%; }

.timeline { position: relative; padding-left: 47px; }
.timeline::before { content: ""; position: absolute; left: 28px; top: 10px; bottom: 10px; width: 1px; background: var(--line); }
.timeline-item { position: relative; min-width: 0; min-height: 57px; margin-bottom: 9px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 11px; border: 1px solid var(--line); border-left: 3px solid var(--item-color, var(--blue)); border-radius: 8px; background: white; }
.timeline-time { position: absolute; right: calc(100% + 19px); top: 12px; font-size: 9px; font-weight: 700; color: var(--muted); }
.timeline-item strong { font-size: 11px; }
.timeline-item small { display: block; overflow: hidden; color: var(--muted); font-size: 9px; margin-top: 4px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-item .status { align-self: start; }
.empty-state { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 5px; }

.quick-actions { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.quick-action { min-height: 79px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: white; text-align: left; cursor: pointer; }
.quick-action:hover { border-color: #d5d8dd; box-shadow: 0 4px 18px rgba(16,24,40,.06); transform: translateY(-1px); }
.quick-action span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.quick-action strong { display: block; font-size: 10px; }
.quick-action small { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-input { position: relative; }
.search-input span { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); color: var(--muted); }
.search-input input { height: 36px; width: 240px; border: 1px solid #dfe2e7; border-radius: 8px; padding: 0 10px 0 30px; outline: none; font-size: 11px; }
.search-input input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: #aeb9cb; box-shadow: 0 0 0 3px rgba(71,120,232,.08); }
.filter-button { height: 36px; padding: 0 11px; border: 1px solid #dfe2e7; border-radius: 8px; background: white; color: var(--muted); font-size: 10px; cursor: pointer; }
.filter-button.active { color: var(--accent); background: var(--accent-soft); border-color: #f3c9b9; }
.summary-strip { display: flex; gap: 20px; align-items: center; color: var(--muted); font-size: 10px; }
.summary-strip strong { color: var(--ink); font-size: 12px; }

.client-grid, .tire-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 15px; }
.client-card, .tire-card { border: 1px solid var(--line); border-radius: 10px; padding: 15px; background: white; cursor: pointer; transition: .15s ease; }
.client-card:hover, .tire-card:hover { border-color: #d3d6db; box-shadow: var(--shadow); transform: translateY(-1px); }
.client-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.client-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #6f5147; font-size: 11px; font-weight: 760; background: #f4ded6; }
.client-card h3, .tire-card h3 { margin: 0; font-size: 12px; }
.client-card p, .tire-card p { margin: 4px 0 0; font-size: 9px; color: var(--muted); }
.client-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.client-stats span { color: var(--muted); font-size: 8px; }
.client-stats strong { display: block; color: var(--ink); font-size: 11px; margin-top: 3px; }

.week-strip { display: grid; grid-template-columns: repeat(7,1fr); gap: 7px; padding: 0 0 14px; }
.day-chip { min-height: 58px; border: 1px solid var(--line); background: white; border-radius: 9px; cursor: pointer; color: var(--muted); }
.day-chip strong { display: block; font-size: 16px; color: var(--ink); margin-top: 2px; }
.day-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.day-chip.active strong { color: var(--accent); }
.calendar-toolbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 14px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.calendar-view-switch { display: flex; padding: 3px; border-radius: 8px; background: #f3f4f6; }
.calendar-view-switch button { height: 31px; padding: 0 13px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.calendar-view-switch button.active { background: white; color: var(--ink); font-weight: 750; box-shadow: 0 1px 4px rgba(16,24,40,.1); }
.calendar-period-nav { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; }
.calendar-period-nav strong { overflow: hidden; font-size: 12px; text-align: center; text-overflow: ellipsis; text-transform: capitalize; white-space: nowrap; }
.month-calendar { margin-bottom: 14px; overflow: hidden; }
.month-calendar-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: center; }
.month-calendar-head h2 { margin: 0; font-size: 15px; text-transform: capitalize; }
.month-calendar-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.month-weekdays, .month-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.month-weekdays { background: #fafafa; border-bottom: 1px solid var(--line); }
.month-weekdays span { padding: 8px 4px; color: var(--muted); font-size: 9px; font-weight: 700; text-align: center; }
.month-day { min-height: 62px; padding: 8px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; color: var(--ink); cursor: pointer; text-align: left; }
.month-day:nth-child(7n) { border-right: 0; }
.month-day span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 700; }
.month-day b { display: inline-block; min-width: 18px; margin-top: 5px; padding: 2px 5px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 8px; text-align: center; }
.month-day.outside { background: #fafafa; color: #a8adb5; }
.month-day:hover { background: #fffaf7; }
.month-day.active { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.month-day.active span { background: var(--accent); color: white; }
.planner-panel { overflow: hidden; }
.day-planner { display: grid; grid-template-columns: repeat(var(--planner-columns),minmax(220px,1fr)); overflow-x: auto; }
.employee-lane { display: flex; min-height: 390px; padding: 14px; border-right: 1px solid var(--line); flex-direction: column; }
.employee-lane:last-child { border-right: 0; }
.employee-lane > header { display: flex; align-items: center; gap: 8px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.employee-lane > header i, .week-employee i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.employee-lane > header strong, .employee-lane > header small { display: block; }
.employee-lane > header strong { font-size: 11px; }
.employee-lane > header small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.employee-lane-events { display: grid; align-content: start; gap: 7px; padding: 11px 0; flex: 1; }
.employee-lane-events > p { margin: 14px 0; color: var(--muted); font-size: 9px; text-align: center; }
.planner-event { min-width: 0; padding: 8px; border-left: 3px solid var(--item-color); border-radius: 7px; background: #f7f8fa; }
.planner-event span, .planner-event strong, .planner-event small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planner-event span { color: var(--item-color); font-size: 8px; font-weight: 750; }
.planner-event strong { margin-top: 3px; font-size: 9px; }
.planner-event small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.lane-plan-button { height: 32px; border: 1px dashed #cfd4dc; border-radius: 7px; background: white; color: var(--muted); font-size: 9px; cursor: pointer; }
.lane-plan-button:hover, .week-cell > button:hover { border-color: var(--accent); color: var(--accent); }
.week-planner-wrap { overflow-x: auto; }
.week-planner { display: grid; grid-template-columns: 150px repeat(7,minmax(140px,1fr)); min-width: 1130px; }
.week-planner-corner, .week-day-head, .week-employee, .week-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.week-planner-corner { display: grid; min-height: 64px; place-items: center; background: #fafafa; color: var(--muted); font-size: 9px; font-weight: 700; }
.week-day-head { min-height: 64px; border-top: 0; border-left: 0; background: #fafafa; cursor: pointer; }
.week-day-head span, .week-day-head strong, .week-day-head small { display: block; }
.week-day-head span { color: var(--muted); font-size: 8px; text-transform: capitalize; }
.week-day-head strong { margin: 2px 0; font-size: 14px; }
.week-day-head small { color: var(--accent); font-size: 8px; }
.week-employee { min-height: 120px; padding: 12px; background: #fafafa; }
.week-employee strong, .week-employee small { display: block; }
.week-employee strong { margin-top: 7px; font-size: 10px; }
.week-employee small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.week-cell { display: grid; min-height: 120px; align-content: start; gap: 5px; padding: 6px; }
.week-cell > button { height: 24px; border: 1px dashed #d8dce2; border-radius: 6px; background: transparent; color: #a3a9b2; cursor: pointer; }
.calendar-board { display: grid; grid-template-columns: 76px repeat(4,1fr); min-width: 850px; }
.calendar-board > div { min-height: 64px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-board .calendar-head { min-height: 48px; background: #fafafa; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.calendar-board .time-label { color: var(--muted); font-size: 9px; text-align: center; padding-top: 8px; background: #fafafa; }
.calendar-cell { position: relative; padding: 4px; }
.calendar-event { height: 100%; border-radius: 7px; padding: 7px; background: var(--blue-soft); border-left: 3px solid var(--blue); overflow: hidden; }
.calendar-event strong { display: block; font-size: 9px; }
.calendar-event small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }

.stock-level { min-width: 110px; }
.stock-level div { height: 5px; background: #edf0f2; border-radius: 5px; overflow: hidden; margin-top: 5px; }
.stock-level i { height: 100%; display: block; background: var(--green); border-radius: 5px; }
.stock-level.low i { background: var(--red); }
.amount { font-weight: 720; text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.small-button { height: 27px; min-width: 27px; border: 1px solid var(--line); border-radius: 7px; background: white; cursor: pointer; font-size: 10px; }
.small-button:hover { background: #f6f7f8; }

.tire-card { cursor: default; }
.tire-visual { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.tire-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 7px double #4e5662; border-radius: 50%; color: #4e5662; font-size: 8px; }
.tread { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin: 13px 0; }
.tread div { background: #f7f8f9; border-radius: 7px; padding: 8px; }
.tread span { display: block; font-size: 8px; color: var(--muted); }
.tread strong { display: block; font-size: 13px; margin-top: 3px; }
.tread strong.warn { color: var(--yellow); }
.location-tag { display: flex; justify-content: space-between; align-items: center; padding-top: 11px; border-top: 1px solid var(--line); font-size: 9px; color: var(--muted); }
.location-tag strong { color: var(--ink); font-size: 11px; }

.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.chart { height: 210px; display: flex; align-items: end; gap: 20px; padding: 22px 12px 0; border-bottom: 1px solid var(--line); }
.bar-wrap { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.bar-wrap span { font-size: 9px; color: var(--muted); }
.bar { width: min(54px, 80%); min-height: 8px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, var(--accent), #f09877); position: relative; }
.bar::after { content: attr(data-value); position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); font-size: 8px; font-weight: 700; white-space: nowrap; }
.donut-wrap { min-height: 230px; display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 20px; }
.donut { width: 145px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--accent) 0 34%, var(--blue) 34% 61%, var(--green) 61% 81%, var(--violet) 81% 94%, #dfe3e8 94%); position: relative; }
.donut::after { content: "47\A zleceń"; white-space: pre; position: absolute; inset: 29px; border-radius: 50%; display: grid; place-items: center; text-align: center; background: white; font-size: 12px; font-weight: 750; }
.legend { display: grid; gap: 10px; }
.legend div { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; font-size: 9px; color: var(--muted); }
.legend i { width: 7px; height: 7px; border-radius: 50%; }
.legend strong { color: var(--ink); }

.modal-layer[hidden] { display: none; }
.modal-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,22,33,.55); backdrop-filter: blur(3px); }
.modal { position: relative; width: min(720px, 100%); max-height: min(850px, calc(100vh - 40px)); overflow: hidden; background: white; border-radius: 14px; box-shadow: 0 28px 80px rgba(0,0,0,.22); display: flex; flex-direction: column; animation: modal-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.modal > header { padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.stack-form { display: grid; gap: 14px; }
.stack-form > label:not(.check-row), .stack-form .form-grid > label { display: grid; gap: 6px; color: var(--ink); font-size: 10px; font-weight: 700; }
.stack-form > label:not(.check-row) input, .stack-form > label:not(.check-row) select, .stack-form > label:not(.check-row) textarea,
.stack-form .form-grid input, .stack-form .form-grid select, .stack-form .form-grid textarea { width: 100%; min-width: 0; min-height: 39px; border: 1px solid #dde1e6; border-radius: 8px; padding: 9px 11px; background: white; outline: none; font-size: 11px; font-weight: 400; }
.stack-form textarea { min-height: 76px; resize: vertical; }
.stack-form small { color: var(--muted); font-size: 9px; font-weight: 400; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1/-1; }
.field label { font-size: 10px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #dde1e6; border-radius: 8px; min-height: 39px; padding: 9px 11px; font-size: 11px; outline: none; background: white; }
.field textarea { min-height: 85px; resize: vertical; }
.field small { color: var(--muted); font-size: 9px; }
.inline-field { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.order-client-actions { grid-template-columns: minmax(180px,1fr) auto auto auto; }
.form-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; padding-top: 15px; border-top: 1px solid var(--line); }
.detail-hero { display: grid; grid-template-columns: 50px 1fr; align-items: center; gap: 12px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.detail-hero .client-avatar { width: 50px; height: 50px; }
.detail-hero h3 { margin: 0; }
.detail-hero p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.detail-actions { display: flex; justify-content: flex-end; padding-top: 12px; }
.vehicle-list { display: grid; gap: 8px; margin: 14px 0; }
.vehicle-row { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; }
.vehicle-row strong { font-size: 11px; }
.vehicle-row small { color: var(--muted); font-size: 9px; }

.order-modal { width: min(1040px, 100%); }
.order-modal .modal-body { padding: 0; }
.order-toolbar { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: #fafafa; }
.order-toolbar > div { display: flex; align-items: center; gap: 8px; }
.order-client-line { color: var(--muted); font-size: 10px; }
.order-section { padding: 20px; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-title > span { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; }
.section-title h3 { margin: 0; font-size: 13px; }
.section-title p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.order-items-head, .order-item-row { display: grid; grid-template-columns: 88px minmax(180px,1.5fr) minmax(120px,.8fr) 70px 105px 105px 29px; gap: 7px; align-items: center; }
.order-items-head { padding: 0 5px 7px; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.order-item-row { padding: 7px 5px; border-top: 1px solid #eff0f2; }
.order-item-row input, .order-item-row select { width: 100%; min-width: 0; height: 34px; border: 1px solid #dde1e6; border-radius: 7px; padding: 0 8px; background: white; font-size: 10px; outline: none; }
.order-item-row .item-total { text-align: right; font-size: 10px; }
.order-items-actions { display: flex; justify-content: space-between; align-items: flex-end; gap: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.order-items-actions > div { display: flex; gap: 7px; }
.order-live-total { display: flex; gap: 14px; color: var(--muted); font-size: 9px; }
.order-live-total strong { display: block; margin-top: 3px; color: var(--ink); font-size: 12px; }
.purchase-modal { width: min(1080px, 100%); }
.purchase-items-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 4px; }
.purchase-items-head > div { display: grid; gap: 3px; }
.purchase-items-head small { color: var(--muted); font-size: 9px; }
.purchase-item-labels, .purchase-item-row { display: grid; grid-template-columns: 100px minmax(170px,1.4fr) 110px 70px 105px 105px 105px 29px; gap: 7px; align-items: center; }
.purchase-item-labels { padding: 6px 4px 0; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.purchase-item-row { padding: 7px 4px; border-bottom: 1px solid #eff0f2; }
.purchase-item-row input { width: 100%; min-width: 0; height: 34px; border: 1px solid #dde1e6; border-radius: 7px; padding: 0 8px; background: white; font-size: 10px; outline: none; }
.purchase-item-row .purchase-total { text-align: right; font-size: 10px; }
.hart-import-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.hart-import-summary > div { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; }
.hart-import-summary span, .hart-import-summary small { color: var(--muted); font-size: 9px; }
.hart-import-summary strong { font-size: 12px; }
.hart-import-note { padding: 11px 13px; border-radius: 8px; background: var(--accent-soft); color: #315da8; font-size: 10px; line-height: 1.45; }
.hart-import-items { display: grid; gap: 10px; }
.hart-import-item { padding: 13px; border: 1px solid var(--line); border-radius: 10px; }
.hart-import-item > header { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 10px; }
.hart-import-item > header > div { display: grid; gap: 3px; }
.hart-import-item > header > div:last-child { text-align: right; white-space: nowrap; }
.hart-import-item header span, .hart-import-item header small { color: var(--muted); font-size: 9px; }
.hart-import-item header strong { font-size: 11px; }
.hart-price-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid #eff0f2; }
.hart-price-row label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; }
.hart-price-row input, .hart-allocation-row input, .hart-allocation-row select { height: 34px; border: 1px solid #dde1e6; border-radius: 7px; padding: 0 8px; background: white; font-size: 10px; }
.hart-price-row input { width: 130px; }
.hart-remaining { color: var(--muted); font-size: 10px; }
.hart-remaining strong { color: var(--ink); }
.hart-remaining.invalid, .hart-remaining.invalid strong { color: #c0392b; }
.hart-allocations { display: grid; gap: 7px; margin: 10px 0 8px; }
.hart-allocation-row { display: grid; grid-template-columns: minmax(260px,1fr) 100px 29px; gap: 7px; }
.secondary-button.compact { min-height: 30px; padding: 0 10px; font-size: 9px; }
.hart-non-stock { padding: 10px; border-radius: 8px; background: #fff7e8; color: #8a6116; font-size: 10px; }
.consent-list { display: grid; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; }
.consent-list label { display: flex; align-items: flex-start; gap: 8px; color: #4e5969; font-size: 10px; line-height: 1.4; }
.consent-list input { accent-color: var(--accent); margin-top: 1px; }
.release-fields { margin-top: 14px; }
.sticky-form-actions { position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 13px 20px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.sticky-form-actions > span { color: var(--muted); font-size: 9px; }
.sticky-form-actions > div { display: flex; gap: 8px; }

.search-modal { width: min(620px, 100%); align-self: start; margin-top: 9vh; }
.search-box-large { display: flex; align-items: center; gap: 10px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.search-box-large input { flex: 1; border: 0; outline: 0; font-size: 14px; }
.search-results { max-height: 430px; overflow-y: auto; padding: 8px; }
.search-result { width: 100%; padding: 10px; border: 0; border-radius: 8px; background: white; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; text-align: left; align-items: center; cursor: pointer; }
.search-result:hover { background: #f6f7f9; }
.search-result .result-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.search-result strong { font-size: 11px; }
.search-result small { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
.search-result em { color: var(--muted); font-size: 8px; font-style: normal; }
.search-hint { padding: 32px; text-align: center; color: var(--muted); font-size: 10px; }

.scanner-modal { width: min(790px, 100%); }
.scanner-content { display: grid; gap: 15px; }
.camera-stage { position: relative; aspect-ratio: 1.58; overflow: hidden; border-radius: 11px; background: #111722; }
.camera-stage video { width: 100%; height: 100%; object-fit: cover; }
.camera-stage.camera-unavailable::before { content: "Brak podglądu kamery"; position: absolute; inset: 0; display: grid; place-items: center; color: #aeb7c5; font-size: 12px; }
.document-guide { position: absolute; inset: 8% 6%; border: 2px solid rgba(255,255,255,.88); border-radius: 10px; box-shadow: 0 0 0 999px rgba(10,15,24,.3); pointer-events: none; }
.document-guide::before, .document-guide::after { content: ""; position: absolute; width: 38px; height: 38px; border-color: var(--accent); border-style: solid; }
.document-guide::before { left: -3px; top: -3px; border-width: 4px 0 0 4px; border-radius: 10px 0 0; }
.document-guide::after { right: -3px; bottom: -3px; border-width: 0 4px 4px 0; border-radius: 0 0 10px; }
.scan-zone { position: absolute; min-width: 80px; min-height: 28px; padding: 4px 6px; border: 2px solid #ef5d65; border-radius: 6px; background: rgba(112,18,27,.28); color: white; box-shadow: 0 0 0 1px rgba(0,0,0,.18), inset 0 0 12px rgba(239,93,101,.12); font-size: 7px; transition: border-color .2s, background .2s, box-shadow .2s; }
.scan-zone b { display: block; overflow: hidden; max-width: 150px; margin-top: 2px; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.scan-zone.partial { border-color: #f3b43f; background: rgba(137,88,10,.28); box-shadow: 0 0 10px rgba(243,180,63,.42); }
.scan-zone.stable { border-color: #32d296; background: rgba(12,105,72,.34); box-shadow: 0 0 12px rgba(50,210,150,.5); }
.scan-zone[data-scan-zone="registration"] { left: 5%; top: 39%; width: 30%; }
.scan-zone[data-scan-zone="year"] { left: 5%; top: 50%; width: 30%; }
.scan-zone[data-scan-zone="make"] { left: 5%; top: 61%; width: 38%; }
.scan-zone[data-scan-zone="model"] { left: 5%; top: 72%; width: 38%; }
.scan-zone[data-scan-zone="vin"] { left: 45%; top: 61%; width: 48%; }
.scanner-line { position: absolute; left: 8%; right: 8%; top: 10%; height: 2px; background: linear-gradient(90deg, transparent, #ff8b63, transparent); box-shadow: 0 0 14px #ff8b63; animation: scan-line 2.4s ease-in-out infinite alternate; }
@keyframes scan-line { to { top: 88%; } }
.scanner-status { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; }
.scanner-status strong, .scanner-status small { display: block; }
.scanner-status strong { font-size: 10px; }
.scanner-status small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.scan-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.scan-fields span { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fafafa; font-size: 8px; }
.scan-fields b { display: block; overflow: hidden; margin-top: 4px; color: #9098a4; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.scan-fields span.found { border-color: #f2c8b8; background: var(--accent-soft); color: #b85b38; }
.scan-fields span.found b { color: var(--ink); }
.scan-fields span.stable { border-color: #bce7d7; background: var(--green-soft); color: var(--green); }
.scan-fields span.stable b { color: #176d52; }
.scan-pulse { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 5px var(--yellow-soft); }
.scan-pulse.ready { background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.scan-pulse.error { background: var(--red); box-shadow: 0 0 0 5px var(--red-soft); }
.scan-spinner { width: 20px; height: 20px; flex: 0 0 auto; border: 2px solid #dfe3e8; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.scanner-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.scanner-actions > div { display: flex; gap: 8px; }
.scanner-actions button:disabled { cursor: not-allowed; opacity: .48; }
.file-button { cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.scan-result-form { display: grid; gap: 16px; }
.scan-preview { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; }
.scan-preview img { width: 180px; height: 112px; object-fit: cover; border-radius: 7px; background: #151b25; }
.scan-preview p { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.form-warning { grid-column: 1 / -1; display: grid; gap: 4px; padding: 11px 13px; border: 1px solid #ef9aa0; border-radius: 9px; background: #fff0f1; color: #8d2630; }
.form-warning strong { font-size: 10px; }
.form-warning span { font-size: 9px; line-height: 1.45; }
.photo-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.photo-actions > div:last-child { display: flex; gap: 8px; }
.photo-actions strong, .photo-actions small { display: block; }
.photo-actions strong { font-size: 11px; }
.photo-actions small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.file-button.disabled { cursor: not-allowed; opacity: .5; }
.order-photo-gallery { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; }
.order-photo-card { overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: 9px; background: white; }
.order-photo-card a { display: block; aspect-ratio: 4/3; background: #171d28; }
.order-photo-card img { width: 100%; height: 100%; display: block; object-fit: cover; }
.order-photo-card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 7px; }
.order-photo-card figcaption span { min-width: 0; font-size: 8px; font-weight: 700; }
.order-photo-card figcaption small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 7px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.photo-empty { grid-column: 1/-1; padding: 24px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); text-align: center; font-size: 9px; }
.photo-upload-status { min-height: 14px; margin-top: 8px; color: var(--accent); font-size: 9px; }
.ocr-details { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.ocr-details summary { cursor: pointer; color: var(--muted); font-size: 9px; }
.ocr-details pre { max-height: 130px; overflow: auto; margin: 10px 0 0; padding: 9px; background: #f5f6f8; white-space: pre-wrap; font-size: 8px; }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 390px; display: grid; grid-template-columns: 27px 1fr; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: #17202e; color: white; box-shadow: 0 15px 40px rgba(0,0,0,.2); font-size: 10px; animation: toast-in .2s ease; }
.toast span { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: #2ca77b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

.admin-grid { display: grid; gap: 18px; }
.notification-settings .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.notification-settings .form-actions > span { color: var(--muted); font-size: 9px; }
.notification-toggle { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; cursor: pointer; }
.notification-toggle input { margin-top: 3px; accent-color: var(--accent); }
.notification-toggle span { display: grid; gap: 4px; }
.notification-toggle strong { font-size: 11px; }
.notification-toggle small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.role-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 750; }
.role-badge.admin { color: var(--violet); background: #f0edff; }
.role-badge.worker { color: var(--green); background: var(--green-soft); }
.employee-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; }
.worker-item-list { display: grid; gap: 8px; }
.worker-item-list > div:not(.photo-empty) { display: grid; grid-template-columns: 72px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; }
.worker-item-list span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.worker-item-list strong { font-size: 11px; }
.worker-item-list em { color: var(--muted); font-size: 10px; font-style: normal; }
.report-controls { margin-bottom: 14px; padding: 15px 17px; }
.report-controls form { display: grid; grid-template-columns: 150px 150px minmax(220px,1fr) auto; align-items: end; gap: 12px; }
.report-controls label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.report-controls input, .report-controls select { height: 39px; border: 1px solid #dfe2e7; border-radius: 8px; padding: 0 10px; background: white; color: var(--ink); }
.report-tabs { display: flex; gap: 7px; margin: 2px 0 12px; overflow-x: auto; }
.report-summary-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; }
.report-kpis { grid-template-columns: repeat(3,1fr); margin-bottom: 16px; }
.amount.negative { color: var(--red); }
.report-print-form { gap: 16px; }
.report-print-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.report-print-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.report-print-option input { margin-top: 2px; accent-color: var(--orange); }
.report-print-option span { display: grid; gap: 3px; }
.report-print-option strong { font-size: 11px; }
.report-print-option small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.report-print-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 18px; padding: 13px; border-radius: 9px; background: var(--surface-soft); }
.report-print-details > strong { grid-column: 1/-1; font-size: 11px; }
.report-print-details .check-row { font-size: 10px; }

@media print {
  .sidebar, .topbar, .page-actions, .report-controls, .report-tabs, .toast-stack { display: none !important; }
  .app-shell { display: block; }
  .content { max-width: none; padding: 0; }
  .page-head { margin-bottom: 12px; }
  .panel, .kpi-card { break-inside: avoid; box-shadow: none; }
  .table-wrap { overflow: visible; }
  body { background: white; }
}

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3,1fr); }
  .client-grid, .tire-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 244px; transition: transform .2s ease; box-shadow: 15px 0 40px rgba(0,0,0,.18); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: grid; }
  .topbar { padding: 0 18px; }
  .global-search { width: auto; flex: 1; }
  .global-search span:nth-child(2) { display: none; }
  .global-search kbd { margin-left: auto; }
  .content { padding: 23px 18px 42px; }
  .dashboard-grid, .report-grid { grid-template-columns: 1fr; }
  .report-summary-grid { grid-template-columns: 1fr; }
  .report-kpis { grid-template-columns: repeat(2,1fr); }
  .report-controls form { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid .span-2 { grid-column: auto; }
  .order-items-head { display: none; }
  .order-item-row { grid-template-columns: 90px 1fr 70px 29px; }
  .order-item-row .item-sku { grid-column: 2 / 3; }
  .order-item-row .item-qty { grid-column: 1 / 2; }
  .order-item-row .item-price { grid-column: 2 / 3; }
  .order-item-row .item-total { grid-column: 3 / 4; grid-row: 1; }
  .order-item-row [data-remove-item] { grid-column: 4; grid-row: 1; }
  .purchase-item-labels { display: none; }
  .purchase-item-row { grid-template-columns: 90px 1fr 80px 29px; }
  .purchase-item-row .purchase-category { grid-column: 1; grid-row: 2; }
  .purchase-item-row .purchase-qty { grid-column: 2; grid-row: 2; }
  .purchase-item-row .purchase-price { grid-column: 3; grid-row: 2; }
  .purchase-item-row .purchase-sale { grid-column: 1 / 3; grid-row: 3; }
  .purchase-item-row .purchase-total { grid-column: 3; grid-row: 1; }
  .purchase-item-row [data-remove-purchase-item] { grid-column: 4; grid-row: 1; }
  .hart-import-summary { grid-template-columns: 1fr; }
  .hart-import-item > header, .hart-price-row { align-items: stretch; flex-direction: column; }
  .hart-import-item > header > div:last-child { text-align: left; }
  .hart-allocation-row { grid-template-columns: 1fr 80px 29px; }
}
@media (max-width: 680px) {
  .topbar { height: 60px; gap: 8px; }
  .topbar-actions .icon-button { display: none; }
  .topbar-actions .primary-button { width: 39px; padding: 0; font-size: 0; }
  .topbar-actions .primary-button span { font-size: 18px; }
  .content { padding: 19px 12px 35px; }
  .page-head { min-width: 0; align-items: center; }
  .page-head > div:first-child { min-width: 0; }
  .page-head h1 { font-size: 21px; }
  .page-head p:not(.eyebrow) { display: none; }
  .page-actions .secondary-button { display: none; }
  .page-actions .report-export-button { width: 39px; display: inline-flex; padding: 0; font-size: 0; }
  .page-actions .report-export-button::before { content: "⇩"; font-size: 16px; }
  .page-actions .primary-button { width: 39px; padding: 0; font-size: 0; }
  .page-actions .primary-button::before { content: "+"; font-size: 18px; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .kpi-card { padding: 13px; }
  .kpi-value { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
  .kpi-grid .kpi-card:last-child { grid-column: 1/-1; }
  .client-grid, .tire-grid { grid-template-columns: 1fr; padding: 10px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-input, .search-input input { width: 100%; }
  .toolbar-group.filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .form-grid { grid-template-columns: 1fr; }
  .report-controls form { grid-template-columns: 1fr; }
  .report-print-options, .report-print-details { grid-template-columns: 1fr; }
  .field.full, .form-actions { grid-column: auto; }
  .inline-field { grid-template-columns: 1fr; }
  .order-client-actions { grid-template-columns: 1fr; }
  .modal-layer { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .legend { width: 100%; }
  .week-strip { gap: 4px; }
  .day-chip { min-height: 50px; font-size: 9px; }
  .day-chip strong { font-size: 13px; }
  .calendar-toolbar { grid-template-columns: 1fr auto; }
  .calendar-view-switch { grid-column: 1/-1; }
  .calendar-view-switch button { flex: 1; }
  .calendar-period-nav { justify-content: flex-start; }
  .day-planner { grid-template-columns: repeat(var(--planner-columns),minmax(245px,85vw)); }
  .employee-lane { min-height: 330px; }
  .month-calendar-head { padding: 11px 9px; }
  .month-calendar-head p { display: none; }
  .month-weekdays span { font-size: 8px; }
  .month-day { min-height: 48px; padding: 5px; }
  .month-day span { width: 22px; height: 22px; font-size: 10px; }
  .month-day b { margin-top: 2px; padding: 1px 4px; }
  .timeline { padding-left: 42px; }
  .timeline::before { left: 24px; }
  .timeline-time { right: calc(100% + 17px); }
  .timeline-item .status { display: none; }
  .order-toolbar, .order-items-actions, .sticky-form-actions { align-items: stretch; flex-direction: column; }
  .order-toolbar > div, .order-items-actions > div, .sticky-form-actions > div { width: 100%; }
  .order-toolbar button, .sticky-form-actions button { flex: 1; }
  .order-section { padding: 16px 14px; }
  .order-live-total { width: 100%; justify-content: space-between; }
  .camera-stage { aspect-ratio: 1.2; }
  .scanner-actions { align-items: stretch; flex-direction: column; }
  .scanner-actions > div { width: 100%; }
  .scanner-actions button, .scanner-actions label { flex: 1; }
  .scan-preview { grid-template-columns: 1fr; }
  .scan-preview img { width: 100%; height: 150px; }
  .scan-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .photo-actions { align-items: stretch; flex-direction: column; }
  .photo-actions > div:last-child { width: 100%; }
  .photo-actions .file-button { flex: 1; justify-content: center; }
  .order-photo-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .menu-access-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

.menu-access { border: 1px solid var(--border, #d8dee9); border-radius: 10px; padding: 12px 14px; margin: 4px 0; }
.menu-access legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
.menu-access-hint { margin: 0 0 10px; color: var(--muted, #667085); font-size: 12px; }
.menu-access-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px 14px; }
.menu-access .check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.load-more { display: flex; justify-content: center; padding: 14px 0 4px; }
.order-history { display: flex; flex-direction: column; gap: 8px; }
.order-history-item { display: flex; gap: 12px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--border, #e3e8ef); border-radius: 8px; }
.order-history-item .mono { color: var(--muted, #667085); white-space: nowrap; font-size: 12px; }
.order-history-item small { color: var(--muted, #667085); display: block; }
