:root {
  --bg: #f4f5f7;
  --paper: #f7f8fa;
  --surface: #ffffff;
  --line: #e8eaee;
  --line-strong: #d7dbe2;
  --text: #1a2233;
  --muted: #6b7380;
  --sidebar: #0c1220;
  --sidebar-text: #c9d0da;
  --sidebar-dim: #8b93a1;
  --sidebar-bg: #0B1421;
  --sidebar-muted: #98A2B3;
  --sidebar-gold: #D4A33A;
  --sidebar-border: rgba(255,255,255,.06);
  --accent: #c9952e;
  --accent-hover: #b48427;
  --accent-2: #d4a33a;
  --accent-3: #e2b84b;
  --accent-soft: rgba(201, 149, 46, 0.16);
  --ok: #1f7a4d;
  --ok-bg: #e8f6ee;
  --warn: #a16207;
  --warn-bg: #f8f1df;
  --danger: #b42318;
  --danger-bg: #f8e8e6;
  --info: #3b6ea5;
  --info-bg: #eaf2fb;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(16, 24, 40, 0.05);
  --font: Inter, system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; max-width: 100%; }
html { overflow-x: hidden; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}
body.nav-open { overflow: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.03em; }
h1 { font-size: 26px; line-height: 1.2; color: var(--text); }
h2 { font-size: 15px; margin-bottom: 14px; color: var(--text); }
code { font-family: ui-monospace, Consolas, monospace; }

.app { display: flex; min-height: 100vh; width: 100%; max-width: 100%; overflow-x: hidden; }
.sidebar {
  width: 240px;
  min-width: 240px;
  flex: 0 0 240px;
  background: linear-gradient(180deg, #0D1724 0%, #0B1421 48%, #09111D 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  z-index: 30;
  border-right: 1px solid var(--sidebar-border);
}
.brand {
  flex: 0 0 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 18px 0;
  overflow: hidden;
}
.brand-logo {
  display: block;
  width: 200px;
  max-width: 200px;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  mix-blend-mode: lighten;
  transform: scale(1.28);
  transform-origin: center center;
}
.brand-logo-sm {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.brand-mark {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: .04em;
  font-size: 13px;
  flex-shrink: 0;
  border-radius: 10px;
}
.sidebar nav {
  flex: 0 0 auto;
  padding: 22px 12px 0;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-link {
  color: #E5E7EB;
  text-decoration: none;
  height: 45px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-sizing: border-box;
}
.nav-link span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}
.nav-link svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.nav-link .nav-ico {
  width: 19px;
  height: 19px;
  stroke: #AAB4C3;
}
.nav-link .nav-chevron {
  width: 14px;
  height: 14px;
  margin-left: auto;
  stroke: #8994A4;
}
.nav-link:hover {
  background: rgba(255,255,255,.04);
  text-decoration: none;
  color: #fff;
}
.nav-link:hover .nav-ico { stroke: #E5E7EB; }
.nav-link.active {
  background: rgba(201, 149, 46, .16);
  color: #E0B44F;
  border-color: rgba(201, 149, 46, .45);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--sidebar-gold);
}
.nav-link.active .nav-ico { stroke: #D4A33A; }
.nav-link.active .nav-chevron { stroke: #E0B44F; }
.sidebar-bottom {
  margin-top: auto;
  flex: 1 1 auto;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-image:
    linear-gradient(180deg, #0B1421 0%, rgba(11,20,33,.45) 22%, rgba(9,17,29,.12) 52%, rgba(9,17,29,.62) 100%),
    url("../assets/sidebar-car.jpg");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}
.sidebar-hero {
  margin-top: 0;
  min-height: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px 6px;
}
.sidebar-hero p {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", Palatino, "Times New Roman", cursive, serif;
  font-style: italic;
  color: #E0B44F;
  font-size: 14px;
  letter-spacing: .01em;
  text-align: center;
}
.sidebar-hero p::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  margin: 8px auto 0;
  background: rgba(212, 163, 58, .7);
}
.sidebar-foot {
  padding: 2px 16px 14px;
  color: #9AA4B2;
  font-size: 11px;
  text-align: center;
  letter-spacing: .04em;
}
.sidebar-foot code {
  display: block;
  margin-top: 2px;
  color: #9AA4B2;
  font-size: 11px;
  font-family: inherit;
}

.main { flex: 1 1 auto; min-width: 0; width: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 28px 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-brand {
  display: none;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-brand strong { font-size: 16px; }
.topbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.clock {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.clock svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.clock strong { display: block; font-size: 13px; line-height: 1.2; }
.clock span { display: block; color: var(--muted); font-size: 12px; }
.icon-link {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
}
.icon-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-link:hover { color: var(--text); text-decoration: none; background: var(--paper); }
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #E5E7EB;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  flex-shrink: 0;
}
.hamburger svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #1a2233;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hamburger:hover { background: var(--paper); }
.hamburger:focus,
.hamburger:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: #E5E7EB;
}
.global-search,
.input-with-icon {
  position: relative;
  width: 100%;
  min-width: 0;
}
.global-search { max-width: 560px; }
.search-field {
  position: relative;
  flex: 1 1 180px;
  min-width: 0;
  display: block;
}
.global-search .search-ico,
.search-field .search-ico,
.input-with-icon > svg,
.input-with-icon .search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}
.global-search .search-ico svg,
.search-field .search-ico svg,
.input-with-icon > svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

input[type="search"],
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="tel"],
input:not([type]),
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  min-height: 40px;
}
textarea { resize: vertical; height: auto; min-height: 80px; }
select {
  cursor: pointer;
  background-color: var(--surface);
  -webkit-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748B 50%),
    linear-gradient(135deg, #64748B 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  padding-right: 40px;
}
input[type="date"] {
  -webkit-appearance: auto;
  appearance: auto;
  background-image: none;
  padding-right: 12px;
}
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input::placeholder, textarea::placeholder { color: #94A3B8; }
input:hover, select:hover, textarea:hover { border-color: #b8c0cb; }
input:focus,
select:focus,
textarea:focus,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border: 1px solid #C9952E;
  box-shadow: 0 0 0 3px rgba(201, 149, 46, .12);
}
input[type="radio"],
input[type="checkbox"] {
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: none;
}
input[type="radio"]:focus,
input[type="checkbox"]:focus,
input[type="radio"]:focus-visible,
input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(201, 149, 46, .28);
  outline-offset: 1px;
  border: 0;
  box-shadow: none;
}
.hamburger:focus-visible, .btn:focus-visible, .chip:focus-visible, .link:focus-visible, .icon-btn:focus-visible, .nav-link:focus-visible, .quick-btn:focus-visible {
  outline: 2px solid rgba(201, 149, 46, .28);
  outline-offset: 1px;
  border-color: var(--accent);
}
.btn:focus-visible, .nav-link:focus-visible { outline-offset: 2px; }

.global-search input,
.search-field input,
.input-with-icon > input,
.input-with-icon.has-left-icon > input,
input.has-left-icon,
input[type="search"] {
  height: 44px;
  min-height: 44px;
  padding: 0 14px 0 44px;
  -webkit-appearance: none;
  appearance: none;
}
.input-with-icon.has-right-icon > input,
input.has-right-icon {
  padding-right: 44px;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0F172A;
  box-shadow: 0 0 0 1000px #ffffff inset;
  transition: background-color 9999s ease-out;
}

.search-results {
  display: none;
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  max-height: 420px;
  overflow: auto;
  z-index: 30;
  border-radius: var(--radius);
}
.search-results.open { display: block; }
.search-results a {
  display: block;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover { background: var(--paper); }
.search-results a .hit-plate { font-size: 15px; }
.search-results a span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.search-results .sg {
  padding: 10px 14px 6px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

#view {
  padding: 24px 36px 40px;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
  flex: 1 1 auto;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.lead { margin: 6px 0 0; color: var(--muted); font-size: 14px; font-weight: 400; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-actions:empty { display: none; }
.contact-actions { display: inline-flex; gap: 6px; vertical-align: middle; margin-left: 6px; }
.contact-actions .icon-link { width: 32px; height: 32px; }
.wo-actions { margin: 0 0 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  text-decoration: none;
}
.back-link:hover { color: var(--text); text-decoration: none; }

.btn, .btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 8px 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  min-height: 40px;
  font-weight: 600;
}
.btn:hover { background: var(--paper); text-decoration: none; }
.btn-small { min-height: 34px; padding: 5px 11px; font-size: 13px; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a2233;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #1a2233; }
.btn-danger {
  color: var(--danger);
  border-color: #e2b8b4;
  background: #fff;
}
.btn-danger:hover { background: var(--danger-bg); }
.btn:disabled, .btn[disabled], .btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 7px 12px;
  cursor: pointer;
  border-radius: 999px;
  min-height: 34px;
  font-weight: 600;
  color: var(--muted);
}
.chip:hover { background: var(--paper); color: var(--text); }
.chip.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 18px 18px 16px;
  min-height: 118px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  position: relative;
}
.stat-go {
  position: absolute;
  top: 16px;
  right: 14px;
  color: #c5cad3;
}
.stat-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--paper);
  color: var(--muted);
}
.stat-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stat-body { min-width: 0; flex: 1; }
.stat-label { color: var(--muted); font-size: 12px; margin-bottom: 6px; letter-spacing: .02em; font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; letter-spacing: -0.03em; }
.stat-hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.stat-open .stat-icon { background: #e8f1fb; color: #3b6ea5; }
.stat-progress .stat-icon { background: #f8edd8; color: #c9952e; }
.stat-ready .stat-icon { background: var(--ok-bg); color: var(--ok); }
.stat-cash .stat-icon { background: #efe8fb; color: #6b4ea1; }
.stat-expense .stat-icon { background: var(--danger-bg); color: var(--danger); }
.stat-in .stat-icon { background: var(--ok-bg); color: var(--ok); }

.recv-remain {
  color: #C9952E;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.recv-dash {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: 14px;
}
.recv-dash:hover { text-decoration: none; border-color: #ead9b3; }
.recv-dash strong {
  display: block;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #C9952E;
  font-variant-numeric: tabular-nums;
}
.recv-dash > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.recv-dash .panel-head { margin-bottom: 8px; }
.recv-dash .stat-go { position: static; color: #c5cad3; }
.recv-dash .stat-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 18px 20px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(21, 32, 51, 0.03);
  width: 100%;
  max-width: none;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.quick-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  text-align: left;
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.quick-btn span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.quick-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.quick-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a2233;
}
.quick-btn.primary span { color: rgba(26,34,51,.72); }
.quick-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
  background: #fff;
}
.quick-btn.primary:hover { background: var(--accent-hover); color: #1a2233; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; max-width: 100%; }
.has-cards { width: 100%; }
.list-cards { display: none; }
.item-card {
  display: block;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  overflow-wrap: break-word;
  min-width: 0;
}
a.item-card:hover, .item-card[data-href]:hover {
  background: var(--paper);
  text-decoration: none;
  border-color: var(--line-strong);
}
.item-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.item-plate { font-size: 18px; font-weight: 700; letter-spacing: .06em; margin: 2px 0 4px; }
.item-card-foot { margin-top: 8px; font-weight: 650; font-variant-numeric: tabular-nums; }
.item-card-maint { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.item-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.item-card > strong { display: block; }
.item-phone { display: block; margin: 2px 0 6px; min-height: 40px; padding: 8px 0; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; }
.data-table.clickable tbody tr { cursor: pointer; }
.data-table.clickable tbody tr:hover,
.data-table tbody tr.clickable-row:hover { background: #f7f8fb; }
.data-table tbody tr.clickable-row { cursor: pointer; }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .03em; }
.plate-cell { font-weight: 700; letter-spacing: .05em; }
.row-actions { white-space: nowrap; }
.link {
  background: none;
  border: 0;
  padding: 0 6px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}
.link:hover { text-decoration: underline; }
.link.danger { color: var(--danger); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 650;
  border: 1px solid transparent;
  background: var(--paper);
  line-height: 1.3;
  white-space: nowrap;
  border-radius: 999px;
}
.st-open { color: var(--info); background: var(--info-bg); }
.st-progress { color: var(--warn); background: var(--warn-bg); }
.st-ready { color: var(--ok); background: var(--ok-bg); }
.st-done { color: var(--muted); background: var(--paper); }
.st-cancel { color: var(--danger); background: var(--danger-bg); }
.st-paid { color: var(--ok); background: var(--ok-bg); }
.st-maint-far { color: var(--ok); background: var(--ok-bg); }
.st-maint-soon { color: var(--warn); background: var(--warn-bg); }
.st-maint-due { color: var(--danger); background: var(--danger-bg); }
.method-cash,
.method-card,
.method-transfer,
.method-none {
  color: #475569;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  font-weight: 600;
}
.method-card { background: #F8FAFC; }
.method-transfer { background: #EEF2F6; }
.method-none { color: #64748B; font-weight: 500; }
.item-card-pay { margin-top: 8px; }
.cash-method-filter {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cash-method-filter select {
  min-height: 38px;
  min-width: 160px;
  margin-top: 0;
}
.flow-method {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.pay-hist .data-table { font-size: 13px; }
.print-pays {
  font-size: 12px;
  color: #334155;
  margin: 4px 0;
}
.print-pays span {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}
.st-cash-in { color: var(--ok); background: var(--ok-bg); }
.st-cash-out { color: var(--danger); background: var(--danger-bg); }
.amt-in { color: var(--ok); font-weight: 650; }
.amt-out { color: var(--danger); font-weight: 650; }
.est-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.cash-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin: 4px 0 14px;
}
.cash-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}
.cash-dates label {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.cash-dates input {
  margin-top: 4px;
  min-height: 38px;
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border: 1px dashed var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 22px;
  border-radius: 10px;
}
.empty h3 { color: var(--text); margin-bottom: 8px; font-size: 16px; }
.empty p { margin: 0 0 16px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.form-grid label, .form-grid h2 { display: block; }
.form-grid label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.form-grid label input,
.form-grid label select,
.form-grid label textarea {
  margin-top: 0;
  font-weight: 400;
  color: var(--text);
}
.form-grid .span-2 { grid-column: 1 / -1; }
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}
.form-row > * { min-width: 0; }
.form-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.req { color: var(--danger); }
.hint, .muted, .notes { color: var(--muted); font-size: 13px; font-weight: 400; }
.notes { margin-top: 12px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 16px; margin-top: 14px; }
.kv { display: flex; flex-direction: column; gap: 3px; }
.kv span { color: var(--muted); font-size: 12px; }
.kv strong { font-weight: 650; }

.choice-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 44px;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  background: var(--surface);
  min-width: 0;
}
.choice span { min-width: 0; line-height: 1.3; }
.choice input { width: auto; min-height: 0; margin: 0; accent-color: var(--accent); }
.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.vehicle-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 16px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}
.vehicle-card > p { grid-column: 1 / -1; margin: 0; }
.plate-search-lg {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.plate-search-lg input,
#wo-plate-search {
  min-height: 44px;
  font-size: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: 6px;
  font-weight: 400;
  color: var(--text);
  padding: 9px 12px;
}
.plate-hits { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.plate-hit {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.plate-hit:hover, .plate-hit.selected {
  border-color: var(--accent);
  background: #fffaf7;
}
.plate-hit strong { display: block; }
.plate-hit span { display: block; color: var(--muted); font-size: 12px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.entity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }

.detail-layout .detail-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail-layout .detail-main > .entity-grid,
.detail-layout .detail-main > .panel,
.detail-layout .detail-main > .wo-detail-notes {
  margin-bottom: 0;
}
.detail-layout .wo-detail-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.detail-layout .wo-text-card {
  padding: 14px 16px;
  min-height: 0;
  height: auto;
  align-self: start;
}
.detail-layout .wo-text-card > h2 {
  margin-bottom: 8px;
}
.detail-layout .wo-text-card > p {
  margin: 0;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: visible;
}
.detail-layout .wo-text-card.is-empty > p {
  color: var(--muted);
  line-height: 1.2;
}
.detail-layout .wo-detail-table {
  padding: 16px;
}
.detail-layout .wo-detail-table > h2 {
  margin-bottom: 10px;
}
.entity-card h2 { margin-bottom: 8px; }
.entity-card .name { font-size: 16px; font-weight: 650; }
.entity-card .plate-lg { font-size: 22px; margin-bottom: 4px; }
.wo-layout, .detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}
.wo-side .totals, .detail-layout .totals { position: sticky; top: 84px; margin-bottom: 0; }

.inline-parts,
.inline-labor {
  width: 100%;
  table-layout: fixed;
}
.inline-parts th:nth-child(1) { width: 20%; }
.inline-parts th:nth-child(2) { width: 14%; }
.inline-parts th:nth-child(3) { width: 7%; }
.inline-parts th:nth-child(4),
.inline-parts th:nth-child(6),
.inline-parts th:nth-child(7),
.inline-parts th:nth-child(8) { width: 10%; }
.inline-parts th:nth-child(5) { width: 8%; }
.inline-parts th:last-child,
.inline-labor th:last-child { width: 52px; }
.inline-labor th:nth-child(1) { width: auto; }
.inline-labor th:nth-child(2) { width: 28%; }
.inline-input,
.inline-select {
  width: 100%;
  height: 34px;
  border: 1px solid #D0D7E2;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1.2;
  box-sizing: border-box;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
.inline-input:focus,
.inline-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 149, 46, 0.15);
}
.inline-num { text-align: right; }
.inline-actions {
  white-space: nowrap;
  vertical-align: middle;
}
.btn-inline-ok {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
}
.btn-inline-del {
  font-size: 16px;
  line-height: 1;
  padding: 6px 8px;
}
.inline-row.is-draft td {
  background: #FBFCFE;
}

/* —— İş Emri Düzenle: kompakt layout (sadece #wo-form) —— */
#view:has(#wo-form) {
  padding-top: 24px;
  padding-bottom: 28px;
}
#view:has(#wo-form) .page-head {
  margin-bottom: 14px;
  gap: 12px;
  align-items: center;
}
#view:has(#wo-form) .page-head h1 {
  font-size: 22px;
  line-height: 1.25;
}
#view:has(#wo-form) .lead {
  margin-top: 4px;
  font-size: 13px;
}
#view:has(#wo-form) .page-actions .btn {
  min-height: 38px;
  padding: 6px 12px;
}

#wo-form.wo-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 22%);
  gap: 12px;
  align-items: start;
}
#wo-form .wo-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
#wo-form .wo-main > .panel {
  margin-bottom: 0;
  padding: 14px 16px;
}
#wo-form .wo-main > .panel > h2 {
  margin-bottom: 8px;
  font-size: 14px;
}
#wo-form .panel-head {
  margin-bottom: 6px;
}
#wo-form .panel-head h2 {
  font-size: 14px;
}
#wo-form .panel-head .btn {
  min-height: 34px;
  padding: 5px 11px;
  font-size: 13px;
}

#wo-form .plate-search-lg {
  margin-bottom: 0;
}
#wo-form .plate-search-lg input,
#wo-form #wo-plate-search {
  height: 40px;
  min-height: 40px;
  margin-top: 5px;
  padding: 7px 11px;
  font-size: 15px;
}
#wo-form .plate-hits {
  gap: 6px;
  margin-top: 8px;
}
#wo-form .plate-hit {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 6px 10px;
  line-height: 1.25;
}
#wo-form .plate-hit strong {
  display: inline;
  font-size: 14px;
  line-height: 1.25;
}
#wo-form .plate-hit span {
  display: inline;
  font-size: 12px;
  line-height: 1.25;
  margin-top: 0;
}
#wo-form .vehicle-card {
  display: block;
  margin-top: 8px;
  padding: 8px 12px;
  min-height: 0;
}
#wo-form .wo-info-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-size: 13px;
  line-height: 1.35;
}
#wo-form .wo-info-compact strong {
  font-weight: 700;
}
#wo-form .wo-info-compact span {
  color: var(--text);
}
#wo-form .wo-info-full {
  display: none;
}
#wo-form .vehicle-card > p {
  margin: 0;
  line-height: 1.35;
}

#wo-form .form-grid {
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
#wo-form .form-grid label {
  gap: 5px;
  font-size: 12px;
  margin: 0;
  padding: 0;
}
#wo-form .form-grid label input,
#wo-form .form-grid label select {
  height: 40px;
  min-height: 40px;
  padding: 7px 11px;
}
#wo-form .form-grid label textarea,
#wo-form #wo-complaint,
#wo-form #wo-operations,
#wo-form #wo-notes {
  height: 72px;
  min-height: 72px;
  max-height: none;
  padding: 8px 11px;
  line-height: 1.4;
  margin: 0;
  resize: vertical;
}

/* Şikayet + Yapılan İşlemler: masaüstünde yan yana (dikey alan kazanımı) */
#wo-form .form-grid > label.span-2:has(#wo-complaint),
#wo-form .form-grid > label.span-2:has(#wo-operations),
#wo-form .form-grid > label:has(#wo-complaint),
#wo-form .form-grid > label:has(#wo-operations) {
  grid-column: span 2;
}
#wo-form .form-grid > label.span-2:has(#wo-notes),
#wo-form .form-grid > label:has(#wo-notes) {
  grid-column: 1 / -1;
}

/* Tablolar: daha fazla row aynı viewport’ta */
#wo-form .inline-parts,
#wo-form .inline-labor {
  font-size: 13px;
  line-height: 1.25;
}
#wo-form .inline-parts thead th,
#wo-form .inline-labor thead th {
  padding: 7px 6px;
  font-size: 12px;
  line-height: 1.2;
  height: 38px;
  box-sizing: border-box;
}
#wo-form .inline-parts tbody td,
#wo-form .inline-labor tbody td {
  padding: 3px 5px;
  vertical-align: middle;
  line-height: 1.2;
}
#wo-form .inline-parts tbody tr,
#wo-form .inline-labor tbody tr {
  height: 40px;
}
#wo-form .inline-input,
#wo-form .inline-select {
  height: 34px;
  min-height: 34px;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1.2;
  border-radius: 7px;
}
#wo-form .btn-inline-ok {
  min-width: 34px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 14px;
}
#wo-form .btn-inline-del {
  font-size: 14px;
  padding: 4px 6px;
  line-height: 1;
}
#wo-form .wo-main > .panel:has(.inline-parts),
#wo-form .wo-main > .panel:has(.inline-labor) {
  padding: 12px 14px;
}
#wo-form .table-wrap {
  margin: 0;
}
#wo-form .muted,
#wo-form .hint {
  margin: 0;
  line-height: 1.4;
}

#wo-form .wo-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
#wo-form .wo-side .panel.totals,
#wo-form #wo-totals .panel.totals {
  padding: 16px;
  margin-bottom: 0;
}
#wo-form .totals h2 {
  margin-bottom: 6px;
  font-size: 14px;
}
#wo-form .totals .tot-row {
  padding: 7px 0;
  gap: 10px;
  line-height: 1.3;
}
#wo-form .totals .grand {
  margin-top: 2px;
  padding-top: 10px;
  font-size: 15px;
}
#wo-form .form-actions {
  margin-top: 0;
}
#wo-form .form-actions .btn {
  width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 8px 14px;
}
#wo-form .wo-side .totals {
  top: 72px;
}

#wo-form .wo-party-panel {
  padding: 18px 20px;
}
#wo-form .wo-plate-field {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
#wo-form .wo-plate-wrap {
  position: relative;
  margin-top: 6px;
}
#wo-form .wo-plate-wrap .search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
}
#wo-form .wo-plate-wrap .search-ico svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
#wo-form .wo-plate-wrap input,
#wo-form .wo-party-panel #wo-plate-search {
  height: 44px;
  min-height: 44px;
  padding: 8px 12px 8px 36px;
  font-size: 15px;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  font-weight: 650;
}
#wo-form .wo-found-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #d8dee8;
  background: #f7f8fa;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 8px;
  cursor: pointer;
}
#wo-form .wo-found-card:hover,
#wo-form .wo-found-card.selected,
#wo-form .wo-found-card.is-selected {
  border-color: var(--navy, #0B1421);
  background: #fff;
}
#wo-form .wo-found-flag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8a6a1f;
  margin: 8px 0 6px;
}
#wo-form .wo-found-plate {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .04em;
  margin-bottom: 2px;
}
#wo-form .wo-found-card .btn {
  margin-top: 10px;
}
#wo-form .wo-empty-plate {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #f7f8fa;
}
#wo-form .wo-empty-plate p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}
#wo-form .wo-create-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e6e8ee;
}
#wo-form .wo-create-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
#wo-form .wo-create-box h3,
#wo-form .wo-create-box h4 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #0B1421;
}
#wo-form .wo-cus-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
#wo-form .wo-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  margin-bottom: 16px;
}
#wo-form .wo-form-grid .span-2,
#wo-form .wo-form-grid .form-group.span-2 {
  grid-column: 1 / -1;
}
#wo-form .wo-form-grid .form-group,
#wo-form .wo-cus-combo-wrap {
  margin: 0;
}
#wo-form .wo-form-grid label,
#wo-form .wo-cus-combo-wrap label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 5px;
}
#wo-form .wo-form-grid input,
#wo-form .wo-cus-combo-wrap .ss-control {
  height: 42px;
  min-height: 42px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}
#wo-form .wo-dup-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #e8d7a8;
  background: #fff8e8;
  border-radius: 8px;
  font-size: 13px;
}
#wo-form .totals .remain strong {
  color: #C9952E;
}

/* Yeni iş emri: adım adım çalışma alanı */
.wo-progress {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 12px;
  margin: 0 0 12px;
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  overflow-x: auto;
}
.wo-prog {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
  padding: 2px 6px;
  border: 0;
  background: none;
  color: #94a3b8;
  cursor: pointer;
}
.wo-prog:disabled {
  cursor: default;
}
.wo-prog-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.wo-prog-label {
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  letter-spacing: .01em;
}
.wo-prog.is-active {
  color: #0B1421;
}
.wo-prog.is-active .wo-prog-num {
  background: #0B1421;
  color: #fff;
  border-color: #0B1421;
}
.wo-prog.is-done {
  color: #0B1421;
}
.wo-prog.is-done .wo-prog-num {
  background: #C9952E;
  color: #fff;
  border-color: #C9952E;
}
.wo-prog.is-pending {
  opacity: .42;
}
.wo-prog-line {
  flex: 1 1 16px;
  height: 1px;
  min-width: 12px;
  background: #d8dee8;
}
.wo-prog-line.is-on {
  background: #C9952E;
}
#wo-form.wo-wizard .wo-main {
  gap: 8px;
}
#wo-form .wo-step {
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 14px 16px;
}
#wo-form .wo-step > h2,
#wo-form .wo-step .panel-head h2 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #0B1421;
}
#wo-form .wo-step.is-open {
  border-color: #0B1421;
  animation: woStepIn .18s ease-out;
}
#wo-form .wo-step.is-done {
  padding: 10px 14px;
}
#wo-form .wo-step.is-locked {
  background: #f7f8fa;
  color: #94a3b8;
}
#wo-form .wo-step-toggle {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
#wo-form .wo-step-done-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
#wo-form .wo-step-check {
  color: #C9952E;
  font-weight: 800;
}
#wo-form .wo-step-sum {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}
#wo-form .wo-step-edit {
  font-size: 12px;
  font-weight: 700;
  color: #C9952E;
  white-space: nowrap;
  padding-top: 2px;
}
#wo-form .wo-step-locked-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
#wo-form .wo-step-idx {
  width: 22px;
  height: 22px;
  border: 1px solid #d8dee8;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
#wo-form .wo-step-empty {
  padding: 8px 0 4px;
}
#wo-form .wo-step-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
#wo-form .wo-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
#wo-form .btn-ghost {
  background: #fff;
  border: 1px solid #d8dee8;
  color: #0B1421;
}
#wo-form .wo-pay-lines {
  margin-bottom: 10px;
}
#wo-form .wo-pay-hero {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 8px 0 14px;
}
#wo-form .wo-pay-spot {
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f7f8fa;
}
#wo-form .wo-pay-spot span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
#wo-form .wo-pay-spot strong {
  font-size: 16px;
  color: #0B1421;
}
#wo-form .wo-pay-spot.remain {
  border-color: #C9952E;
  background: #fff8e8;
}
#wo-form .wo-pay-spot.remain strong {
  color: #C9952E;
}
#wo-form .wo-pay-spot.remain.is-zero {
  border-color: #d8dee8;
  background: #f7f8fa;
}
#wo-form .wo-pay-spot.remain.is-zero strong {
  color: #0B1421;
}
#wo-form .wo-pay-form {
  margin-top: 4px;
}
#wo-form .wo-save-btn {
  width: 100%;
  min-height: 44px;
  font-weight: 750;
  letter-spacing: .02em;
}
#wo-form .wo-summary-card {
  position: sticky;
  top: 72px;
}
#wo-form .wo-sum-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.3;
  border-bottom: 1px solid #eef0f4;
}
#wo-form .wo-sum-row span {
  color: var(--muted);
}
#wo-form .wo-sum-row.grand {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #d8dee8;
  border-bottom: 0;
  font-size: 15px;
}
#wo-form .wo-sum-row.remain strong {
  color: #C9952E;
}
#wo-form .wo-found-card .btn-primary {
  margin-top: 10px;
}
@keyframes woStepIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (min-width: 993px) {
  #wo-form .wo-save-mobile { display: none; }
}
@media (max-width: 992px) {
  #wo-form .wo-side .wo-save-actions { display: none; }
  #wo-form .wo-summary-card { position: static; }
  #wo-form .wo-save-mobile {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 10px;
    margin-top: 12px;
  }
}
@media (max-width: 768px) {
  .wo-prog { min-width: 58px; }
  .wo-prog-label { font-size: 10px; }
  #wo-form .wo-pay-hero { grid-template-columns: 1fr; }
}
#wo-form .wo-cus-combo-wrap .ss-combo {
  position: relative;
  width: 100%;
}
#wo-form .wo-cus-combo-wrap .ss-control {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 10px;
}
#wo-form .wo-cus-combo-wrap .ss-control input,
#wo-form .wo-cus-combo-wrap .ss-control input[type="text"] {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  border: 0;
  box-shadow: none;
  padding: 0 6px;
  background: transparent;
  font-size: 14px;
}
#wo-form .wo-cus-combo-wrap .ss-control input:focus {
  outline: none;
  box-shadow: none;
  border: 0;
}
#wo-form .wo-cus-combo-wrap .ss-ico {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
}
#wo-form .wo-cus-combo-wrap .ss-ico svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
#wo-form .wo-cus-combo-wrap .ss-clear {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #64748b;
  font-size: 18px;
}
#wo-customer-menu.wo-ss-menu,
#wo-customer-menu {
  position: fixed;
  z-index: 1400;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  padding: 4px 0;
  box-sizing: border-box;
}
#wo-customer-menu[hidden] {
  display: none !important;
}
#wo-customer-menu .ss-option {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 6px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: #0f172a;
}
#wo-customer-menu .ss-option:hover,
#wo-customer-menu .ss-option.is-active {
  background: #fff8ee;
}
#wo-customer-menu .ss-option.is-selected {
  background: #f8edd8;
}
#wo-customer-menu .ss-name {
  font-size: 14px;
  font-weight: 650;
}
#wo-customer-menu .ss-phone {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
#wo-customer-menu .ss-empty {
  padding: 14px;
  color: #64748b;
  font-size: 13px;
}

/* İş emri detay: Parça / İşçilik / Tahsilat tabloları yoğunluğu */
.detail-layout .data-table,
.pay-hist .data-table {
  font-size: 13px;
  line-height: 1.25;
}
.detail-layout .data-table th,
.pay-hist .data-table th {
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.2;
}
.detail-layout .data-table td,
.pay-hist .data-table td {
  padding: 7px 8px;
  line-height: 1.25;
}

@media (max-width: 1200px) {
  #wo-form.wo-layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 26%);
  }
}

@media (max-width: 992px) {
  #wo-form.wo-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  #wo-form .wo-side .totals {
    position: static;
  }
}

@media (max-width: 768px) {
  #view:has(#wo-form) {
    padding-top: 16px;
    padding-bottom: 28px;
  }
  #view:has(#wo-form) .page-head {
    margin-bottom: 16px;
    align-items: flex-start;
  }
  #wo-form .wo-main {
    gap: 12px;
  }
  #wo-form .wo-main > .panel {
    padding: 14px;
  }
  #wo-form .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #wo-form .form-grid > label:has(#wo-complaint),
  #wo-form .form-grid > label:has(#wo-operations),
  #wo-form .form-grid > label:has(#wo-notes) {
    grid-column: 1 / -1;
  }
  #wo-form .form-grid label input,
  #wo-form .form-grid label select,
  #wo-form .plate-search-lg input,
  #wo-form #wo-plate-search {
    height: 44px;
    min-height: 44px;
  }
  #wo-form .form-grid label textarea,
  #wo-form #wo-complaint,
  #wo-form #wo-operations,
  #wo-form #wo-notes {
    height: 80px;
    min-height: 80px;
  }
  #wo-form .vehicle-card {
    padding: 12px;
    gap: 10px;
  }
  #wo-form .plate-hit {
    display: block;
    padding: 10px 12px;
  }
  #wo-form .plate-hit strong,
  #wo-form .plate-hit span {
    display: block;
  }
  #wo-form .wo-form-grid {
    grid-template-columns: 1fr;
  }
  #wo-form .wo-party-panel #wo-plate-search {
    height: 44px;
  }
  #wo-form .form-actions .btn {
    min-height: 44px;
    height: 44px;
  }
  #wo-form .form-actions .btn {
    min-height: 44px;
    height: 44px;
  }
  #wo-form .inline-parts tbody tr,
  #wo-form .inline-labor tbody tr {
    height: auto;
  }
  #wo-form .inline-input,
  #wo-form .inline-select {
    height: 40px;
    min-height: 40px;
    padding: 6px 10px;
  }
  #wo-form .inline-parts tbody td,
  #wo-form .inline-labor tbody td {
    padding: 6px 6px;
  }
}

.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-card {
  display: block;
  border: 1px solid var(--line);
  padding: 12px 14px;
  color: var(--text);
  background: var(--paper);
  border-radius: var(--radius-sm);
}
.mini-card:hover { background: #fff; border-color: var(--accent); text-decoration: none; }
.plate { font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.plate-lg { font-size: 28px; letter-spacing: .08em; font-weight: 700; }
.vehicle-hero, .wo-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.wo-hero {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.wo-no { color: var(--text); font-size: 22px; margin-bottom: 8px; font-weight: 700; letter-spacing: -0.02em; }
.wo-hero-meta { color: var(--muted); margin: 0; }
.km-line { font-variant-numeric: tabular-nums; color: var(--muted); margin: 6px 0 0; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.timeline { display: flex; flex-direction: column; }
.tl-item {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  align-items: start;
}
.tl-item:last-child { border-bottom: 0; }
.tl-item:hover { background: var(--paper); text-decoration: none; }
.tl-date { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 650; padding-top: 2px; }
.tl-title { font-weight: 650; }
.tl-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tl-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tl-no { font-size: 12px; color: var(--muted); margin-bottom: 2px; }

.totals h2 { margin-bottom: 8px; }
.totals .tot-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.totals .tot-row span { color: var(--muted); }
.totals .grand {
  font-size: 16px;
  border-bottom: 0;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line-strong);
}
.totals .remain strong { color: var(--warn); }
.totals .remain.is-zero strong { color: var(--ok); }
.tot-spotlight {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.tot-spot {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--line);
}
.tot-spot span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; font-weight: 600; }
.tot-spot strong { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.tot-spot.remain { background: var(--warn-bg); border-color: #ead9b3; }
.tot-spot.remain.is-zero { background: var(--ok-bg); border-color: #c3d7cc; }
.tot-spot.remain.is-zero strong { color: var(--ok); }
.tot-spot.remain strong { color: var(--warn); }
.pay-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.pay-meta span { display: block; color: var(--muted); font-size: 12px; }

.maint-card .maint-status { margin-bottom: 12px; }
.maint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px 16px;
}
.maint-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.maint-note { color: var(--muted); font-size: 12px; margin: 14px 0 0; }

/* Araç Detay — yalnızca .veh-detail */
.veh-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.veh-detail > .panel,
.veh-detail > .stat-grid,
.veh-detail > .vehicle-hero,
.veh-detail > .back-link {
  margin-bottom: 0;
}
.veh-detail .vehicle-hero {
  align-items: center;
  padding: 20px 0 18px;
  margin-bottom: 0;
  gap: 12px 16px;
}
.veh-detail .veh-hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}
.veh-detail .plate-lg {
  font-size: 26px;
  line-height: 1.15;
}
.veh-detail .veh-hero-title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}
.veh-detail .lead {
  margin: 6px 0 0;
  font-size: 13px;
}
.veh-detail .page-actions .btn {
  min-height: 38px;
  padding: 6px 12px;
}
.veh-detail .veh-info,
.veh-detail .veh-history,
.veh-detail .maint-card {
  padding: 16px;
}
.veh-detail .veh-info > h2,
.veh-detail .veh-history > h2,
.veh-detail .maint-card > h2 {
  margin-bottom: 10px;
}
.veh-detail .info-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 0;
}
.veh-detail .kv span {
  font-size: 11px;
}
.veh-detail .kv strong {
  font-size: 13px;
  line-height: 1.3;
}
.veh-detail .notes {
  margin-top: 10px;
}
.veh-detail .stat-grid {
  gap: 12px;
  margin-bottom: 0;
}
.veh-detail .stat {
  min-height: 88px;
  height: auto;
  padding: 14px 16px;
  align-items: center;
}
.veh-detail .stat-value {
  font-size: 20px;
}
.veh-detail .stat-label {
  margin-bottom: 4px;
}
.veh-detail .stat-hint {
  margin-top: 4px;
}
.veh-detail .maint-card .muted {
  margin: 0;
  line-height: 1.45;
}
.veh-detail .maint-status {
  margin-bottom: 8px;
}
.veh-detail .maint-note {
  margin-top: 10px;
}
.veh-detail .veh-hist-table {
  font-size: 13px;
  table-layout: fixed;
  width: 100%;
}
.veh-detail .veh-hist-table th {
  padding: 8px 8px;
  font-size: 12px;
}
.veh-detail .veh-hist-table td {
  padding: 8px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.veh-detail .veh-hist-table col.col-date { width: 92px; }
.veh-detail .veh-hist-table col.col-no { width: 148px; }
.veh-detail .veh-hist-table col.col-km { width: 168px; }
.veh-detail .veh-hist-table col.col-st { width: 118px; }
.veh-detail .veh-hist-table col.col-act { width: 228px; }
.veh-detail .veh-hist-table tbody tr {
  height: 52px;
}
.veh-detail .veh-hist-table .btn-small {
  min-height: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
}
.veh-detail .veh-hist-table td.num {
  white-space: nowrap;
  line-height: 1.3;
}
.veh-detail .veh-hist-table .veh-hist-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.veh-detail .veh-hist-table .row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow: visible;
}
.veh-detail .veh-history .empty {
  padding: 18px 12px;
}
.veh-detail .veh-history .table-wrap {
  margin-top: 0;
}

@media (max-width: 1280px) {
  .veh-detail .veh-hist-table col.col-km { width: 150px; }
  .veh-detail .veh-hist-table col.col-st { width: 104px; }
  .veh-detail .veh-hist-table col.col-act { width: 210px; }
  .veh-detail .veh-hist-table .btn-small { padding: 0 8px; }
}

@media (max-width: 1100px) {
  .veh-detail .veh-hist-table col.col-date { width: 78px; }
  .veh-detail .veh-hist-table col.col-no { width: 126px; }
  .veh-detail .veh-hist-table col.col-km { width: 136px; }
  .veh-detail .veh-hist-table col.col-st { width: 92px; }
  .veh-detail .veh-hist-table col.col-act { width: 188px; }
}

@media (max-width: 1200px) {
  .veh-detail .info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .veh-detail .vehicle-hero {
    align-items: stretch;
    padding: 12px 0 8px;
  }
  .veh-detail .vehicle-hero .page-actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
  .veh-detail .veh-hero-title {
    flex-direction: column;
    gap: 4px;
  }
  .veh-detail .info-grid {
    grid-template-columns: 1fr 1fr;
  }
  .veh-detail .stat {
    min-height: 80px;
  }
  .veh-detail .veh-hist-table tbody tr {
    height: auto;
  }
  .veh-detail .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .veh-detail .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calc-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.calc-strip span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.calc-strip strong { font-variant-numeric: tabular-nums; font-size: 15px; }
.calc-strip .sale strong { color: var(--accent); }

#modal-root { display: none; }
#modal-root.open {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1200;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal {
  position: relative;
  margin: 7vh auto;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  width: calc(100% - 24px);
  max-width: var(--modal-max, 520px);
  max-height: calc(100vh - 24px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .18);
  border-radius: 16px;
  z-index: 1201;
}
.modal-head, .modal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
  flex-shrink: 0;
  background: #FFFFFF;
  z-index: 1;
}
.modal-head {
  height: 72px;
  padding: 0 24px;
  border-bottom: 1px solid #E5E7EB;
}
.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
}
.modal-foot {
  min-height: 68px;
  padding: 16px 24px;
  border-bottom: 0;
  border-top: 1px solid #E5E7EB;
  justify-content: flex-end;
  gap: 8px;
}
.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
}
.modal .form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.modal .form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.modal .form-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.modal .field-error {
  display: none;
  font-size: 12px;
  font-weight: 600;
  color: #c2410c;
  line-height: 1.3;
}
.modal .form-group.has-error .field-error {
  display: block;
}
.modal .form-group.has-error input,
.modal .form-group.has-error select,
.modal .form-group.has-error textarea {
  border-color: #E11D48;
}
.modal .form-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  min-width: 0;
  width: 100%;
}
.modal .form-group > label,
.modal .form-grid > label {
  display: block;
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin: 0;
  line-height: 1.3;
}
.modal .form-grid > label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  margin-bottom: 0;
}
.modal .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.modal .form-grid .span-2 { grid-column: 1 / -1; }
.modal input,
.modal select,
.modal textarea,
.modal input:not([type]),
.modal input[type="text"],
.modal input[type="number"],
.modal input[type="email"],
.modal input[type="tel"] {
  display: block;
  width: 100%;
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid #D8DEE8;
  border-radius: 9px;
  background: #FFFFFF;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 400;
  color: #0F172A;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.modal input[type="date"] {
  display: block;
  width: 100%;
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid #D8DEE8;
  border-radius: 9px;
  background: #FFFFFF;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 400;
  color: #0F172A;
  font-family: inherit;
  -webkit-appearance: auto;
  appearance: auto;
}
.modal textarea {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}
.modal select {
  background-color: #FFFFFF;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748B 50%),
    linear-gradient(135deg, #64748B 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  padding-right: 40px;
  cursor: pointer;
}
.modal input::placeholder,
.modal textarea::placeholder {
  color: #94A3B8;
  font-size: 13px;
}
.modal input:hover,
.modal select:hover,
.modal textarea:hover {
  border-color: #C5CDD8;
}
.modal input:focus,
.modal select:focus,
.modal textarea:focus,
.modal input:focus-visible,
.modal select:focus-visible,
.modal textarea:focus-visible {
  outline: none;
  border: 1px solid #C9952E;
  box-shadow: 0 0 0 3px rgba(201, 149, 46, .12);
}
.modal input[type="number"] {
  -moz-appearance: textfield;
}
.modal input[type="number"]::-webkit-outer-spin-button,
.modal input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.modal .form-grid label input,
.modal .form-grid label select,
.modal .form-grid label textarea {
  margin-top: 0;
  font-weight: 400;
  color: #0F172A;
}
.modal .calc-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 0;
  padding: 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
}
.modal .calc-strip span {
  display: block;
  color: #64748B;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
}
.modal .calc-strip strong {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: #0F172A;
  font-weight: 700;
}
.modal .calc-strip div:nth-child(2) strong,
.modal .calc-strip .sale strong {
  color: #C9952E;
}
.modal-foot .btn {
  height: 42px;
  min-height: 42px;
  border-radius: 9px;
  padding: 0 16px;
  min-width: 96px;
}
.modal-foot .btn:not(.btn-primary):not(.btn-danger) {
  background: #FFFFFF;
  border: 1px solid #D8DEE8;
  color: #334155;
}
.modal-foot .btn:not(.btn-primary):not(.btn-danger):hover {
  background: #F8FAFC;
}
.modal-foot .btn-primary {
  background: #C9952E;
  border: none;
  color: #FFFFFF;
  font-weight: 600;
}
.modal-foot .btn-primary:hover {
  background: #B48427;
  border: none;
  color: #FFFFFF;
}
.icon-btn {
  border: 0;
  background: none;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  width: 44px;
  height: 44px;
  color: var(--muted);
  flex-shrink: 0;
  border-radius: 8px;
}
.icon-btn:hover { color: var(--text); background: var(--paper); }
.modal-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #64748B;
}
.modal-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.modal-close:hover { color: #0F172A; background: #F1F5F9; }
.modal-close:focus,
.modal-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 149, 46, .12);
}
.confirm-text { margin: 0; font-size: 14px; line-height: 1.55; }
body.modal-open { overflow: hidden; }

#vehicle-modal-form .ss-combo {
  position: relative;
  width: 100%;
}
#vehicle-modal-form .ss-control {
  display: flex;
  align-items: center;
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid #D8DEE8;
  border-radius: 9px;
  background: #FFFFFF;
  padding: 0 8px 0 10px;
  gap: 4px;
}
#vehicle-modal-form .ss-combo.is-open .ss-control,
#vehicle-modal-form .ss-control:focus-within {
  border-color: #C9952E;
  box-shadow: 0 0 0 3px rgba(201, 149, 46, .12);
}
#vehicle-modal-form .form-group.has-error .ss-control {
  border-color: #E11D48;
  box-shadow: none;
}
#vehicle-modal-form .ss-ico {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: #94A3B8;
  pointer-events: none;
}
#vehicle-modal-form .ss-ico svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}
#vehicle-modal-form .ss-control input,
#vehicle-modal-form .ss-control input[type="text"] {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 6px;
  box-shadow: none;
  font-size: 14px;
}
#vehicle-modal-form .ss-control input:hover,
#vehicle-modal-form .ss-control input:focus,
#vehicle-modal-form .ss-control input:focus-visible {
  border: 0;
  box-shadow: none;
  outline: none;
}
#vehicle-modal-form .ss-clear,
#vehicle-modal-form .ss-caret {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #64748B;
  padding: 0;
  cursor: pointer;
  border-radius: 6px;
}
#vehicle-modal-form .ss-clear {
  font-size: 18px;
  line-height: 1;
}
#vehicle-modal-form .ss-caret {
  position: relative;
}
#vehicle-modal-form .ss-caret::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -4px 0 0 -3px;
  border-right: 1.6px solid #64748B;
  border-bottom: 1.6px solid #64748B;
  transform: rotate(45deg);
}
#vehicle-modal-form .ss-combo.is-open .ss-caret::before {
  margin-top: -1px;
  transform: rotate(225deg);
}
#vehicle-modal-form .ss-clear:hover,
#vehicle-modal-form .ss-caret:hover {
  background: #F8FAFC;
  color: #0F172A;
}
#modal-root .ss-menu {
  position: fixed;
  z-index: 1400;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
  padding: 4px 0;
  box-sizing: border-box;
}
#modal-root .ss-option {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  height: 48px;
  padding: 6px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  color: #0F172A;
}
#modal-root .ss-option:hover,
#modal-root .ss-option.is-active {
  background: #FFF8EE;
}
#modal-root .ss-option.is-selected {
  background: #F8EDD8;
}
#modal-root .ss-name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
}
#modal-root .ss-phone {
  font-size: 12px;
  color: #64748B;
  margin-top: 2px;
}
#modal-root .ss-empty {
  padding: 14px;
  color: #64748B;
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 768px) {
  #modal-root .ss-option {
    min-height: 48px;
  }
  #vehicle-modal-form .ss-clear,
  #vehicle-modal-form .ss-caret {
    min-height: 28px;
    height: 28px;
  }
}

/* Yeni Kasa Hareketi modalı — yalnızca bu form */
#modal-root:has(.cm-new-form) .modal-head {
  height: 56px;
  padding: 0 24px;
}
#modal-root:has(.cm-new-form) .modal-body {
  padding: 24px;
  gap: 0;
}
#modal-root:has(.cm-new-form) .modal-foot {
  min-height: 0;
  padding: 16px 24px;
}
.cm-new-form.form-grid {
  gap: 12px 14px;
}
.cm-new-form .cm-lab {
  display: inline;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  line-height: 1.3;
  margin-bottom: 6px;
}
.cm-new-form > label {
  gap: 6px;
}
.cm-new-form > label input,
.cm-new-form > label select {
  height: 42px;
  min-height: 42px;
  border-radius: 9px;
  padding: 0 12px;
  font-size: 14px;
}
.cm-new-form > label select {
  padding-right: 36px;
  background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
}
.cm-type-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.cm-type-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  line-height: 1.3;
}
.cm-type-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cm-type {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
  margin: 0;
  border: 1px solid #D8DEE8;
  border-radius: 9px;
  background: #FFFFFF;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  box-sizing: border-box;
}
.cm-type input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.cm-type span {
  line-height: 1.2;
  text-align: center;
}
.cm-type:has(input:checked) {
  border-color: #C9952E;
  background: rgba(201, 149, 46, 0.14);
  color: #0F172A;
}

@media (max-width: 768px) {
  #modal-root:has(.cm-new-form) .modal-head,
  #modal-root:has(.cm-new-form) .modal-body,
  #modal-root:has(.cm-new-form) .modal-foot {
    padding-left: 20px;
    padding-right: 20px;
  }
  .cm-new-form.form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .cm-type {
    font-size: 12px;
    padding: 0 8px;
  }
}

#toast-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 70;
  max-width: min(360px, calc(100vw - 24px));
}
.toast {
  background: var(--sidebar);
  color: #fff;
  padding: 11px 14px;
  min-width: 240px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: 10px;
}
.toast-ico { font-weight: 700; line-height: 1.3; }
.toast-ok { background: var(--ok); }
.toast-error { background: var(--danger); }
.toast-warn { background: var(--warn); }
.toast.out { opacity: 0; }

.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(21, 32, 51, .4);
  z-index: 35;
}
.backdrop.show { display: block; }

#print-root {
  display: none;
  pointer-events: none !important;
}
#print-root.pdf-capture {
  display: block;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 0;
  width: 210mm;
  background: #fff;
  color: #111;
  pointer-events: none !important;
}

#pdf-capture-host {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  background: #ffffff;
  color: #111111;
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
  z-index: 0;
  overflow: hidden;
}
#pdf-capture-host[data-active="1"] {
  width: 794px;
  height: auto;
  visibility: visible;
  overflow: visible;
  pointer-events: none !important;
}
#pdf-capture-host .print-sheet,
#pdf-capture-host .print-document {
  width: 794px !important;
  max-width: 794px !important;
  min-height: 0 !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 8px 8px 10px !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
  color: #1a1f2b !important;
  font-family: Arial, "Segoe UI", Helvetica, sans-serif !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
}
#pdf-capture-host .print-stack {
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  min-height: 0 !important;
}
#pdf-capture-host .print-foot {
  margin-top: 10px !important;
  flex: 0 0 auto !important;
}
#pdf-capture-host .print-info-grid,
#pdf-capture-host .print-split {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  width: 100% !important;
}
#pdf-capture-host .print-info-grid > *,
#pdf-capture-host .print-split > * {
  width: 50% !important;
  flex: 1 1 50% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
#pdf-capture-host .print-info-grid > *:first-child,
#pdf-capture-host .print-split > *:first-child {
  margin-right: 10px !important;
}

.print-document,
.print-sheet {
  box-sizing: border-box;
  width: 210mm;
  min-height: 0;
  padding: 8mm 8mm 10mm;
  background: #fff;
  color: #1a1f2b;
  font-family: Arial, "Segoe UI", Helvetica, sans-serif;
  font-size: 10px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.print-stack {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  min-height: 0;
}
.print-top,
.print-block {
  flex: 0 0 auto;
}
.print-logo { display: none !important; }
.print-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 0;
  padding: 2px 0 4px;
  flex: 0 0 auto;
}
.print-title-block { min-width: 0; flex: 1; }
.print-doc-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #0B1421;
  line-height: 1.15;
}
.print-doc-tagline {
  margin: 5px 0 0;
  font-size: 9.5px;
  color: #5b6575;
  letter-spacing: .02em;
}
.print-order {
  flex: 0 0 auto;
  min-width: 188px;
  display: grid;
  gap: 3px;
}
.print-order div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.print-order span {
  color: #6b7280;
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.print-order strong {
  font-size: 10.5px;
  font-weight: 700;
  color: #0B1421;
  text-align: right;
}
.print-gold {
  height: 1px;
  background: #C9952E;
  margin: 4px 0 0;
  flex: 0 0 auto;
}
.print-info-grid {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  margin: 0;
  flex: 0 0 auto;
}
.print-info-grid > * {
  width: 50%;
  flex: 1 1 50%;
  min-width: 0;
  box-sizing: border-box;
}
.print-info-grid > *:first-child {
  margin-right: 10px;
}
.print-info-card {
  background: #f7f8fa;
  border: 1px solid #e6e8ee;
  border-radius: 7px;
  padding: 8px 10px;
  min-height: 0;
}
.print-info-card.print-text {
  min-height: 0;
}
.print-info-card h3,
.print-text h3,
.print-note h3,
.print-tot h3,
.print-maint h3,
.print-sheet > h3 {
  font-size: 10.5px;
  margin: 0 0 4px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #0B1421;
  border-bottom: 0;
  padding: 0;
  font-weight: 800;
}
.print-strong {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
}
.print-muted {
  margin: 2px 0 0;
  font-size: 9.5px;
  color: #4b5563;
  line-height: 1.35;
}
.print-text,
.print-note {
  margin: 0;
}
.print-text {
  min-height: 0;
  flex: 0 0 auto;
}
.print-text p,
.print-note p {
  margin: 0;
  font-size: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1f2937;
}
.print-text.is-empty,
.print-note.is-empty {
  margin-bottom: 0;
}
.print-text.is-empty {
  min-height: 0;
}
.print-text.is-empty p,
.print-note.is-empty p,
.print-dash {
  margin: 0;
  font-size: 10px;
  color: #9ca3af;
}
.print-block > h3,
.print-sheet > h3,
.print-document > h3 {
  margin: 0 0 6px;
  flex: 0 0 auto;
  border-bottom: 1px solid #C9952E;
  padding-bottom: 4px;
}
.print-sheet table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  table-layout: fixed;
  flex: 0 0 auto;
}
.print-sheet th,
.print-sheet td {
  border-bottom: 1px solid #e5e7eb;
  padding: 5px 6px;
  text-align: left;
  font-size: 9px;
  word-wrap: break-word;
  vertical-align: middle;
}
.print-sheet tbody td {
  height: auto;
}
.print-sheet thead th {
  height: auto;
  padding: 5px 6px;
  background: #f4f6f8;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #374151;
}
.print-sheet .num { text-align: right; }
.print-parts th:nth-child(1),
.print-parts td:nth-child(1) { width: 28px; }
.print-parts th:nth-child(3),
.print-parts td:nth-child(3) { width: 64px; }
.print-parts th:nth-child(4),
.print-parts td:nth-child(4),
.print-parts th:nth-child(5),
.print-parts td:nth-child(5) { width: 92px; }
.print-labor th:nth-child(1),
.print-labor td:nth-child(1) { width: 28px; }
.print-labor th:nth-child(3),
.print-labor td:nth-child(3) { width: 100px; }
.print-split {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  margin: 0;
  min-height: 0;
  flex: 0 0 auto;
}
.print-split > * {
  width: 50%;
  flex: 1 1 50%;
  min-width: 0;
  box-sizing: border-box;
}
.print-split > *:first-child {
  margin-right: 10px;
}
.print-note {
  background: #f7f8fa;
  border: 1px solid #e6e8ee;
  border-radius: 7px;
  padding: 8px 10px;
  min-height: 0;
}
.print-note.is-empty { min-height: 0; }
.print-tot {
  width: auto;
  margin: 0;
  border: 1px solid #e6e8ee;
  border-radius: 7px;
  padding: 8px 10px;
  background: #f7f8fa;
  min-height: 0;
}
.print-tot div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2px 0;
  gap: 10px;
  font-size: 9.5px;
  color: #374151;
}
.print-tot-sum {
  margin-top: 3px;
  padding-top: 5px !important;
  border-top: 1px solid #d1d5db;
  font-size: 12px !important;
  color: #0B1421 !important;
}
.print-remain {
  color: #8a6a1f !important;
}
.print-remain strong {
  color: #C9952E;
  font-size: 12.5px;
}
.print-maint {
  margin: 0;
  padding: 6px 0 0;
  border-top: 1px solid #e6e8ee;
  min-height: 0;
  flex: 0 0 auto;
}
.print-maint-row {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  font-size: 9.5px;
  padding: 1px 0;
}
.print-maint-row span { min-width: 110px; }
.print-maint-row span { color: #6b7280; }
.print-maint-note {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 8.5px;
}
.print-foot {
  margin-top: 10px;
  padding-top: 8px;
  padding-bottom: 2px;
  border-top: 1px solid #C9952E;
  text-align: center;
  flex: 0 0 auto;
}
.print-foot strong {
  display: block;
  font-size: 10.5px;
  color: #0B1421;
  letter-spacing: .06em;
}
.print-foot span {
  color: #C9952E;
  font-weight: 700;
  font-size: 8.5px;
}
.print-avoid { page-break-inside: avoid; break-inside: avoid; }
.print-sheet tr, .print-sheet thead { page-break-inside: avoid; break-inside: avoid; }

.wa-msg-label { display: block; font-size: 12px; font-weight: 650; color: var(--muted); margin-top: 12px; }
.wa-msg-label textarea { margin-top: 6px; min-height: 140px; font-weight: 400; color: var(--text); }

.page-slogan {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: .14em;
  font-weight: 700;
  white-space: nowrap;
}
.page-slogan::before, .page-slogan::after {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--accent-2);
}
.dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.dash-main, .dash-aside { min-width: 0; }
.panel-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.panel-link:hover { color: var(--text); text-decoration: none; }
.cash-hero { text-align: left; margin-bottom: 14px; }
.cash-hero strong {
  display: block;
  font-size: 32px;
  letter-spacing: -0.04em;
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}
.cash-hero span { color: var(--muted); font-size: 13px; }
.cash-mini { display: flex; flex-direction: column; gap: 8px; }
.cash-mini div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.cash-mini span { color: var(--muted); }
.flow-list { display: flex; flex-direction: column; gap: 10px; }
.flow-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.flow-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.flow-ico svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.flow-in { background: var(--ok-bg); color: var(--ok); }
.flow-out { background: var(--danger-bg); color: var(--danger); }
.flow-item strong { display: block; font-variant-numeric: tabular-nums; }
.flow-item p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.flow-date { color: var(--muted); font-size: 12px; }
.promo-card {
  background: linear-gradient(180deg, #151c2c, #0b101c);
  color: #fff;
  border: 0;
  overflow: hidden;
  position: relative;
}
.promo-card h2 { color: #fff; font-size: 22px; line-height: 1.25; margin-bottom: 10px; }
.promo-card .gold-line { width: 48px; height: 2px; background: var(--accent-2); margin-bottom: 16px; }
.promo-list { display: flex; flex-direction: column; gap: 10px; }
.promo-list div { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #d5dbe6; }
.promo-list svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--accent-3);
  stroke-width: 1.7;
  stroke-linecap: round;
  flex-shrink: 0;
}

@media (min-width: 1600px) {
  #view { padding: 24px 40px 40px; }
  .topbar { padding: 12px 40px; }
}

@media (max-width: 1440px) {
  #view { padding: 22px 28px 36px; }
  .topbar { padding: 12px 28px; }
}

@media (max-width: 1200px) {
  #view { padding: 20px 24px 32px; }
  .topbar { padding: 12px 24px; }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  #view { padding: 20px 24px 32px; }
  .topbar { padding: 12px 24px; }
}

@media (max-width: 992px) {
  .wo-layout, .detail-layout, .dash-layout { grid-template-columns: 1fr; }
  .wo-side .totals, .detail-layout .totals { position: static; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid, .calc-strip, .maint-grid, .entity-grid { grid-template-columns: 1fr 1fr; }
  .tl-item { grid-template-columns: 1fr auto; }
  .tl-date { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px, 86vw);
    min-width: 0;
    flex: none;
    height: 100%;
    transform: translateX(-105%);
    z-index: 40;
    transition: transform .18s ease;
    box-shadow: none;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .brand { height: 172px; flex-basis: 172px; padding-top: 20px; }
  .brand-logo { width: 200px; max-width: 200px; }
  .hamburger { display: flex; }
  .topbar-brand { display: flex; flex: 1 1 auto; }
  .topbar { flex-wrap: wrap; padding: 10px 14px; }
  .topbar-end { width: 100%; justify-content: flex-end; }
  .page-slogan { display: none; }
  .global-search { flex: 1 1 100%; max-width: none; width: 100%; }
  .form-grid, .form-row, .detail-grid, .info-grid, .pay-meta, .quick-actions, .vehicle-card, .calc-strip, .maint-grid, .entity-grid, .choice-group {
    grid-template-columns: 1fr;
  }
  .detail-layout .wo-detail-notes {
    grid-template-columns: 1fr;
  }
  .page-head, .vehicle-hero, .wo-hero { flex-direction: column; align-items: stretch; }
  .doc-actions { justify-content: stretch; }
  .page-head .page-actions,
  .wo-actions,
  .vehicle-hero .page-actions,
  .panel .page-actions,
  .form-actions,
  .doc-actions {
    width: 100%;
  }
  .page-head .page-actions .btn,
  .vehicle-hero .page-actions .btn,
  .panel .page-actions .btn,
  .form-actions .btn {
    flex: 1 1 100%;
    min-width: 0;
  }
  .wo-actions .btn,
  .doc-actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
  #view { padding: 16px 14px 28px; }
  .has-cards > .table-wrap { display: none; }
  .list-cards { display: flex; flex-direction: column; gap: 10px; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr {
    border: 1px solid var(--line);
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
  }
  .data-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 0;
    text-align: right;
    padding: 7px 0;
    min-width: 0;
    white-space: normal;
  }
  .data-table td.num { text-align: right; }
  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    text-align: left;
    font-weight: 650;
    flex: 0 0 auto;
  }
  .inline-parts td,
  .inline-labor td {
    align-items: center;
  }
  .inline-parts td .inline-input,
  .inline-parts td .inline-select,
  .inline-labor td .inline-input {
    flex: 1 1 auto;
    min-width: 0;
  }
  .inline-parts td.row-actions,
  .inline-labor td.row-actions {
    justify-content: flex-end;
  }
  .inline-parts td.row-actions::before,
  .inline-labor td.row-actions::before {
    content: "";
  }
  .btn, .chip { min-height: 44px; }
  .chip { padding: 8px 14px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-field { flex: 1 1 auto; width: 100%; }
  .cash-filters { flex-direction: column; align-items: stretch; }
  .cash-dates { width: 100%; flex-direction: column; }
  .cash-dates label { width: 100%; }
  .row-actions .link, .item-card-actions .link {
    min-height: 44px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
  }
  #modal-root.open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
  .modal {
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .modal-head {
    flex: 0 0 auto;
    padding: 0 20px;
  }
  .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
  }
  .modal-foot {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: #FFFFFF;
    border-top: 1px solid #E5E7EB;
  }
  .modal-foot .btn {
    width: 100%;
    min-width: 0;
    flex: none;
    height: 44px;
    min-height: 44px;
    white-space: nowrap;
  }
  .modal .calc-strip { grid-template-columns: repeat(3, 1fr); }
  .tl-item { grid-template-columns: 1fr; }
  .tl-actions .btn { min-height: 44px; }
  input[type="search"],
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px;
  }
  .stat-value { font-size: 22px; }
  h1 { font-size: 22px; }
  .wo-no { font-size: 20px; }
  .panel { padding: 14px; }
  .toast { min-width: 0; width: 100%; }
  #toast-root { left: 12px; right: 12px; max-width: none; }
}

@media (max-width: 576px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-head .page-actions .btn,
  .wo-actions .btn,
  .doc-actions .btn,
  .vehicle-hero .page-actions .btn,
  .panel .page-actions .btn,
  .form-actions .btn {
    flex: 1 1 100%;
  }
  .plate-lg { font-size: 20px; letter-spacing: .06em; }
  .print-tot { width: 100%; }
  .modal {
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    border-radius: 16px;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
  }
  .modal .form-row,
  .modal .form-row-3,
  .modal .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  #view { padding: 12px 10px 24px; }
  .topbar { padding: 10px; }
  .quick-btn { min-height: 72px; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { background: #fff !important; }
  body * { visibility: hidden; }
  #print-root, #print-root * { visibility: visible; }
  #print-root {
    display: block;
    position: absolute;
    inset: 0;
    background: #fff;
    color: #1a1f2b;
    padding: 0;
  }
  .print-document,
  .print-sheet {
    width: 210mm !important;
    min-height: 0 !important;
    max-width: 210mm !important;
    padding: 8mm 8mm 10mm !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }
  .print-stack {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }
  .print-info-grid,
  .print-split {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    width: 100% !important;
  }
  .print-info-grid > *,
  .print-split > * {
    width: 50% !important;
    flex: 1 1 50% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .print-info-grid > *:first-child,
  .print-split > *:first-child {
    margin-right: 10px !important;
  }
  .print-tot { width: auto !important; }
}
