﻿:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef2f5;
  --surface-raised: #fbfcfd;
  --line: #d6dde4;
  --line-soft: rgba(214, 221, 228, 0.7);
  --text: #1c2733;
  --ink: var(--text);
  --muted: #657487;
  --soft: #eef7f2;
  --brand: #246b52;
  --brand-strong: #18533f;
  --brand-soft: #e8f3ef;
  --sidebar-bg-start: #0d2c21;
  --sidebar-bg-mid: #0f211b;
  --sidebar-bg-end: #0b1814;
  --sidebar-glow: rgba(49, 112, 88, 0.55);
  --sidebar-active-start: rgba(44, 139, 105, 0.72);
  --sidebar-active-end: rgba(32, 87, 68, 0.72);
  --sidebar-icon: #bfe3d3;
  --accent: #c27a2c;
  --danger: #b93f3f;
  --success-soft: #e6f4ee;
  --warning-soft: #fff6e8;
  --danger-soft: #fff1f1;
  --focus-ring: 0 0 0 3px rgba(36, 107, 82, 0.16);
  --shadow: 0 18px 45px rgba(31, 45, 61, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 22%, color-mix(in srgb, var(--brand-soft) 72%, #ffffff), transparent 30%),
    radial-gradient(circle at 86% 8%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 24%),
    linear-gradient(145deg, var(--sidebar-bg-start), var(--sidebar-bg-mid) 48%, var(--sidebar-bg-end));
}

.login-screen[hidden] {
  display: none;
}

.login-panel {
  display: grid;
  gap: 18px;
  width: min(520px, 100%);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand-soft) 30%, var(--surface)), var(--surface) 38%),
    var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  padding: 34px 44px;
}

.login-screen .login-brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  color: var(--text);
  margin-bottom: 0;
  text-align: center;
}

.login-screen .login-brand .brand-mark {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 82%, #ffffff), var(--brand-strong));
  box-shadow: 0 18px 34px color-mix(in srgb, var(--brand) 34%, transparent);
  font-size: 25px;
}

.login-screen .login-brand .brand-mark.brand-logo {
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  padding: 8px;
}

.login-screen .login-brand div {
  display: grid;
  gap: 2px;
}

.login-screen .login-brand strong {
  font-size: 16px;
}

.login-screen .login-brand span,
.login-heading p {
  color: var(--brand-strong);
}

.login-heading {
  display: grid;
  gap: 6px;
  text-align: center;
}

.login-heading h1 {
  margin: 0;
  font-size: 32px;
}

.login-heading p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field > span,
.login-options {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-field-control,
.password-field {
  position: relative;
  display: grid;
  align-items: center;
}

.login-field-control svg,
.password-field > svg {
  position: absolute;
  left: 14px;
  z-index: 2;
  width: 18px;
  height: 18px;
  color: var(--brand-strong);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  pointer-events: none;
}

.login-field-control input,
.password-field input {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 92px 0 44px;
}

.login-field-control input {
  padding-right: 14px;
}

.login-field-control input:focus,
.password-field input:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
  outline: none;
}

.login-password-toggle {
  position: absolute;
  right: 8px;
  z-index: 3;
  display: inline-flex;
  width: auto;
  min-width: 62px;
  height: 32px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand-strong);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.login-password-toggle:hover {
  background: var(--brand-soft);
}

.login-password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
}

.login-password-toggle span {
  position: static;
  width: auto;
  height: auto;
  clip: auto;
  overflow: visible;
  white-space: normal;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -2px;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.login-error {
  border: 1px solid rgba(196, 57, 57, 0.32);
  border-radius: 8px;
  background: #fff3f3;
  color: #9d2525;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
}

.login-submit {
  gap: 8px;
  width: 100%;
  min-height: 48px;
  box-shadow: 0 14px 26px color-mix(in srgb, var(--brand) 28%, transparent);
}

.login-submit svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.app-shell[hidden] {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
input,
select,
textarea {
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.primary-action,
.secondary-action,
.warning-action,
.success-action,
.danger-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
  text-decoration: none;
}

.primary-action:hover:not(:disabled),
.success-action:hover:not(:disabled) {
  background: var(--brand-strong);
  box-shadow: 0 8px 18px rgba(24, 83, 63, 0.18);
}

.secondary-action:hover:not(:disabled) {
  border-color: rgba(36, 107, 82, 0.36);
  background: #f4faf7;
  color: var(--brand-strong);
}

.warning-action:hover:not(:disabled) {
  background: #a86421;
}

.danger-action:hover:not(:disabled) {
  background: #9e3333;
}

.primary-action:focus-visible,
.secondary-action:focus-visible,
.warning-action:focus-visible,
.success-action:focus-visible,
.danger-action:focus-visible,
.icon-button:focus-visible,
.tab-button:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

.primary-action {
  background: var(--brand);
  color: #fff;
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand-strong);
}

.warning-action {
  background: var(--accent);
  color: #fff;
}

.success-action {
  background: var(--brand);
  color: #fff;
}

.danger-action {
  background: var(--danger);
  color: #fff;
}

.compact-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

td .secondary-action,
td .primary-action,
td .warning-action,
td .success-action,
td .danger-action {
  margin: 2px 4px 2px 0;
}

button:disabled,
.primary-action:disabled,
.secondary-action:disabled,
.warning-action:disabled,
.success-action:disabled,
.danger-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #e6edf1;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.active {
  background: #dcece5;
  color: var(--brand-strong);
}

.badge.inactive,
.badge.warning {
  background: #fff2df;
  color: #94580d;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.checkbox-field {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 40px;
}

.checkbox-field input {
  width: 18px;
  min-height: 18px;
}

input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  accent-color: var(--brand);
  cursor: pointer;
}

.permissions-panel {
  display: grid;
  gap: 10px;
}

.permissions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.permissions-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.permissions-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.permissions-grid {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) repeat(9, minmax(34px, 48px));
  gap: 6px;
  align-items: center;
}

.permission-row strong,
.permission-row span {
  color: var(--text);
  font-size: 12px;
}

.permission-row.header span {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.permission-row label {
  display: grid;
  place-items: center;
}

.permission-row input {
  width: 18px;
  min-height: 18px;
}

.permission-row input:disabled {
  opacity: 0.45;
}

input,
select,
textarea {
  position: relative;
  z-index: 1;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 78px;
  padding: 10px 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.autocomplete {
  position: relative;
}

.autocomplete-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 12;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.autocomplete-option {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  padding: 9px 11px;
  text-align: left;
}

.autocomplete-option:hover,
.autocomplete-option:focus {
  background: var(--surface-soft);
}

.autocomplete-option span,
.autocomplete-empty {
  color: var(--muted);
  font-size: 12px;
}

.autocomplete-empty {
  padding: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.dashboard-panel {
  display: grid;
  gap: 18px;
}

.table-wrap,
.editor,
.work-detail-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow: auto;
  min-height: 360px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-soft);
  color: #3d4c5d;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

tbody tr {
  transition:
    background-color 0.14s ease,
    box-shadow 0.14s ease;
}

tbody tr:hover {
  background: #fbfdfc;
}

.actions-col {
  width: 120px;
}

.selected-row {
  background: #f2f8f5;
  box-shadow: inset 3px 0 0 var(--brand);
}

.editor-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(24, 38, 34, 0.46);
  padding: 18px;
}

.editor-modal,
.modal {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid rgba(150, 176, 166, 0.55);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8faf9 100%);
  box-shadow: 0 24px 70px rgba(18, 32, 28, 0.24);
}

.editor-modal {
  position: fixed;
  inset: 18px auto auto 50%;
  z-index: 31;
  display: grid;
  gap: 14px;
  transform: translateX(-50%);
  padding: 18px;
}

.editor.custom-field-layout,
.editor-modal.custom-field-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.editor.custom-field-layout > .field-grid,
.editor-modal.custom-field-layout > .field-grid {
  grid-column: 1 / -1;
}

.editor-modal.module-form-promotions {
  width: min(760px, calc(100vw - 28px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.editor-modal.module-form-taxes {
  width: min(760px, calc(100vw - 28px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.editor-modal.module-form-payment-methods {
  width: min(720px, calc(100vw - 28px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.editor-modal.module-form-promotions > .editor-head,
.editor-modal.module-form-promotions > label:has(#nameInput),
.editor-modal.module-form-promotions > label:has(#notesInput),
.editor-modal.module-form-promotions > .form-actions,
.editor-modal.module-form-taxes > .editor-head,
.editor-modal.module-form-taxes > label:has(#nameInput),
.editor-modal.module-form-taxes > label:has(#notesInput),
.editor-modal.module-form-taxes > .form-actions,
.editor-modal.module-form-payment-methods > .editor-head,
.editor-modal.module-form-payment-methods > label:has(#notesInput),
.editor-modal.module-form-payment-methods > .form-actions {
  grid-column: 1 / -1;
}

.editor-modal.module-form-promotions > .field-grid,
.editor-modal.module-form-taxes > .field-grid,
.editor-modal.module-form-payment-methods > .field-grid {
  display: contents;
}

.editor-modal.module-form-promotions label:has(#nameInput) {
  order: 1;
}

.editor-modal.module-form-promotions label:has(#personTypeInput) {
  order: 2;
}

.editor-modal.module-form-promotions label:has(#countryInput) {
  order: 3;
}

.editor-modal.module-form-promotions label:has(#taxConditionSelect) {
  order: 4;
}

.editor-modal.module-form-promotions label:has(#taxIdInput) {
  order: 5;
}

.editor-modal.module-form-promotions label:has(#userActiveInput) {
  order: 6;
  align-self: end;
  min-height: 40px;
}

.editor-modal.module-form-promotions label:has(#alternatePhoneInput) {
  order: 7;
}

.editor-modal.module-form-promotions label:has(#startDateInput) {
  order: 8;
}

.editor-modal.module-form-promotions label:has(#estimatedEndDateInput) {
  order: 9;
}

.editor-modal.module-form-promotions label:has(#postalCodeInput) {
  order: 5;
}

.editor-modal.module-form-promotions label:has(#notesInput) {
  order: 11;
}

.editor-modal.module-form-promotions > .form-actions {
  order: 20;
}

.editor-modal.module-form-taxes label:has(#nameInput) {
  order: 1;
}

.editor-modal.module-form-taxes label:has(#countryInput) {
  order: 3;
}

.editor-modal.module-form-taxes label:has(#personTypeInput) {
  order: 2;
}

.editor-modal.module-form-taxes label:has(#taxConditionSelect) {
  order: 4;
}

.editor-modal.module-form-taxes label:has(#taxIdInput) {
  order: 5;
}

.editor-modal.module-form-taxes label:has(#userActiveInput) {
  order: 6;
  align-self: end;
  min-height: 40px;
}

.editor-modal.module-form-taxes label:has(#alternatePhoneInput) {
  order: 7;
}

.editor-modal.module-form-taxes label:has(#startDateInput) {
  order: 8;
}

.editor-modal.module-form-taxes label:has(#estimatedEndDateInput) {
  order: 9;
}

.editor-modal.module-form-taxes label:has(#notesInput) {
  order: 10;
}

.editor-modal.module-form-taxes > .form-actions {
  order: 20;
}

.editor-modal.module-form-payment-methods label:has(#nameInput) {
  order: 1;
}

.editor-modal.module-form-payment-methods label:has(#taxIdInput) {
  order: 2;
}

.editor-modal.module-form-payment-methods label:has(#taxConditionSelect) {
  order: 3;
}

.editor-modal.module-form-payment-methods label:has(#personTypeInput) {
  order: 4;
}

.editor-modal.module-form-payment-methods label:has(#userActiveInput) {
  order: 5;
  align-self: center;
  min-height: 40px;
}

.editor-modal.module-form-payment-methods label:has(#countryInput) {
  order: 6;
}

.editor-modal.module-form-payment-methods label:has(#notesInput) {
  order: 7;
}

.editor-modal.module-form-payment-methods > .form-actions {
  order: 20;
  justify-content: end;
}

.editor-modal.module-form-payment-methods input,
.editor-modal.module-form-payment-methods select {
  height: 40px;
  min-height: 40px;
}

.editor-modal.module-form-payment-methods textarea {
  min-height: 86px;
}

.editor-modal.module-form-payment-methods > .form-actions button {
  width: auto;
  min-width: 96px;
  min-height: 40px;
}

.editor-modal.module-form-service-orders {
  width: min(860px, calc(100vw - 28px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.editor-modal.module-form-service-orders > .editor-head,
.editor-modal.module-form-service-orders > label:has(#nameInput),
.editor-modal.module-form-service-orders > label:has(#workCustomerInput),
.editor-modal.module-form-service-orders > label:has(#addressInput),
.editor-modal.module-form-service-orders > label:has(#notesInput),
.editor-modal.module-form-service-orders > [data-module-form-extra],
.editor-modal.module-form-service-orders > .form-actions {
  grid-column: 1 / -1;
}

.editor-modal.module-form-service-orders > .field-grid {
  display: contents;
}

.editor-modal.module-form-service-orders label:has(input:disabled) {
  opacity: 0.72;
}

.service-object-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(150, 176, 166, 0.55);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(135deg, #f3faf7 0%, #ffffff 70%);
}

.service-object-card-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.service-object-card-body strong {
  color: var(--ink);
}

.service-object-card-body p {
  margin: 0;
  color: var(--muted);
}

.service-object-card-actions {
  display: flex;
  justify-content: end;
}

.service-object-modal {
  width: min(760px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  padding: 18px;
}

.service-object-modal .field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.service-object-modal .full-row {
  grid-column: 1 / -1;
}

.service-object-modal textarea {
  min-height: 84px;
}

.editor-head,
.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.editor-head h2,
.modal-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.editor-head p,
.modal-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: #eef3f5;
  color: var(--muted);
  font-weight: 800;
}

.icon-button:hover:not(:disabled) {
  background: #e6f1ec;
  color: var(--brand-strong);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.form-actions {
  position: sticky;
  bottom: -18px;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 4px -18px -18px;
  border-top: 1px solid rgba(214, 221, 228, 0.9);
  background: rgba(248, 250, 249, 0.96);
  padding: 12px 18px;
}

.work-view-modal {
  width: min(1040px, calc(100vw - 28px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 20px;
  overflow: hidden;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.tab-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font-weight: 700;
}

.tab-button.active {
  border-color: var(--brand);
  background: #e8f2ed;
  color: var(--brand-strong);
}

.work-view-body {
  min-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.work-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.work-detail-grid > div,
.detail-row,
.history-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 11px;
}

.work-detail-grid strong {
  display: block;
  color: var(--text);
  font-size: 20px;
}

.work-detail-grid span,
.detail-row span {
  color: var(--muted);
  font-size: 12px;
}

.work-detail-section {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.work-detail-section h3 {
  margin: 0;
  font-size: 15px;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-row {
  display: grid;
  gap: 5px;
}

.detail-row strong {
  color: var(--text);
}

.work-view-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.upload-strip {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.workshop-parts-form {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(183, 204, 196, 0.8);
  border-radius: 8px;
  background: linear-gradient(180deg, #f5f9f7 0%, #edf4f1 100%);
  padding: 12px;
}

.workshop-inline-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(36, 107, 82, 0.22);
  border-radius: 8px;
  background: #e8f3ef;
  color: var(--brand-strong);
  padding: 10px 12px;
  font-weight: 700;
}

.workshop-inline-notice span {
  flex: 1 1 320px;
}

.workshop-inline-notice-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.workshop-cost-estimate {
  margin: 0;
  border: 1px solid rgba(36, 107, 82, 0.18);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--muted);
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 700;
}

.workshop-cost-estimate.warning {
  border-color: rgba(199, 61, 61, 0.35);
  background: #fff6f6;
  color: var(--danger);
}

.workshop-job-backdrop {
  z-index: 36;
  background: rgba(24, 38, 34, 0.36);
}

.workshop-job-editor-backdrop {
  z-index: 38;
  background: rgba(24, 38, 34, 0.42);
}

.workshop-job-modal {
  width: min(880px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 20px 22px 18px;
  overflow: hidden;
}

.workshop-job-detail-modal .modal-head {
  border-bottom: 1px solid rgba(214, 221, 228, 0.9);
  padding-bottom: 12px;
}

.workshop-job-detail-modal .modal-head h2 {
  font-size: 20px;
  line-height: 1.25;
}

.workshop-job-editor {
  width: min(860px, calc(100vw - 36px));
  max-height: min(680px, calc(100vh - 36px));
}

.workshop-job-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.workshop-job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(214, 221, 228, 0.9);
  border-radius: 8px;
  background: #f8faf9;
  padding: 10px;
  margin-bottom: 0;
}

.workshop-job-actions .compact-action {
  min-height: 38px;
  padding: 0 12px;
}

.workshop-job-body .detail-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workshop-job-detail-section {
  margin-top: 0;
}

.workshop-job-detail-section .detail-row {
  min-height: 74px;
  background: #f7faf9;
}

.workshop-job-parts-section {
  border-top: 1px solid rgba(214, 221, 228, 0.9);
  padding-top: 12px;
}

.workshop-job-parts-section .detail-row {
  background: #eef5f2;
}

.workshop-job-footer {
  position: sticky;
  bottom: -18px;
  z-index: 2;
  margin: 0 -22px -18px;
  border-top: 1px solid rgba(214, 221, 228, 0.9);
  background: rgba(248, 250, 249, 0.97);
  padding: 12px 22px;
}

.workshop-parts-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1.1fr) minmax(110px, 0.55fr) minmax(180px, 1.1fr);
  gap: 10px;
}

.workshop-job-edit-form {
  min-height: 0;
  overflow: visible;
}

.workshop-job-edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workshop-job-edit-grid label {
  min-width: 0;
}

.workshop-job-edit-grid textarea {
  min-height: 96px;
}

.workshop-job-edit-actions {
  position: sticky;
  bottom: -12px;
  z-index: 2;
  margin: 0 -12px -12px;
  border-top: 1px solid rgba(214, 221, 228, 0.9);
  background: rgba(248, 250, 249, 0.97);
  padding: 12px;
}

.workshop-parts-grid label {
  display: grid;
  gap: 6px;
}

.workshop-parts-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.inline-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.inline-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-form .full-row {
  grid-column: 1 / -2;
}

.service-task-row {
  align-items: start;
}

.service-task-row .inline-actions {
  justify-content: flex-end;
}

.service-parts-form,
.service-budget-form {
  margin-bottom: 14px;
}

.service-budget-panel {
  display: grid;
  gap: 14px;
}

.service-budget-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.service-budget-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.service-budget-card strong {
  color: var(--ink);
  font-size: 20px;
}

.service-budget-card span {
  color: var(--muted);
  font-size: 13px;
}

.service-budget-documents {
  display: grid;
  gap: 8px;
}

.service-budget-documents h3 {
  margin: 0;
}

.service-budget-row {
  align-items: center;
  gap: 12px;
}

.service-budget-row .badge {
  flex: 0 0 auto;
}

.file-browser {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  margin-top: 14px;
}

.file-upload-guidance {
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.selected-file-preview,
.file-preview-panel {
  display: grid;
  gap: 10px;
}

.file-preview-media {
  display: grid;
  min-height: 240px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.file-preview-media img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  text-align: left;
}

.file-list-item.active,
.file-list-item.selected {
  border-color: var(--brand);
  background: #e8f2ed;
}

.file-list-item span,
.selected-file-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.file-placeholder {
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .workspace,
  .field-grid,
  .work-detail-grid,
  .inline-form,
  .workshop-job-body .detail-list,
  .file-browser,
  .upload-strip,
  .workshop-job-edit-grid,
  .workshop-parts-grid {
    grid-template-columns: 1fr;
  }

  .inline-form-actions {
    justify-content: stretch;
  }

  .inline-form .full-row {
    grid-column: auto;
  }

  .inline-form-actions > button {
    width: 100%;
  }

  .editor-modal,
  .modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .editor.custom-field-layout,
  .editor-modal.custom-field-layout {
    grid-template-columns: 1fr;
  }
}

.contact-filter-fields {
  display: contents;
}
