:root {
  color-scheme: light;
  --bg: #f3f5f4;
  --panel: #ffffff;
  --ink: #171a19;
  --muted: #66706c;
  --line: #d9dfdc;
  --soft: #eef2ef;
  --filter-surface: #eef0ee;
  --filter-surface-line: #dde2df;
  --accent: #1b6f5b;
  --accent-2: #d8b45b;
  --danger: #b42318;
  --shadow: 0 12px 34px rgba(28, 35, 32, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.42 "Segoe UI", Arial, sans-serif;
}
button, input, select, textarea {
  font: inherit;
}
button {
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  padding: 7px 11px;
  cursor: pointer;
  min-height: 32px;
  line-height: 1.1;
}
button:hover { filter: brightness(.96); }
button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.readonly-disabled {
  cursor: not-allowed;
  opacity: .55;
}
body.role-guest .view#create,
body.role-guest .view#exports,
body.role-guest .view#settings {
  display: none !important;
}
button.ghost {
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 11px;
  border-radius: 7px;
  text-decoration: none;
  line-height: 1.1;
}
.button-link.ghost {
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 9px;
  outline: none;
}
textarea { resize: vertical; }
.date-picker-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
  position: relative;
}
.date-picker-btn {
  min-width: 36px;
  padding: 7px 0;
}
.native-date-picker {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
label input, label select, label textarea {
  color: var(--ink);
  font-weight: 400;
  font-size: 13px;
}
#estimateForm .estimate-customer-grid input,
#estimateForm .estimate-customer-grid textarea {
  font-size: 14px;
}

#estimateForm .estimate-customer-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#estimateForm .estimate-customer-grid,
.case-filters,
.calendar-filters,
.finance-import,
.stats-filter,
.panel.stats-filter {
  background: var(--filter-surface);
  border-radius: 8px;
  box-shadow: 0 0 0 8px var(--filter-surface);
}

#estimateForm .estimate-customer-grid,
.case-filters,
.calendar-filters,
.finance-import {
  border: 1px solid var(--filter-surface-line);
}

#estimateForm .estimate-customer-grid input,
#estimateForm .estimate-customer-grid select,
#estimateForm .estimate-customer-grid textarea {
  padding: 7px 8px;
}
#estimateForm .estimate-customer-grid label {
  grid-column: span 1;
  gap: 0;
  font-size: 0;
}
#estimateForm .estimate-customer-grid label > input,
#estimateForm .estimate-customer-grid label > select,
#estimateForm .estimate-customer-grid label > textarea {
  font-size: 14px;
}
#estimateForm .estimate-customer-grid input::placeholder,
#estimateForm .estimate-customer-grid textarea::placeholder {
  color: #8a97a4;
  opacity: 1;
}

.delivery-address-panel {
  margin-top: 10px;
  border: 1px solid var(--filter-surface-line);
  border-radius: 8px;
  background: var(--filter-surface);
  padding: 9px 10px 11px;
}
.delivery-address-panel.wide {
  grid-column: 1 / -1;
}
.delivery-address-panel summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}
.delivery-address-panel .delivery-toggle {
  margin: 8px 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.delivery-address-panel .delivery-toggle input {
  width: auto;
}
.delivery-address-panel .form-grid {
  margin-top: 8px;
}

.estimate-section {
  margin-top: 14px;
  border: 1px solid #d8dfdc;
  border-radius: 8px;
  background: #f4f6f5;
  overflow: hidden;
}

.estimate-section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 12px;
  background: #e4e8e6;
  border-bottom: 1px solid #d4dcda;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

.estimate-section-title small {
  color: var(--muted);
  font-weight: 700;
}

.estimate-section > .form-grid,
.estimate-section > .estimate-note-warning-row,
.estimate-section > .quick-price-preview,
.estimate-section > .quick-grid,
.estimate-section > .labor-quick,
.estimate-section > .estimate-note-grid,
.estimate-section > .quick-create {
  margin: 12px;
}

.estimate-note-warning-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.estimate-note-warning-row .public-note-field,
.estimate-note-warning-row .private-warning-field {
  font-size: 0;
  gap: 0;
  padding: 8px;
  border-radius: 8px;
}

.public-note-field {
  background: #f5fbf8;
  border: 1px solid #cfe6d8;
  color: #2f6942;
}

.private-warning-field {
  background: #fff7f7;
  border: 1px solid #efcaca;
  color: #9b2f2f;
}

.public-note-field small,
.private-warning-field small {
  display: none;
}
.estimate-note-warning-row .public-note-field textarea,
.estimate-note-warning-row .private-warning-field textarea {
  font-size: 13px;
}
.estimate-note-warning-row .public-note-field textarea,
.estimate-note-warning-row .private-warning-field textarea {
  min-height: 54px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  background: #111413;
  color: #fff;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.brand:hover,
.brand:focus-visible {
  background: #1d2521;
  border-color: #2a3933;
}
.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: #fff;
  border-radius: 7px;
}
.brand strong, .brand span { display: block; }
.brand span { color: #b8c1bd; font-size: 12px; }
nav { display: grid; gap: 6px; }
.nav {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #dfe5e2;
  border: 1px solid transparent;
}
.nav.active, .nav:hover {
  background: #202623;
  border-color: #323b37;
  color: #fff;
}
.sidebar-foot {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid #2d3531;
  color: #aeb8b4;
  display: grid;
  gap: 2px;
  font-size: 12px;
}
.sidebar-foot strong { color: #fff; }
.shell {
  margin-left: 244px;
  padding: clamp(12px, 1.5vw, 24px);
  max-width: none;
  width: auto;
  overflow-x: hidden;
}
.topbar {
  max-width: none;
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}
.topbar h1 {
  font-size: 24px;
  line-height: 1.1;
  margin: 0 0 5px;
}
.topbar p { margin: 0; color: var(--muted); }
.topbar > div:first-child {
  flex: 1 1 auto;
  min-width: 220px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 780px;
  min-width: 0;
}
.top-search-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
}
.top-search {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  color: var(--ink);
}
.top-search-suggestions {
  position: absolute;
  z-index: 100;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 5px;
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.top-search-suggestions.hidden { display: none; }
.top-search-result {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(90px, auto);
  gap: 4px 10px;
  width: 100%;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 7px;
  text-align: left;
}
.top-search-result:hover,
.top-search-result:focus {
  background: #f4f8f8;
  border-color: var(--line);
}
.top-search-result small {
  grid-column: 1 / -1;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-search-result span {
  justify-self: end;
  color: #176b87;
}
.top-search-empty {
  padding: 8px 10px;
  color: var(--muted);
}
button.danger {
  background: var(--danger);
  color: #fff;
}
.view {
  display: none;
  max-width: none;
  width: 100%;
  min-width: 0;
}
.view.active { display: grid; gap: 14px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px;
  min-width: 0;
  overflow: hidden;
}
#cases .panel {
  overflow: visible;
}
#calendar .calendar-panel,
#drivelog > .panel,
#finance > .panel,
#stats .panel.stats-filter,
.panel:has(.case-filters),
.panel:has(.calendar-filters),
.panel:has(.finance-import) {
  overflow: visible;
}
.muted {
  color: var(--muted);
  margin: 0;
}
.admin-panel {
  border-color: #d8b45b;
}
.document-text-bubbles {
  display: grid;
  gap: 14px;
}
.mail-template-bubbles {
  display: grid;
  gap: 14px;
}
.settings-bubble {
  border: 1px solid var(--line);
  border-left: 5px solid #176b87;
  border-radius: 8px;
  background: #f8faf9;
  padding: 0;
  overflow: hidden;
}
.settings-bubble h4 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #eef3f1;
  font-size: 15px;
  color: #17202a;
}
.mail-template-bubbles .settings-bubble h4 {
  color: #13677b;
}
.settings-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.settings-section,
.settings-outer-section {
  border: 1px solid var(--line);
  border-left: 5px solid #59636b;
  border-radius: 8px;
  background: #f8faf9;
  overflow: hidden;
}
#settingsForm .settings-section,
#settingsForm .settings-bubble {
  margin-top: 10px;
}
#settingsForm.panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}
#settingsForm > .panel-head {
  margin-bottom: 14px;
}
.settings-outer-section {
  padding: 0;
}
.settings-outer-section > :not(summary),
.settings-footer-section > .footer-settings {
  margin: 0;
  padding: 12px;
  background: #fff;
}
.settings-outer-section > .panel-head {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f5f7f6;
}
.settings-footer-section > .footer-settings {
  border-top: 1px solid var(--line);
}
.settings-section + .settings-section,
.settings-outer-section + .settings-outer-section {
  margin-top: 10px;
}
.settings-section-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  cursor: pointer;
  background: #eef3f1;
  color: #17202a;
  font-size: 15px;
  font-weight: 800;
}
.settings-section-summary span {
  grid-column: 1;
  text-align: left;
}
.settings-section-summary::-webkit-details-marker {
  display: none;
}
.settings-section-summary::after {
  content: "v";
  grid-column: 3;
  justify-self: end;
  color: var(--muted);
  font-weight: 900;
}
.settings-summary-actions {
  grid-column: 2;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.settings-summary-actions .pill {
  align-self: center;
}
.settings-collapsible[open] > .settings-section-summary::after {
  content: "^";
}
.settings-section-summary small {
  grid-column: 1 / -1;
  justify-self: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.settings-major-title,
.settings-group-title {
  margin: 18px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e4e7e5;
  color: #17202a;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}
.settings-group-title {
  border-left: 0;
}
.settings-major-title {
  border-left: 0;
}
.settings-primary-section {
  border-left-color: #59636b;
}
.settings-primary-section > .settings-section-summary {
  background: #eef3f1;
  font-size: 15px;
}
.settings-group-title-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 8px;
  background: #e4e7e5;
}
.settings-group-title-row h3 {
  grid-column: 2;
  justify-self: center;
  font-size: 16px;
  font-weight: 900;
}
.settings-group-title-row button {
  grid-column: 3;
  justify-self: end;
}
#settingsForm > h3 {
  margin: 18px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 5px solid #59636b;
  border-radius: 8px 8px 0 0;
  background: #eef0ee;
  font-size: 15px;
}
#settingsForm > h3 + .form-grid,
.settings-section > .form-grid,
.settings-bubble .form-grid {
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #fff;
  overflow: hidden;
}
.settings-bubble .form-grid {
  border: 0;
  border-radius: 0;
}
#settingsForm > h3 + .form-grid label,
.settings-section > .form-grid label,
.settings-bubble .form-grid label {
  gap: 7px;
  min-height: 58px;
  padding: 10px 12px;
  border-right: 1px solid #e1e6e3;
  border-bottom: 1px solid #e1e6e3;
  background: #fff;
}
#settingsForm > h3 + .form-grid label:nth-child(4n),
.settings-section > .form-grid label:nth-child(4n),
.settings-bubble .form-grid label:nth-child(4n) {
  border-right: 0;
}
#settingsForm > h3 + .form-grid.compact label:nth-child(4n),
.settings-section > .form-grid.compact label:nth-child(4n),
.settings-bubble .form-grid.compact label:nth-child(4n) {
  border-right: 1px solid #e1e6e3;
}
#settingsForm > h3 + .form-grid.compact label:nth-child(6n),
.settings-section > .form-grid.compact label:nth-child(6n),
.settings-bubble .form-grid.compact label:nth-child(6n) {
  border-right: 0;
}
#settingsForm > h3 + .form-grid label.wide,
.settings-section > .form-grid label.wide,
.settings-bubble .form-grid label.wide {
  border-right: 0;
}
#settingsForm > h3 + .form-grid input,
#settingsForm > h3 + .form-grid select,
#settingsForm > h3 + .form-grid textarea,
.settings-section > .form-grid input,
.settings-section > .form-grid select,
.settings-section > .form-grid textarea,
.settings-bubble .form-grid input,
.settings-bubble .form-grid select,
.settings-bubble .form-grid textarea {
  background: #fbfcfc;
}
.inline-copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.inline-copy-field input {
  min-width: 0;
}
#networkShareHint {
  padding: 0 12px 12px;
  border-bottom: 1px solid #e1e6e3;
}
#settingsForm > .footer-settings + .form-grid {
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
#settingsForm > .footer-settings + .form-grid label {
  min-height: 58px;
  padding: 10px 12px;
  border-right: 1px solid #e1e6e3;
  border-bottom: 1px solid #e1e6e3;
  background: #fff;
}
#settingsForm > .footer-settings + .form-grid label:nth-child(4n) {
  border-right: 0;
}
#settingsForm > .footer-settings + .form-grid input {
  background: #fbfcfc;
}
.settings-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}
.settings-title-row h3 { margin: 0; }
.settings-group-bubble {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #eef3f1;
}
.settings-group-bubble-title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #e4e7e5;
}
.settings-group-bubble-title strong {
  grid-column: 2;
  justify-self: center;
  font-size: 16px;
  font-weight: 900;
  color: #17202a;
}
.settings-group-action {
  grid-column: 3;
  justify-self: end;
}
.settings-group-bubble-body {
  display: grid;
  gap: 0;
  background: #eef3f1;
}
.settings-group-bubble-body > .settings-collapsible {
  margin: 0 !important;
  border: 0;
  border-left: 5px solid #176b87;
  border-radius: 0;
  box-shadow: none;
}
.settings-group-bubble-body > .settings-collapsible + .settings-collapsible {
  border-top: 1px solid var(--line);
}
.settings-group-bubble-body > .settings-collapsible > .settings-section-summary {
  border-radius: 0;
}
.settings-group-bubble-body > .settings-outer-section > :not(summary) {
  padding: 12px;
}
.settings-activity-panel {
  padding: 0;
  overflow: hidden;
}
.settings-activity-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  background: #eef3f1;
  border-left: 5px solid #59636b;
}
.settings-activity-summary h2 {
  margin: 0;
  font-size: 16px;
}
.settings-activity-summary small {
  color: var(--muted);
  font-weight: 700;
}
.settings-activity-summary::-webkit-details-marker {
  display: none;
}
.settings-activity-summary::after {
  content: "⌄";
  color: var(--muted);
  font-weight: 800;
}
.settings-activity-panel[open] .settings-activity-summary::after {
  content: "⌃";
}
.settings-group-bubble-body > .settings-activity-panel {
  border-left: 5px solid #176b87;
}
.settings-activity-panel > .settings-activity-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
  border-left: 0;
  background: #eef3f1;
}
.settings-activity-panel > .settings-activity-summary::after {
  content: "v";
  grid-column: 2;
  justify-self: end;
}
.settings-activity-panel[open] > .settings-activity-summary::after {
  content: "^";
}
.settings-activity-summary small {
  display: inline;
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.settings-activity-table-wrap {
  overflow-x: auto;
  background: #fff;
}
.settings-activity-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) minmax(180px, 240px);
  gap: 8px;
  padding: 12px;
  background: #f5f7f6;
  border-top: 1px solid var(--line);
}
.settings-activity-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}
.settings-activity-table th,
.settings-activity-table td {
  padding: 10px 12px;
  border-top: 1px solid #e1e6e3;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.settings-activity-table th {
  background: #f5f7f6;
  color: #39433f;
  font-size: 12px;
}
.settings-activity-table td:first-child {
  width: 160px;
  color: var(--muted);
  white-space: nowrap;
}
.settings-activity-table td:nth-child(2) {
  width: 260px;
}
.settings-activity-table small {
  margin-left: 8px;
  color: var(--muted);
}
.settings-activity-table tr.is-muted {
  opacity: 0.6;
}
.settings-activity-table button:disabled {
  cursor: default;
  opacity: 0.65;
}
.item-locks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 9px 10px;
  margin: 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
  color: var(--muted);
}
.item-locks span {
  font-weight: 700;
  color: var(--ink);
}
.item-locks label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.item-locks input {
  width: auto;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.panel-head h2, .subhead h3 {
  margin: 0;
  font-size: 16px;
}
.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.kpis div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.kpis span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.kpis strong { font-size: 23px; }
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(340px, .95fr);
  gap: 16px;
  align-items: start;
}
.dashboard-side {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.dashboard-actions button {
  width: 100%;
}
.dashboard-actions button:first-child {
  background: #176b87;
}
.dashboard-case-row {
  width: 100%;
  color: var(--ink);
  text-align: left;
  align-items: center;
}
.dashboard-case-row:hover {
  background: #f8fbfc;
}
.dashboard-calendar-stack {
  display: grid;
  gap: 14px;
}
.dashboard-month {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dashboard-month-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: #176b87;
}
.dashboard-month-head span {
  color: var(--muted);
  font-weight: 400;
}
.dashboard-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.dashboard-weekday {
  padding: 6px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.dashboard-day {
  min-height: 58px;
  padding: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.dashboard-day.outside {
  background: #fafafa;
  color: #9aa5ad;
}
.dashboard-day-number {
  font-weight: 700;
  line-height: 1;
}
.dashboard-calendar-event {
  display: block;
  margin-top: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  background: #d9eef8;
  color: #17202a;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.stat-kpi {
  background: #f7fbfa;
  border: 1px solid var(--line);
  border-left: 4px solid #176b87;
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 58px;
  box-shadow: none;
}
.stat-kpi span,
.stat-kpi small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}
.stat-kpi strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 18px;
  line-height: 1.12;
  color: #17202a;
}
@media (max-width: 1500px) {
  .stat-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 9px;
  }
  .stat-kpi {
    padding: 7px 9px;
    min-height: 54px;
  }
  .stat-kpi span,
  .stat-kpi small {
    font-size: 11px;
  }
  .stat-kpi strong {
    margin: 3px 0 1px;
    font-size: 17px;
    line-height: 1.15;
  }
}
.stats-filter {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 10px;
}
.stats-filter label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: var(--muted);
}
.stats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  align-items: center;
}
.stats-tab {
  background: #eef3f1;
  color: var(--ink);
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid #d8e1dd;
  font-size: 13px;
  font-weight: 700;
}
.stats-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.stats-pane {
  display: none;
}
.stats-pane.active {
  display: block;
}
.stat-bars {
  display: grid;
  gap: 8px;
}
.stat-bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(120px, 2fr) minmax(72px, auto);
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.stat-bar-track {
  height: 12px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}
.stat-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.stat-pie-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.stat-pie {
  width: 140px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.combo-bars {
  display: grid;
  gap: 9px;
}
.combo-row {
  display: grid;
  grid-template-columns: 72px minmax(90px, 1fr) 58px minmax(90px, 1fr) 92px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.combo-track {
  height: 11px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}
.combo-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.money-combo-bars {
  display: grid;
  gap: 8px;
}
.money-combo-row {
  display: grid;
  grid-template-columns: 72px 18px minmax(90px, 1fr) 86px 18px minmax(90px, 1fr) 86px 18px minmax(90px, 1fr) 86px;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}
.money-combo-row small {
  color: var(--muted);
  text-align: right;
}
.stat-kpi.inline {
  margin-bottom: 10px;
}
.stat-note {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
}
#appointmentStats h4 {
  margin: 8px 0 6px;
  color: #13677b;
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}
.danger-zone {
  margin: 18px 16px 20px;
  padding: 20px 22px;
  border: 1px solid #f0c8c3;
  border-left: 6px solid #b42318;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffafa, #fff6f4);
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.03);
}
.danger-zone h3 {
  margin: 0 0 8px;
  color: #8f1d14;
}
.danger-zone p {
  max-width: 1320px;
  margin: 0 0 14px;
  line-height: 1.45;
}
.danger-zone .danger {
  margin-top: 2px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.form-grid.compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
.field-label-line {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 14px;
  line-height: 14px;
  width: 100%;
  max-width: 100%;
}
.settings-info-button {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  min-height: 13px;
  min-width: 13px;
  max-width: 13px;
  max-height: 13px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #9fb2b8;
  background: transparent;
  color: #176b87;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  appearance: none;
  cursor: help;
  flex: 0 0 13px;
}
.settings-info-button:hover,
.settings-info-button:focus-visible {
  background: #e9f5f7;
  border-color: #176b87;
}
.subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 8px;
}
.items { display: grid; gap: 8px; }
.estimate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.estimate-actions button:last-child {
  background: var(--accent);
}
.quick-box {
  margin-top: 14px;
}
.quick-box h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.section-title-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.section-title-actions h3 {
  margin: 0;
}
.estimate-note-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfc;
}
.estimate-note-box.estimate-section {
  padding: 0;
  background: #f4f6f5;
}
.estimate-note-box h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.estimate-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
}
.estimate-note-grid section {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid #d8dfdc;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.estimate-note-grid h4 {
  margin: 0 0 8px;
  color: var(--accent);
}
.estimate-note-options {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}
.estimate-note-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f8f7;
  color: var(--ink);
  font-weight: 500;
  font-size: 13px;
}
.estimate-note-options label:hover {
  border-color: var(--accent);
  background: #eef8fb;
}
.estimate-note-options input {
  width: auto;
  margin-top: 2px;
  flex: 0 0 auto;
}
.estimate-note-grid textarea {
  width: 100%;
  min-height: 58px;
}

.labor-quick {
  display: grid;
  gap: 10px;
}

.labor-quick h4 {
  margin: 0 0 10px;
}

.labor-summary {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-left: 6px solid var(--accent);
  background: #eaf6f8;
  border-radius: 8px;
}

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

.labor-group {
  display: grid;
  gap: 8px;
  align-content: start;
}

.labor-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 90px 74px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: white;
}

.labor-row input[type="number"] {
  min-width: 0;
}
.quick-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 700;
}
.quick-option input {
  width: auto;
}
.quick-price-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid #176b87;
  border-radius: 8px;
  background: #eef8fb;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 13px;
}
.quick-price-preview strong {
  color: #13677b;
}
.quick-price-main,
.quick-rule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.quick-rule {
  border: 1px solid #cfe0e4;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 3px 8px;
}
.quick-rule.fixed {
  border-color: #176b87;
  color: #13677b;
  font-weight: 700;
}
.quick-rule.surcharge {
  border-color: #d8b05d;
  color: #7a5710;
  font-weight: 700;
}
.quick-price-preview em {
  color: #a35b00;
  font-style: normal;
  font-weight: 700;
}
.quick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}
.quick-main-fields {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.quick-col {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px;
  background: #fff;
  display: grid;
  align-content: start;
  gap: 6px;
}
.quick-col h4 {
  margin: 0;
  font-size: 13px;
}
.quick-col h4 small {
  color: var(--muted);
  font-weight: 600;
}
.quick-col-wide {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.quick-col-wide h4 {
  grid-column: 1 / -1;
}
.quick-col-wide > small {
  grid-column: 1 / -1;
}
.quick-item {
  display: grid;
  gap: 2px;
  text-align: left;
  background: #fbfcfc;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 42px;
  padding: 6px 8px;
}
.quick-item.selected {
  border-color: #16855d;
  background: #e4f6ed;
  box-shadow: inset 4px 0 0 #16855d;
}
.quick-item strong {
  font-size: 12px;
  font-weight: 600;
}
.quick-item span {
  color: #53625d;
  font-size: 11px;
}
.quick-create {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
  padding-top: 0;
  border-top: 1px solid #d7dfdd;
  padding-top: 12px;
}
.estimate-accessory-section {
  margin: 0;
  background: #f7f8f8;
}
.estimate-accessory-section .quick-option {
  margin: 12px 12px 0;
}
.quick-accessory-grid {
  display: grid;
  gap: 10px;
  margin: 12px;
}
.quick-accessory-grid .quick-col {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.quick-accessory-grid .quick-col h4 {
  display: none;
}
.quick-accessory-grid .quick-col > small {
  grid-column: 1 / -1;
}
.item-row {
  display: grid;
  gap: 9px;
  padding: 12px;
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-left: 4px solid #176b87;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}
.item-main,
.item-detail {
  display: grid;
  gap: 8px;
}
.item-main {
  grid-template-columns: minmax(118px, 1fr) minmax(92px, .75fr) minmax(170px, 1.35fr) minmax(58px, .45fr) minmax(70px, .55fr) minmax(84px, .65fr) 42px;
}
.item-detail {
  grid-template-columns: minmax(120px, 1fr) minmax(76px, .45fr) minmax(76px, .45fr) minmax(112px, .75fr) minmax(132px, .95fr) minmax(150px, 1.05fr) minmax(150px, max-content);
}
.item-main input,
.item-main select,
.item-detail input,
.item-detail textarea {
  min-height: 38px;
  font-size: clamp(12px, .9vw, 14px);
  min-width: 0;
}
.item-detail textarea {
  resize: vertical;
}
.item-row.service-item .item-main {
  grid-template-columns: minmax(170px, 1.7fr) minmax(72px, .35fr) minmax(82px, .45fr) minmax(92px, .5fr) 42px;
}
.item-row.service-item .item-main [name="element_type"],
.item-row.service-item .item-main [name="wing_type"] {
  display: none;
}
.item-row.service-item .item-detail {
  grid-template-columns: minmax(220px, 1fr) minmax(150px, max-content);
}
.item-row.service-item .item-detail [name="room"],
.item-row.service-item .item-detail [name="width"],
.item-row.service-item .item-detail [name="height"],
.item-row.service-item .item-detail [name="color"],
.item-row.service-item .item-detail [name="mounting_note"] {
  display: none;
}
.item-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  align-items: stretch;
  min-width: 0;
}
.item-tools button {
  min-width: 0;
  min-height: 34px;
  padding: 5px 7px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-row .remove-item {
  background: #bf2118;
  border: 1px solid #bf2118;
  color: #fff;
  padding: 0;
  font-weight: 800;
  font-size: 16px;
}
.credit-item {
  border-left-color: #0f766e;
  background: #f6fbfa;
}
.credit-line {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(90px, 120px) minmax(130px, 160px) minmax(130px, 160px) 42px;
  gap: 8px;
  align-items: end;
}
.credit-line strong {
  align-self: center;
  font-size: 16px;
}
.credit-line label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.credit-line input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
}
.credit-line input[readonly] {
  background: #eef5f1;
  color: #8f1d14;
  font-weight: 800;
}
.estimate-live-total {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.estimate-live-total strong {
  color: #13677b;
  font-size: 16px;
}
.list, .case-list {
  display: grid;
  gap: 8px;
}
.case-filters {
  display: grid;
  gap: 8px;
  margin: 4px 0 14px;
  position: relative;
  z-index: 30;
}
.case-filter-row {
  display: grid;
  gap: 7px;
  align-items: center;
}
.case-filter-row.fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.case-filter-row.search-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.case-filter-row.date-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: start;
}
.case-filter-row.status-row {
  grid-template-columns: minmax(230px, auto) minmax(0, 1fr);
  justify-content: start;
}
.case-filters input,
.case-filters select,
.case-filters button,
.filter-menu summary {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
  color: var(--ink);
  font: inherit;
}
.case-filters input::placeholder {
  color: #8a97a4;
}
.case-filter-row.date-row label:not(.check-label) {
  display: grid;
  grid-template-columns: 32px 145px;
  gap: 6px;
  align-items: center;
  color: var(--muted);
}
#caseFilters,
#caseFilters .case-filter-row,
#caseFilters input,
#caseFilters select,
#caseFilters button,
#caseFilters label,
#caseFilters .date-picker-line {
  max-width: 100%;
  min-width: 0;
}
#caseFilters .check-label {
  white-space: nowrap;
}
#clearCaseFilters {
  background: #d21f17;
  border-color: #d21f17;
  color: #fff;
  font-weight: 800;
  width: 100%;
}
#clearCaseFilters:hover,
#clearCaseFilters:focus-visible {
  background: #b91c15;
  border-color: #b91c15;
}
.case-status-checks {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.case-status-checks .check-label {
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
}
.case-status-checks input {
  width: auto;
  min-height: 0;
  margin-right: 4px;
}
@media (max-width: 1700px) {
  #caseFilters .case-filter-row.fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #caseFilters .case-filter-row.search-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #caseFilters .case-filter-row.date-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #caseFilters .case-filter-row.date-row label:not(.check-label) {
    grid-template-columns: 32px minmax(0, 1fr);
  }
}
.finance-top {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(290px, .7fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}
.finance-controls,
.finance-overview {
  min-width: 0;
}
.finance-controls {
  display: grid;
  align-content: start;
}
.finance-head {
  gap: 12px;
  margin-bottom: 8px;
}
.finance-head h2 {
  white-space: nowrap;
}
.finance-head small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finance-import {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 8px;
  position: relative;
  z-index: 31;
}
.finance-import input {
  flex: 1 1 260px;
  min-width: 180px;
}
.finance-import-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 800;
}
.finance-import-status.running {
  color: #6d4b00;
  background: #fff7df;
  border-color: #e8cf89;
}
.finance-import-status.ok {
  color: #146c43;
  background: #e8f6ee;
  border-color: #bfe4cf;
}
.finance-import-status.warn {
  color: #7a5200;
  background: #fff4d8;
  border-color: #e7cb7f;
}
.finance-import-status.bad {
  color: #9f1f17;
  background: #fff0ee;
  border-color: #e9bbb6;
}
.finance-import-log {
  margin: 0 0 8px;
}
.finance-import-log details {
  border: 1px solid #d8e1dc;
  border-radius: 8px;
  background: #fbfdfc;
}
.finance-import-log summary {
  cursor: pointer;
  padding: 8px 10px;
  font-weight: 800;
  color: var(--ink);
}
.finance-import-log-list {
  display: grid;
  gap: 1px;
  border-top: 1px solid #e1e7e4;
}
.finance-import-log-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, auto);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
}
.finance-import-log-row small {
  display: block;
  color: var(--muted);
}
.finance-import-log-row > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.finance-import-log-row span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--soft);
  color: #39413e;
}
.finance-overview {
  padding: 8px 12px 10px;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf9 100%);
}
.finance-overview h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.finance-overview-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 4px;
  text-align: center;
}
.finance-overview-kpis div {
  min-width: 0;
}
.finance-overview-kpis span {
  display: block;
  color: #8a928e;
  font-size: 11px;
  font-weight: 700;
}
.finance-overview-kpis strong {
  display: block;
  overflow: hidden;
  color: #49524e;
  font-size: clamp(13px, 1.35vw, 22px);
  line-height: 1.12;
  letter-spacing: 0;
  text-overflow: clip;
  white-space: nowrap;
}
.finance-overview-chart {
  min-height: 205px;
}
.finance-overview-chart svg {
  display: block;
  width: 100%;
  height: 205px;
}
.finance-chart-grid {
  stroke: #e9eeeb;
  stroke-width: 1;
}
.finance-chart-axis,
.finance-chart-axis-tick {
  stroke: #cfd8d4;
  stroke-width: 1;
}
.finance-chart-y-label,
.finance-chart-x-label {
  fill: #73807a;
  font-size: 11px;
}
.finance-chart-y-label {
  font-weight: 700;
}
.finance-chart-income-area {
  fill: rgba(47, 157, 101, .16);
}
.finance-chart-expense-area {
  fill: rgba(191, 67, 67, .14);
}
.finance-chart-income-line {
  fill: none;
  stroke: #2f9d65;
  stroke-width: 2.8;
}
.finance-chart-expense-line {
  fill: none;
  stroke: #d74f4f;
  stroke-width: 2.4;
}
.finance-chart-dot-income {
  fill: #2f9d65;
}
.finance-chart-dot-expense {
  fill: #d74f4f;
}
.finance-chart-legend {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.finance-chart-legend span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.finance-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.finance-chart-legend .income i {
  border: 1px solid #65b98d;
  background: rgba(47, 157, 101, .2);
}
.finance-chart-legend .expense i {
  border: 1px solid #e28a8a;
  background: rgba(215, 79, 79, .18);
}
.finance-chart-empty {
  display: grid;
  min-height: 210px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}
.finance-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.finance-bookings-wrap {
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-width: 100%;
}
.finance-table,
.finance-category-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}
.finance-bookings-wrap .finance-table {
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  min-width: 0;
  max-width: 100%;
}
.finance-table th,
.finance-category-table th {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  background: #f5f7f6;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}
.finance-bookings-wrap .finance-table th {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  background: #f5f7f6;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.finance-table td,
.finance-category-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #e1e7e4;
  background: #fff;
  vertical-align: middle;
}
.finance-bookings-wrap .finance-table td {
  padding: 3px 4px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  min-width: 0;
  overflow: hidden;
}
.finance-bookings-wrap .finance-table td:first-child {
  border-left: 0;
  border-radius: 0;
}
.finance-bookings-wrap .finance-table td:last-child {
  border-right: 0;
  border-radius: 0;
  overflow: hidden;
}
.finance-table tbody tr:nth-child(even) td,
.finance-category-table tbody tr:nth-child(even) td {
  background: #fbfcfc;
}
.finance-table tbody tr.finance-row-imported td {
  background: #f1f4f3;
}
.finance-bookings-wrap .finance-table tbody tr.finance-row-imported td,
.finance-bookings-wrap .finance-table tbody tr.finance-row-locked td {
  background: #f1f5f4;
  color: var(--ink);
}
.finance-table tbody tr.finance-row-locked input,
.finance-table tbody tr.finance-row-locked select {
  color: var(--ink);
  cursor: default;
  opacity: 1;
}
.finance-bookings-wrap .finance-table tbody tr.finance-row-locked input,
.finance-bookings-wrap .finance-table tbody tr.finance-row-locked select {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  cursor: default;
}
.finance-bookings-wrap .finance-table tbody tr.finance-row-locked input {
  cursor: text;
}
.finance-table tbody tr.finance-row-locked input:disabled,
.finance-table tbody tr.finance-row-locked select:disabled {
  -webkit-text-fill-color: var(--ink);
}
.finance-table tbody tr.finance-row-locked input:read-only {
  -webkit-text-fill-color: var(--ink);
}
.finance-bookings-wrap .finance-table tbody tr.finance-row-locked input:disabled,
.finance-bookings-wrap .finance-table tbody tr.finance-row-locked select:disabled {
  -webkit-text-fill-color: var(--ink);
}
.finance-bookings-wrap .finance-table tbody tr.finance-row-locked input:read-only {
  -webkit-text-fill-color: var(--ink);
}
.finance-table tbody tr td:first-child {
  box-shadow: inset 4px 0 0 var(--finance-category-color, transparent);
}
.finance-table tbody tr:hover td,
.finance-category-table tbody tr:hover td {
  background: #eef7f5;
}
.finance-bookings-wrap .finance-table tbody tr.finance-row-locked:hover td,
.finance-bookings-wrap .finance-table tbody tr.finance-row-imported:hover td {
  background: #eef7f5;
}
.finance-table input,
.finance-table select,
.finance-category-table input,
.finance-category-table select {
  min-height: 30px;
  border-color: transparent;
  border-radius: 4px;
  background: transparent;
  padding: 5px 6px;
}
.finance-bookings-wrap .finance-table input,
.finance-bookings-wrap .finance-table select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  padding: 4px 5px;
  font: inherit;
  font-size: 12px;
  text-overflow: ellipsis;
}
.finance-bookings-wrap .finance-table th:nth-child(1),
.finance-bookings-wrap .finance-table td:nth-child(1) { width: 7.5%; }
.finance-bookings-wrap .finance-table th:nth-child(2),
.finance-bookings-wrap .finance-table td:nth-child(2) { width: 19%; }
.finance-bookings-wrap .finance-table th:nth-child(3),
.finance-bookings-wrap .finance-table td:nth-child(3) { width: 28%; }
.finance-bookings-wrap .finance-table th:nth-child(4),
.finance-bookings-wrap .finance-table td:nth-child(4) { width: 7.5%; }
.finance-bookings-wrap .finance-table th:nth-child(5),
.finance-bookings-wrap .finance-table td:nth-child(5) { width: 8%; }
.finance-bookings-wrap .finance-table th:nth-child(6),
.finance-bookings-wrap .finance-table td:nth-child(6) { width: 8%; }
.finance-bookings-wrap .finance-table th:nth-child(7),
.finance-bookings-wrap .finance-table td:nth-child(7) { width: 15%; }
.finance-bookings-wrap .finance-table th:nth-child(8),
.finance-bookings-wrap .finance-table td:nth-child(8) {
  width: 74px;
  min-width: 74px;
}
.finance-bookings-wrap .finance-table td.trip-actions {
  display: table-cell;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
}
.icon-action-btn,
.finance-bookings-wrap .finance-table td.trip-actions button,
.trip-table td.trip-actions button {
  display: inline-block;
  width: 32px;
  height: 32px;
  min-width: 0;
  min-height: 32px;
  margin: 0 1px;
  padding: 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
}
.finance-bookings-wrap .finance-table td.trip-actions button:first-child:last-child {
  width: 32px;
}
.finance-bookings-wrap .finance-table td.finance-category-cell {
  display: table-cell;
  white-space: nowrap;
}
.finance-bookings-wrap .finance-table .finance-category-swatch {
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
.finance-bookings-wrap .finance-table .finance-category-cell select {
  display: inline-block;
  width: calc(100% - 24px);
  vertical-align: middle;
}
.finance-table input:focus,
.finance-table select:focus,
.finance-category-table input:focus,
.finance-category-table select:focus {
  border-color: var(--accent);
  background: #fff;
}
.finance-category-cell {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}
.finance-category-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  background: var(--finance-category-color, #e5e7eb);
}
.finance-category-table input[type="color"] {
  width: 38px;
  min-width: 38px;
  height: 30px;
  padding: 2px;
  border-color: var(--line);
  background: #fff;
}
.finance-filters input,
.finance-filters select,
.finance-filters button {
  width: 100%;
  min-width: 0;
}
.finance-controls .finance-filters {
  margin-bottom: 0;
}
.finance-filters label:not(.check-label) {
  display: grid;
  grid-template-columns: auto minmax(105px, 1fr);
  gap: 6px;
  align-items: center;
  color: var(--muted);
}
.finance-filters .check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  white-space: nowrap;
}
.finance-filters .check-label input {
  width: auto;
  min-height: auto;
}
#financeFilters .case-filter-row {
  display: grid;
  gap: 8px;
  align-items: center;
}
#financeFilters .finance-filter-search-row {
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 1fr);
}
#financeFilters .finance-filter-basic-row {
  grid-template-columns: minmax(180px, 1fr) minmax(110px, .7fr) minmax(140px, .8fr) minmax(150px, .9fr);
}
#financeFilters .finance-filter-source-row {
  grid-template-columns: minmax(220px, 1fr);
}
#financeFilters .finance-filter-date-row {
  grid-template-columns: minmax(84px, .65fr) minmax(84px, .65fr) minmax(132px, 1fr) minmax(132px, 1fr) minmax(92px, .7fr) minmax(158px, max-content);
}
#financeFilters .finance-filter-action-row {
  grid-template-columns: minmax(128px, .8fr) minmax(120px, .75fr) minmax(150px, 1fr) minmax(140px, .95fr) minmax(92px, .55fr);
}
#financeFilters input,
#financeFilters select,
#financeFilters button {
  width: 100%;
  min-width: 0;
}
#financeFilters label:not(.check-label) {
  display: grid;
  grid-template-columns: auto minmax(96px, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
}
#financeFilters .date-picker-line {
  min-width: 0;
}
#financeFilters .check-label {
  display: inline-flex;
  width: auto;
  min-width: 0;
  white-space: nowrap;
}
@media (max-width: 1700px) {
  .finance-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .finance-overview-chart,
  .finance-overview-chart svg,
  .finance-chart-empty {
    min-height: 220px;
    height: 220px;
  }
}
@media (min-width: 981px) and (max-width: 1450px) {
  .finance-overview {
    padding-left: 8px;
    padding-right: 8px;
  }
  .finance-overview-kpis {
    gap: 4px;
  }
  .finance-overview-kpis span {
    font-size: 10px;
  }
  .finance-overview-kpis strong {
    font-size: clamp(12px, 1.25vw, 18px);
  }
}
@media (max-width: 980px) {
  #financeFilters .finance-filter-search-row,
  #financeFilters .finance-filter-basic-row,
  #financeFilters .finance-filter-source-row,
  #financeFilters .finance-filter-date-row,
  #financeFilters .finance-filter-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #financeFilters .check-label {
    min-width: 0;
  }
}
.finance-categories-modal {
  width: min(1180px, calc(100vw - 40px));
}
.finance-categories-modal .finance-table-wrap {
  max-height: min(620px, calc(100vh - 170px));
  overflow: auto;
}
.finance-categories-modal .finance-category-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.payment-reconcile-panel {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #cfe2d5;
  border-left: 5px solid #2f8f5b;
  border-radius: 8px;
  background: #f7fbf8;
}
.finance-trash-panel {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #d7dde0;
  border-left: 5px solid #59636b;
  border-radius: 8px;
  background: #f6f7f7;
}
.export-trash-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #d7dde0;
  border-left: 5px solid #59636b;
  border-radius: 8px;
  background: #f8faf9;
}
.export-trash-panel .panel-head {
  margin-bottom: 10px;
}
.export-trash-panel .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: auto;
}
.export-trash-panel table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.export-trash-panel th,
.export-trash-panel td {
  padding: 6px 8px;
  border-bottom: 1px solid #dfe5e2;
  vertical-align: middle;
  white-space: nowrap;
}
.export-trash-panel th {
  background: #eef3f1;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}
.export-trash-panel tbody tr:last-child td {
  border-bottom: 0;
}
.export-trash-panel tbody tr:hover {
  background: #f7faf8;
}
.export-trash-panel th:last-child,
.export-trash-panel td:last-child {
  text-align: right;
  overflow: visible;
  text-overflow: clip;
}
.export-trash-panel td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.export-trash-panel th:nth-child(1),
.export-trash-panel td:nth-child(1) { width: 14%; }
.export-trash-panel th:nth-child(2),
.export-trash-panel td:nth-child(2) { width: 8%; }
.export-trash-panel th:nth-child(3),
.export-trash-panel td:nth-child(3) {
  width: 18%;
  max-width: none;
}
.export-trash-panel th:nth-child(4),
.export-trash-panel td:nth-child(4) {
  width: 36%;
  max-width: none;
}
.export-trash-panel th:nth-child(5),
.export-trash-panel td:nth-child(5) { width: 13%; }
.export-trash-panel th:nth-child(6),
.export-trash-panel td:nth-child(6) {
  width: 96px;
  min-width: 96px;
}
.trash-date,
.trash-title,
.trash-deleted,
.trash-details {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trash-details {
  color: #27312d;
}
.trash-actions {
  display: table-cell;
  text-align: right;
  white-space: nowrap;
  overflow: visible;
}
.trash-action-buttons {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 76px;
}
.trash-actions .icon-action-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
}
.trash-area-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
  white-space: nowrap;
}
.trash-area-finance { color: #1b6f5b; background: #eef8f2; border-color: #cbe8d8; }
.trash-area-trip { color: #6d4b00; background: #fff8df; border-color: #eadca8; }
.trash-area-appointment { color: #19598a; background: #edf6ff; border-color: #c9def2; }
.trash-area-file { color: #5a426d; background: #f5effa; border-color: #ded0e8; }
.trash-area-case { color: #8f1d14; background: #fff0ee; border-color: #f0c8c3; }
.trash-area-default { color: var(--ink); background: var(--soft); }
.payment-reconcile-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--muted);
}
.payment-reconcile-summary span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.payment-reconcile-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.payment-reconcile-controls .check-label {
  margin: 0;
}
.payment-reconcile-table {
  width: 100%;
  border-collapse: collapse;
}
.payment-reconcile-table th,
.payment-reconcile-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.payment-reconcile-table th {
  background: #eef5f1;
  font-size: 12px;
  font-weight: 800;
}
.payment-reconcile-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reconcile-status {
  display: inline-block;
  padding: 5px 7px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 12px;
}
.reconcile-status.ok {
  color: #146c43;
  background: #e8f6ee;
}
.reconcile-status.warn {
  color: #8a5a00;
  background: #fff6db;
}
.reconcile-status.missing {
  color: #9f1f17;
  background: #fff0ee;
}
.reconcile-status.done {
  color: #31584a;
  background: #e9f3ee;
}
.trip-filter-row {
  grid-template-columns: 130px 130px 150px 150px auto;
  justify-content: start;
}
.trip-filter-row-wide {
  grid-template-columns: 170px repeat(3, minmax(140px, 1fr)) repeat(3, auto);
}
.trip-filter-row label:not(.check-label) {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 6px;
  align-items: center;
  color: var(--muted);
}
.trip-summary,
.finance-summary {
  margin: 8px 0 12px;
  padding: 10px 14px;
  border: 1px solid #cfe3dc;
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: #f2faf7;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  user-select: none;
}
.trip-table-wrap {
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.trip-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  min-width: 0;
}
.trip-table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 7px;
  border-bottom: 1px solid var(--line);
  background: #f5f7f6;
  white-space: nowrap;
}
.trip-table td {
  background: #fff;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  padding: 3px 4px;
}
.trip-table td:first-child {
  border-left: 0;
  border-radius: 0;
}
.trip-table td:last-child {
  border-right: 0;
  border-radius: 0;
  overflow: visible;
}
.trip-table input,
.trip-table select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 5px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-overflow: ellipsis;
}
.trip-table th:nth-child(1),
.trip-table td:nth-child(1) { width: 8%; }
.trip-table th:nth-child(2),
.trip-table td:nth-child(2) { width: 14%; }
.trip-table th:nth-child(3),
.trip-table td:nth-child(3) { width: 11%; }
.trip-table th:nth-child(4),
.trip-table td:nth-child(4) { width: 14%; }
.trip-table th:nth-child(5),
.trip-table td:nth-child(5) { width: 10%; }
.trip-table th:nth-child(6),
.trip-table td:nth-child(6) { width: 7%; }
.trip-table th:nth-child(7),
.trip-table td:nth-child(7) { width: 7%; }
.trip-table th:nth-child(8),
.trip-table td:nth-child(8) { width: 8%; }
.trip-table th:nth-child(9),
.trip-table td:nth-child(9) { width: 13%; }
.trip-table th:nth-child(10),
.trip-table td:nth-child(10) {
  width: 74px;
  min-width: 74px;
}
.trip-table td.trip-actions {
  display: table-cell;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
}
.trip-table tr.trip-row-locked td {
  background: #f1f5f4;
  color: var(--ink);
}
.trip-table tr.trip-row-locked input,
.trip-table tr.trip-row-locked select {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  opacity: 1;
  cursor: not-allowed;
}
.trip-table tr.trip-row-locked:hover td {
  background: #eef7f5;
}
.trip-actions button:not(.icon-action-btn) {
  display: inline-block;
  margin-left: 4px;
  width: auto;
  min-width: 0;
  min-height: 28px;
  padding: 5px 7px;
  font-size: clamp(10px, 0.68vw, 12px);
  white-space: nowrap;
}
.trip-modal-card {
  width: min(900px, 100%);
}
.trip-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.trip-form-grid input,
.trip-form-grid select {
  min-height: 42px;
}
@media (max-width: 1400px) {
  .trip-table-wrap {
    margin: 0 -6px;
  }
  .trip-table th,
  .trip-table td {
    padding-left: 3px;
    padding-right: 3px;
  }
  .trip-table input,
  .trip-table select {
    min-height: 31px;
    padding-left: 5px;
    padding-right: 5px;
  }
}
.trip-row-locked td {
  background: #f1f5f4;
}
.trip-row-locked input,
.trip-row-locked select {
  color: var(--ink);
  background: transparent;
  border-color: transparent;
  cursor: not-allowed;
}
.check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  color: var(--ink);
  white-space: nowrap;
}
.filter-menu {
  position: relative;
}
.filter-menu[open] {
  z-index: 80;
}
.filter-menu summary {
  list-style: none;
  cursor: pointer;
}
.filter-menu summary::-webkit-details-marker {
  display: none;
}
.filter-menu summary::after {
  content: "⌄";
  float: right;
  color: var(--muted);
}
.filter-menu[open] summary::after {
  content: "⌃";
}
.filter-options {
  position: absolute;
  z-index: 20;
  top: 42px;
  left: 0;
  min-width: 150px;
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.97);
  box-shadow: var(--shadow);
}
.filter-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #52606d;
}
.filter-options input,
.check-label input {
  width: 16px;
  height: 16px;
  min-height: auto;
}
.row, .case-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 10px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.row small, .case-card small { color: var(--muted); }
.case-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.case-card.case-complete {
  background: #eef9f2;
  border-color: #bfe5cb;
}
.case-card.case-partial {
  background: #f4f8ff;
  border-color: #b8cdea;
}
.case-card.case-overdue {
  background: #fff0f0;
  border-color: #efc2c2;
}
.case-card.case-active {
  background: #fff7e8;
  border-color: #efcf91;
}
.case-card.case-selected {
  background: #eef4ff;
  border-color: #8bb8ff;
  border-left: 6px solid #2f6fed;
  border-bottom-color: #d7e6ff;
  border-radius: 7px 7px 0 0;
  box-shadow: 0 -1px 0 2px rgba(47, 111, 237, 0.12), 2px 0 0 0 rgba(47, 111, 237, 0.12), -2px 0 0 0 rgba(47, 111, 237, 0.12);
}
.case-card.case-selected.case-complete,
.case-card.case-selected.case-partial,
.case-card.case-selected.case-overdue,
.case-card.case-selected.case-active {
  background: #eef4ff;
  border-color: #8bb8ff;
}
.case-compact-status {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin-bottom: 10px;
  border: 1px solid #d4dcda;
  border-radius: 8px;
  overflow: hidden;
  background: #d4dcda;
}
.case-compact-status > div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: #f4f8f6;
}
.detail-grid > div:last-child .case-compact-status {
  margin-bottom: 12px;
}
.detail-grid > div:last-child .case-compact-status > div {
  min-height: 58px;
}
.case-compact-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.case-compact-status strong {
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.case-compact-status .case-compact-warning {
  border-left: 5px solid #c9302c;
  background: #fff4f4;
}
.case-compact-status .case-compact-warning span,
.case-compact-status .case-compact-warning strong {
  color: #9b1c1c;
}
.case-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}
.case-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.case-trash-btn {
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
}
.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--soft);
  color: #39413e;
  font-size: 12px;
}
.pill.gold { background: #fbf1d7; color: #6f5211; }
.pill.orange { background: #fff0d6; color: #8a4a00; }
.pill.green { background: #e3f3ed; color: #155d4d; }
.pill.blue { background: #e8f0fb; color: #244b77; }
.pill.red { background: #fde6e2; color: #8f1d14; }
.detail { margin-top: 14px; }
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(340px, .8fr);
  gap: 14px;
  align-items: start;
}
.detail-grid > * {
  min-width: 0;
}
.case-inline-detail {
  margin: -1px 0 10px;
  border-color: #8bb8ff;
  border-top: 0;
  border-left: 6px solid #2f6fed;
  border-radius: 0 0 7px 7px;
  background: linear-gradient(90deg, rgba(47, 111, 237, 0.08), #fff 28px);
}
.customer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 7px 0 0;
}
.customer-info-sections {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 10px;
}
.customer-info-sections.customer-info-public-only {
  grid-template-columns: 1fr;
}
.customer-info-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #fff;
}
.customer-info-section h4 {
  margin: 0 0 4px;
  font-size: 13px;
}
.customer-section-hint {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
}
.customer-info-public {
  background: #f8fcfa;
  border-color: #d7eadf;
}
.customer-info-public .customer-grid {
  grid-template-columns: 1fr;
  column-gap: 0;
  row-gap: 0;
}
.customer-info-public .customer-grid > div {
  border: 0;
  border-bottom: 1px solid #dfece5;
  border-radius: 0;
  padding: 7px 0;
  background: transparent;
}
.customer-info-public h4 {
  color: #2f6942;
}
.customer-info-internal {
  background: #fbfbfb;
  border-color: #e3e8e6;
}
.customer-info-internal h4 {
  color: #59636a;
}
.customer-internal-alert {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #efcaca;
  border-left: 5px solid #b42318;
  border-radius: 8px;
  background: #fff7f7;
}
.customer-internal-alert span {
  color: #9b2f2f;
  font-size: 12px;
  font-weight: 800;
}
.customer-internal-alert em,
.customer-grid span em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.25;
}
.customer-internal-alert em {
  color: #b65454;
}
.customer-internal-alert strong {
  color: #9b2f2f;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.customer-bubble {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 12px;
}
.customer-bubble h3 {
  margin-top: 0;
}
.customer-grid div {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #e7ece9;
}
.customer-grid div:last-child { border-bottom: 0; }
.customer-grid .customer-internal-alert {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid #efcaca;
  border-left: 5px solid #b42318;
  border-radius: 8px;
  background: #fff7f7;
}
.customer-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.customer-grid strong {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.customer-grid .customer-public-note {
  background: transparent;
  border-radius: 0;
  padding: 7px 0;
}

.customer-grid .customer-public-note span {
  color: #2f6942;
}
.customer-grid .customer-public-note span em {
  color: #3d8053;
}

.customer-info-internal .customer-grid div:not(.customer-internal-alert),
.customer-grid .customer-private-warning {
  background: transparent;
  border-radius: 0;
  padding: 7px 0;
}
.customer-info-internal .customer-grid div:not(.customer-internal-alert) {
  background: transparent;
}

.customer-grid .customer-private-warning span,
.customer-grid .customer-private-warning strong {
  color: #9b2f2f;
}
.case-progress {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 10px 0 12px;
  overflow: visible;
  padding: 12px 0 4px;
  width: 100%;
}
.case-progress::before {
  content: "";
  position: absolute;
  left: calc(100% / 12);
  right: calc(100% / 12);
  top: 32px;
  height: 4px;
  border-radius: 999px;
  background: #e3e6e5;
}
.case-progress-step {
  position: relative;
  z-index: 1;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 0 4px;
  text-align: center;
}
.case-progress-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #d8dcda;
  background: #f4f5f5;
  color: #17202a;
  font-size: 15px;
  font-weight: 800;
  flex: 0 0 auto;
}
.case-progress-step strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-size: 14px;
  color: #2c302f;
}
.case-progress-step.done {
  color: #17202a;
}
.case-progress-step.done span {
  background: #12875d;
  border-color: #12875d;
  color: #fff;
}
.case-progress-step.current {
  color: #17202a;
}
.case-progress-step.current span {
  background: #2f7df0;
  border-color: #cfe0ff;
  box-shadow: 0 0 0 7px rgba(47, 125, 240, .16);
  color: #fff;
}
.case-progress-step.partial {
  color: #113f73;
}
.case-progress-step.partial span {
  background: #eef5ff;
  border-color: #9fc4ff;
  color: #113f73;
}
.case-progress-step.open span {
  background: #f4f5f5;
  color: #17202a;
}
@media (max-width: 760px) {
  .customer-info-public .customer-grid {
    grid-template-columns: 1fr;
  }
  .case-progress {
    padding-top: 10px;
  }
  .case-progress::before {
    top: 28px;
  }
  .case-progress-step {
    gap: 6px;
    padding: 0 2px;
  }
  .case-progress-step span {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
  .case-progress-step strong {
    font-size: 11px;
  }
}
.gallery-bubble {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  background: #fff;
  min-height: 100%;
  min-width: 0;
}
.gallery-bubble h3 {
  margin-top: 0;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.toolbar button { font-size: 12px; min-height: 30px; padding: 6px 9px; }
.timeline-row button,
.doc-action-stack button,
.timeline-subrow-actions button,
.quick-actions button {
  min-height: 30px;
  padding: 6px 9px;
  line-height: 1.1;
  white-space: nowrap;
}
.timeline-row .next-status-btn,
.timeline-subrow-actions .next-status-btn,
.quick-actions .next-status-btn {
  border-color: #e0a92f;
  background: #fff4cc;
  color: #6f4a00;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65);
}
.timeline-row .next-status-btn:hover,
.timeline-subrow-actions .next-status-btn:hover,
.quick-actions .next-status-btn:hover {
  background: #ffe7a3;
  border-color: #c98a12;
  filter: none;
}

.mail-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mail-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  min-width: 14px;
  font-size: 14px;
  line-height: 1;
}

.mail-symbol.paperclip {
  width: 11px;
  min-width: 11px;
  margin-left: -3px;
  font-size: 12px;
}
.whatsapp-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  line-height: 1;
}
.whatsapp-symbol svg {
  width: 18px;
  height: 18px;
  display: block;
}
.mini-action {
  min-height: 26px;
  padding: 4px 8px;
  margin-left: 8px;
}
.whatsapp-btn {
  border-color: #bfe8ce;
}
.timeline-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.6fr);
  gap: 8px;
  position: relative;
  border-left: 4px solid #176b87;
  align-items: center;
}
.timeline-row > div {
  min-width: 0;
}
.timeline-row > div:first-child:last-child {
  grid-column: 1 / -1;
}
.timeline-row .doc-action-stack {
  justify-self: end;
  width: 100%;
}
.timeline-row .toolbar {
  justify-content: flex-end;
  margin-top: 0;
}
.timeline-row .preview-wrap,
.timeline-row .einvoice-box {
  grid-column: 1 / -1;
}
.timeline-row::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #176b87;
  border: 2px solid #fff;
}
.timeline-row:has(strong) small {
  color: #52606d;
}
.quick-actions {
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  overflow-x: hidden;
  gap: 8px;
}
.quick-actions button {
  background: var(--ink);
  color: #fff;
  flex: 1 1 0;
  min-width: 0;
  max-width: 220px;
  white-space: normal;
}
.workflow-actions {
  margin-top: 9px;
}
button.danger {
  background: #bf2118;
  color: #fff;
  border-color: #bf2118;
}
.calendar-panel {
  overflow: visible;
}
.calendar-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 145px 145px 150px 150px;
  gap: 8px;
  margin: 10px 0 12px;
  position: relative;
  z-index: 30;
}
.toolbar [data-calendar-mode].active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.month-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.month-card h3 {
  margin: 0;
  padding: 8px 10px;
  background: #eaf4f5;
  color: #13677b;
  font-size: 14px;
}
.calendar-day {
  min-height: 34px;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding: 4px 6px;
}
.calendar-day.weekend {
  background: #e9f7fb;
}
.calendar-day.holiday {
  background: #fff3d6;
}
.calendar-date {
  display: flex;
  gap: 5px;
  align-items: flex-start;
  color: var(--ink);
  font-size: 12px;
}
.calendar-date span {
  color: var(--muted);
  font-size: 11px;
}
.calendar-events {
  display: grid;
  gap: 3px;
}
.calendar-event {
  min-height: 22px;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid #b7d4dc;
  background: #edf7fa;
  color: var(--ink);
  text-align: left;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-event.type-aufmass,
.calendar-list-item.type-aufmass { background: #dff3ef; border-color: #9ed9cf; color: #17202a; }
.calendar-event.type-montage,
.calendar-list-item.type-montage { background: #e3f4df; border-color: #abd99e; color: #17202a; }
.calendar-event.type-beratung,
.calendar-list-item.type-beratung { background: #eee7ff; border-color: #c8b6ff; color: #17202a; }
.calendar-event.type-nacharbeit,
.calendar-list-item.type-nacharbeit { background: #fff0dc; border-color: #f0bf79; color: #17202a; }
.calendar-event.type-default,
.calendar-list-item.type-default { background: #edf2f7; border-color: #cbd5e1; color: #17202a; }
.calendar-day-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.calendar-list-item {
  text-align: left;
  border-radius: 8px;
  padding: 8px 10px;
}
.calendar-list-item strong,
.calendar-list-item span {
  display: block;
}
.calendar-event span {
  font-weight: 800;
  margin-right: 5px;
  color: #176b87;
}
.calendar-event,
.calendar-event strong,
.calendar-event span,
.calendar-list-item,
.calendar-list-item strong,
.calendar-list-item span {
  color: #17202a;
}
.calendar-event.erledigt {
  background: #e3f3ed;
  border-color: #b7dccf;
}
.calendar-event.abgesagt {
  background: #f8e4e2;
  border-color: #efb8b3;
}
.holiday-label {
  color: #a35b00;
  font-size: 11px;
  font-weight: 800;
}
.day-mode,
.week-mode {
  grid-template-columns: 1fr;
}
.appointment-row {
  cursor: pointer;
}
.warning-box {
  border: 1px solid #f2c46d;
  background: #fff7e4;
  color: #6f5211;
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 10px;
  font-weight: 700;
}
.pdf-preview {
  width: 100%;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  background: #fff;
}
.preview-wrap {
  flex: 0 0 100%;
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.preview-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.tablet-pdf-message {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #c8dde4;
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  background: #eef8fb;
  color: var(--ink);
}
.tablet-pdf-message strong {
  font-size: 16px;
}
.tablet-pdf-message span {
  color: var(--muted);
}
.timeline-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}
.timeline-filter button.active {
  background: #176b87;
  color: #fff;
}
.status-checks {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.status-check {
  border: 1px solid var(--line);
  border-left: 4px solid #d8b45b;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  display: grid;
  gap: 2px;
}
.status-check.ok { border-left-color: #1b6f5b; }
.status-check.bad { border-left-color: #b42318; }
.status-check span {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.status-check details {
  margin-top: 4px;
}
.status-check summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}
.status-check pre {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  background: #f3f5f4;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}
.file-upload {
  margin: 8px 0;
}
.file-upload input {
  width: 100%;
  max-width: 100%;
}
.file-grid {
  display: grid;
  gap: 6px;
}
.file-grid a {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 9px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.file-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.file-gallery-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.file-gallery-pager span {
  color: var(--muted);
  font-weight: 700;
}
.file-gallery-pager button {
  min-height: 34px;
  padding: 6px 10px;
}
.file-tile {
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  min-height: 0;
  text-align: left;
}
.file-tile img,
.file-icon {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
  background: var(--soft);
  border: 1px solid var(--line);
}
.file-icon {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--muted);
}
.file-tile strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-gallery-empty {
  color: var(--muted);
  margin-top: 8px;
  overflow-wrap: anywhere;
}

@media (max-width: 1200px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
#appointmentModal .modal-actions {
  justify-content: space-between;
}
#appointmentModal #deleteAppointmentBtn {
  margin-right: auto;
}
.calendar-appointments-panel {
  padding: 0;
  overflow: hidden;
}
.calendar-appointments-panel > .calendar-appointments-summary {
  border-left: 5px solid #59636b;
}
.calendar-appointments-panel[open] > .calendar-appointments-summary::after {
  content: "^";
}
.calendar-appointment-list {
  padding: 12px;
}
.doc-action-stack {
  display: grid;
  justify-items: end;
  gap: 8px;
}
.doc-action-stack .toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  row-gap: 8px;
  margin-top: 0;
}
.doc-action-stack .toolbar button + button {
  margin-left: 2px;
}
.einvoice-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #f8fbfc;
}
.einvoice-box summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--brand);
}
.einvoice-box .toolbar {
  justify-content: flex-end;
  margin-top: 8px;
}
.einvoice-box small {
  display: block;
  margin-top: 6px;
  text-align: right;
}
.einvoice-inline-status {
  margin-top: 8px;
  padding: 10px 12px;
  max-width: 760px;
  border-left: 4px solid #d6a100;
  border-radius: 6px;
  background: #fff8ce;
  color: #3b3420;
  font-size: 14px;
  line-height: 1.35;
}
.search { max-width: 320px; }
.calc { max-width: 360px; }

.export-center {
  display: grid;
  gap: 14px;
}
.export-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.export-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid #d4dcda;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #f6f8f7;
}
.export-card h3,
.export-card p {
  margin: 0;
}
.floating-calc {
  position: fixed;
  z-index: 1200;
  top: 96px;
  right: 28px;
  width: min(420px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(14, 24, 28, .22);
  padding: 14px;
}
.floating-calc.hidden {
  display: none;
}
.floating-calc .calc {
  max-width: none;
}
.floating-calc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: move;
  user-select: none;
  margin-bottom: 10px;
}
.floating-calc-head button {
  cursor: pointer;
}
.calc-display {
  height: 48px;
  text-align: right;
  font-size: 22px;
  margin-bottom: 10px;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.calc-grid button, .factor-row button {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.calc-grid button:nth-child(4n), .calc-grid button:nth-child(15) {
  background: #202623;
  color: #fff;
}
.wide-btn { grid-column: span 4; }
.factor-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.offer-items {
  display: grid;
  gap: 12px;
}
.acceptance-items {
  display: grid;
  gap: 10px;
  margin: 10px 0 14px;
}
.acceptance-review-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -6px 0 14px auto;
  padding: 13px 16px;
  width: min(560px, 100%);
  border: 2px solid #f59e0b;
  border-radius: 8px;
  background: #fff3d6;
  color: #4d3300;
}
.acceptance-review-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  font-weight: 800;
}
.acceptance-review-choice label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 800;
}
.acceptance-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto minmax(220px, .9fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.acceptance-item label {
  margin: 0;
}
.acceptance-item .check-label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
}
.acceptance-remark[hidden] {
  display: none;
}
.acceptance-remark textarea {
  min-height: 72px;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.offer-signature-grid {
  grid-template-columns: minmax(0, 1fr);
}

.mail-timeline-row {
  border-left-color: #176b87;
  background: #f7fbfc;
}

.mail-child-stack {
  display: grid;
  gap: 6px;
  margin: 4px 0 4px clamp(46px, 7vw, 130px);
}

.mail-child-stack .mail-timeline-row {
  width: min(760px, calc(100% - 10px));
}

.timeline-group-block {
  border: 1px solid var(--line);
  border-left: 5px solid #176b87;
  border-radius: 8px;
  margin: 10px 0;
  overflow: hidden;
  background: #fff;
}

.timeline-group-block > .timeline-row {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.timeline-group-block > .timeline-row::before {
  display: none;
}

.timeline-group-estimate { background: #f7fbfc; border-left-color: #176b87; }
.timeline-group-offer { background: #fbfaf2; border-left-color: #b78a2b; }
.timeline-group-job { background: #f7faf6; border-left-color: #4f8d57; }
.timeline-group-invoice { background: #f9f7fc; border-left-color: #7562a8; }
.timeline-group-acceptance { background: #f7fbf9; border-left-color: #2d8b75; }
.timeline-group-reminder { background: #fff8f6; border-left-color: #c46b55; }

.timeline-subrows {
  margin: 0 14px 12px 24px;
  border-top: 1px solid rgba(23, 107, 135, .18);
}

.timeline-subrow {
  display: grid;
  grid-template-columns: minmax(170px, 270px) minmax(0, 1fr) auto;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(23, 107, 135, .12);
  align-items: center;
}

.timeline-subrow:last-child {
  border-bottom: 0;
}

.timeline-subrow strong {
  font-size: .9rem;
}

.timeline-subrow small {
  color: var(--muted);
}

.timeline-subrow-actions {
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.timeline-subrow-actions button {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 12px;
  line-height: 1.1;
}

.timeline-subrow-actions .mail-btn-label {
  gap: 5px;
}

.timeline-subrow-actions .mail-symbol,
.timeline-subrow-actions .whatsapp-symbol {
  width: 14px;
  min-width: 14px;
  height: 14px;
  font-size: 14px;
}

.timeline-subrow-actions .whatsapp-symbol svg {
  width: 14px;
  height: 14px;
}

.timeline-subrow.sub-mail strong { color: #176b87; }
.timeline-subrow.sub-payment strong { color: #4f8d57; }
.timeline-subrow.sub-status strong { color: #5b6270; }
.timeline-subrow.sub-appointment strong { color: #8a6a18; }

.timeline-child-subrows {
  margin-left: 0;
  background: rgba(247, 251, 252, .72);
}

.timeline-child-subrows .timeline-subrow {
  padding-left: 14px;
  border-left: 3px solid rgba(23, 107, 135, .24);
}

.timeline-subrow.child-mail {
  margin-left: clamp(28px, 4vw, 72px);
  padding-left: 14px;
  border-left: 3px solid rgba(23, 107, 135, .28);
  background: rgba(247, 251, 252, .75);
}

@media (max-width: 820px) {
  .timeline-row,
  .timeline-subrow {
    grid-template-columns: minmax(0, 1fr);
  }

  .timeline-row .doc-action-stack,
  .timeline-subrow-actions {
    justify-self: stretch;
  }

  .timeline-row .toolbar,
  .timeline-subrow-actions {
    justify-content: flex-end;
  }
}

.signature-pad {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfc;
}

.signature-pad canvas {
  display: block;
  width: 100%;
  height: 150px;
  margin: 8px 0;
  border: 1px dashed #9fb2bc;
  border-radius: 6px;
  background: #fff;
  touch-action: none;
}
.offer-item-row {
  border: 1px solid var(--line);
  border-left: 4px solid #176b87;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.offer-item-main,
.offer-item-detail {
  display: grid;
  gap: 8px;
  align-items: start;
}
.offer-item-main {
  grid-template-columns: minmax(150px, 1.2fr) minmax(180px, 1.6fr) 80px 95px 110px 44px;
}
.offer-item-detail {
  margin-top: 8px;
  grid-template-columns: minmax(160px, 1fr) 110px 110px minmax(150px, 1fr) minmax(180px, 1fr) minmax(220px, 1.2fr);
}
.offer-item-main input,
.offer-item-detail input,
.offer-item-detail select,
.offer-item-detail textarea {
  min-width: 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.template-editor {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.template-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.template-group h3 {
  margin: 0;
  padding: 10px 12px;
  background: #e4e7e5;
  color: #13677b;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.template-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.6fr) 100px 105px 75px 88px minmax(190px, 1.8fr) 104px;
  gap: 0;
  align-items: stretch;
  padding: 0;
  border-top: 1px solid #e1e6e3;
  background: #fff;
}
.template-row:first-of-type {
  border-top: 0;
}
.template-row input,
.template-row select,
.template-row textarea {
  min-height: 44px;
  border: 0;
  border-right: 1px solid #e1e6e3;
  border-radius: 0;
  background: #fbfcfc;
}
.template-row textarea {
  min-height: 44px;
  resize: vertical;
}
.template-row button {
  border: 0;
  border-radius: 0;
  background: #e7eef1;
  color: var(--ink);
}
.price-rule-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.price-rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  border: 0;
  border-top: 1px solid #e1e6e3;
  border-radius: 0;
  padding: 10px 12px;
  background: #fff;
}
.price-rule-row:first-child {
  border-top: 0;
}
.price-rule-row small {
  color: var(--muted);
}
.price-rule-test {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfc;
}
.price-rule-test h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #13677b;
}
.price-rule-test-result {
  margin-top: 9px;
  border-left: 4px solid #176b87;
  border-radius: 8px;
  background: #eef8fb;
  padding: 8px 10px;
  line-height: 1.45;
}
.footer-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}
.footer-col {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  display: grid;
  gap: 0;
  overflow: hidden;
  background: #fff;
}
.footer-col strong {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #eef3f1;
  color: #17202a;
}
.footer-col label {
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border-bottom: 1px solid #e1e6e3;
  background: #fff;
}
.footer-col label:last-child {
  border-bottom: 0;
}
.footer-col select {
  background: #fbfcfc;
}
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff;
  font-size: 12px;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #111413;
  color: #fff;
  padding: 10px 12px;
  border-radius: 7px;
  box-shadow: var(--shadow);
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(17, 20, 19, .42);
  padding: 20px;
}
.modal.hidden { display: none; }
.modal-card {
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(17, 20, 19, .24);
  padding: 16px;
}
.loading-card {
  width: min(360px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 28px 24px;
}
.loading-card h2 {
  margin: 0;
}
.loading-card p {
  margin: 0;
  color: var(--muted);
}
.confirm-card {
  width: min(420px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
}
.confirm-card h2 {
  margin: 0;
  font-size: 18px;
}
.confirm-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}
.confirm-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #fff4d6;
  color: #7a4c00;
  font-weight: 900;
  border: 1px solid #f0d48a;
}
.confirm-actions {
  width: 100%;
  justify-content: center;
}
.loading-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #d8dfdc;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .85s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.image-modal-card {
  width: min(1180px, calc(100vw - 32px));
  height: min(820px, calc(100vh - 32px));
  max-height: none;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.image-modal-actions {
  justify-content: space-between;
}
.image-viewer {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: start;
  gap: 10px;
  min-height: 0;
  min-width: 0;
  background: #f6f9fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  position: relative;
  overflow: auto;
  overscroll-behavior: contain;
}
.image-viewer img,
.image-viewer iframe {
  width: 100%;
  min-width: 0;
  max-height: none;
  box-sizing: border-box;
  background: #fff;
  border-radius: 6px;
}
.image-viewer img {
  height: auto;
  object-fit: contain;
  align-self: start;
  justify-self: center;
}
.image-viewer iframe {
  height: 100%;
  border: 0;
  min-height: 0;
}
.image-viewer.pdf-mode {
  grid-template-columns: 1fr;
  align-items: stretch;
  overflow: hidden;
}
.image-viewer.pdf-mode iframe {
  height: 100%;
}
.image-viewer.pdf-mode .image-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  background: rgba(17, 20, 19, .92);
  color: #fff;
  border-color: rgba(17, 20, 19, .92);
}
.image-viewer.pdf-mode #fileViewerPrev {
  left: 12px;
}
.image-viewer.pdf-mode #fileViewerNext {
  right: 12px;
}
.image-nav {
  min-height: 44px;
  width: 44px;
  padding: 0;
  font-size: 28px;
  display: grid;
  place-items: center;
}
.payment-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0 16px;
  background: #fbfcfd;
}
.payment-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.payment-summary strong {
  display: block;
  margin-top: 3px;
}
input[readonly] {
  background: #e9eef2;
  color: var(--muted);
}
.placeholder-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.placeholder-token {
  display: grid;
  gap: 3px;
  text-align: left;
  background: #fbfcfc;
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 4px solid #176b87;
  border-radius: 7px;
  padding: 10px;
  cursor: pointer;
}
.placeholder-token code {
  font-weight: 800;
  font-size: 14px;
}
.placeholder-token span {
  color: var(--muted);
  font-size: 12px;
}
.hidden { display: none !important; }

.customer-info-public .customer-grid > div {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.customer-info-public .customer-grid > div > span,
.customer-info-internal .customer-grid > div > span {
  min-width: 0;
}

.customer-info-public .customer-grid > div > strong {
  display: block;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.customer-info-public .customer-grid .mini-action {
  margin-top: 5px;
  width: fit-content;
}

.customer-info-public .customer-grid {
  grid-template-columns: 1fr;
}
.customer-info-public .customer-grid > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: 0;
  border-bottom: 1px solid #dfece5;
  border-radius: 0;
  padding: 7px 0;
  background: transparent;
}
.customer-info-public .customer-grid > div:last-child {
  border-bottom: 0;
}

@media (max-width: 1300px) {
  .customer-info-internal .customer-grid > div {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .customer-info-internal .customer-grid > div > strong {
    display: block;
    width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
.lock {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #f4f8f6;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.lock::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/premium-fliegengitter-logo.png") center 42% / min(520px, 62vw) auto no-repeat;
  opacity: .09;
  pointer-events: none;
}
.lock-panel {
  position: relative;
  z-index: 1;
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border-radius: 8px;
  padding: 22px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}
.lock-panel img {
  width: 190px;
  justify-self: center;
}
.lock-panel h1 { margin: 6px 0 0; font-size: 20px; }
.lock-panel p { margin: 0; color: var(--muted); }
#activateError { color: var(--danger); font-size: 12px; min-height: 16px; }

@media (max-width: 980px) {
  .export-trash-panel {
    padding: 8px;
  }
  .export-trash-panel th,
  .export-trash-panel td {
    padding: 5px 6px;
    font-size: 13px;
  }
  .export-trash-panel th:nth-child(1),
  .export-trash-panel td:nth-child(1) { width: 15%; }
  .export-trash-panel th:nth-child(2),
  .export-trash-panel td:nth-child(2) { width: 9%; }
  .export-trash-panel th:nth-child(3),
  .export-trash-panel td:nth-child(3) { width: 16%; }
  .export-trash-panel th:nth-child(4),
  .export-trash-panel td:nth-child(4) { width: 30%; }
  .export-trash-panel th:nth-child(5),
  .export-trash-panel td:nth-child(5) { width: 16%; }
  .export-trash-panel th:nth-child(6),
  .export-trash-panel td:nth-child(6) {
    width: 88px;
    min-width: 88px;
    overflow: visible;
  }
  .trash-actions .icon-action-btn {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
  }
  .month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .calendar-filters {
    grid-template-columns: 1fr;
  }
  .stats-filter {
    grid-template-columns: 1fr;
  }
  .estimate-note-warning-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .month-grid {
    grid-template-columns: 1fr;
  }
  .stat-kpis {
    grid-template-columns: 1fr;
  }
  .calendar-day {
    grid-template-columns: 42px 1fr;
  }
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
  }
  nav { grid-template-columns: repeat(3, 1fr); }
  .shell { margin-left: 0; padding: 14px; width: 100vw; }
  .topbar, .grid.two, .detail-grid { grid-template-columns: 1fr; display: grid; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .kpis, .stat-kpis { grid-template-columns: repeat(2, 1fr); }
  .export-grid, .case-compact-status { grid-template-columns: 1fr; }
  .form-grid, .form-grid.compact { grid-template-columns: repeat(2, 1fr); }
  .quick-grid, .quick-main-fields, .footer-settings { grid-template-columns: 1fr; }
  .item-main, .item-detail { grid-template-columns: 1fr 1fr; }
  .template-row { grid-template-columns: 1fr 1fr; }
  .case-filter-row.fields,
  .case-filter-row.search-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .case-filter-row.date-row,
  .case-filter-row.status-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 981px) and (max-width: 1500px) {
  .sidebar {
    width: 210px;
  }
  .shell {
    margin-left: 210px;
    width: auto;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  .nav {
    padding: 7px 9px;
  }
  .item-row {
    padding: 9px;
  }
  .item-main {
    grid-template-columns: minmax(104px, 1fr) minmax(82px, .75fr) minmax(140px, 1.25fr) 58px 68px 78px 38px;
    gap: 7px;
  }
  .item-detail {
    grid-template-columns: minmax(110px, 1fr) 68px 68px minmax(96px, .75fr) minmax(112px, .95fr) minmax(126px, 1fr) minmax(138px, max-content);
    gap: 7px;
  }
  .item-main input,
  .item-main select,
  .item-detail input,
  .item-detail textarea {
    min-height: 34px;
    padding: 6px 8px;
  }
  button {
    padding: 7px 10px;
  }
}

@media (min-width: 981px) and (max-width: 1240px) {
  .pdf-preview {
    min-height: 74vh;
    height: 74vh;
  }
  .preview-actions {
    position: sticky;
    top: 0;
    z-index: 2;
    justify-content: flex-start;
    padding: 8px 0;
    background: #fff;
  }
  .item-main {
    grid-template-columns: minmax(128px, 1.1fr) minmax(88px, .75fr) minmax(170px, 1.35fr) 70px 82px 90px 40px;
  }
  .item-detail {
    grid-template-columns: minmax(120px, 1fr) 68px 68px minmax(96px, .8fr) minmax(112px, .95fr) minmax(126px, 1fr) minmax(138px, max-content);
  }
  .item-detail [name="color"],
  .item-detail [name="mounting_note"],
.item-detail [name="description"] {
  grid-column: span 1;
}
.offer-items {
  display: grid;
  gap: 12px;
}
.offer-item-row {
  border: 1px solid var(--line);
  border-left: 4px solid #176b87;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.offer-item-main,
.offer-item-detail {
  display: grid;
  gap: 8px;
  align-items: start;
}
.offer-item-main {
  grid-template-columns: minmax(150px, 1.2fr) minmax(180px, 1.6fr) 80px 95px 110px 44px;
}
.offer-item-detail {
  margin-top: 8px;
  grid-template-columns: minmax(160px, 1fr) 110px 110px minmax(150px, 1fr) minmax(180px, 1fr) minmax(220px, 1.2fr);
}
.offer-item-main input,
.offer-item-detail input,
.offer-item-detail textarea {
  min-width: 0;
}
  .estimate-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 980px) {
  .pdf-preview {
    min-height: 72vh;
    height: 72vh;
  }
  .preview-actions {
    position: sticky;
    top: 0;
    z-index: 2;
    justify-content: flex-start;
    padding: 8px 0;
    background: #fff;
  }
  .preview-actions button {
    flex: 1 1 180px;
  }
}

@media (max-width: 560px) {
  nav { grid-template-columns: 1fr 1fr; }
  .kpis, .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
  .item-main, .item-detail { grid-template-columns: 1fr; }
  .credit-line { grid-template-columns: 1fr; }
  .template-row { grid-template-columns: 1fr; }
  .case-filter-row.fields,
  .case-filter-row.search-row,
  .case-filter-row.date-row {
    grid-template-columns: 1fr;
  }
  .case-filter-row.status-row {
    grid-template-columns: 1fr;
  }
  .case-filter-row.date-row label:not(.check-label) {
    grid-template-columns: 32px 1fr;
  }
  .topbar { align-items: stretch; }
  .actions { width: 100%; }
  .top-search { width: 100%; min-width: 0; }
  .actions button { flex: 1; }
}

/* Modal overrides: keep dialogs inside the visible browser width. */
.modal {
  padding: clamp(8px, 2vw, 20px);
}
.modal-card {
  box-sizing: border-box;
  max-width: calc(100vw - clamp(16px, 4vw, 40px));
  overflow-x: hidden;
  overflow-y: auto;
}
.wide-modal {
  width: min(1160px, calc(100vw - clamp(16px, 4vw, 40px)));
}
.wide-modal * {
  box-sizing: border-box;
}
.wide-modal .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.wide-modal .form-grid .wide {
  grid-column: 1 / -1;
}
.offer-item-row {
  max-width: 100%;
  overflow: hidden;
}
.offer-item-main,
.offer-item-detail {
  width: 100%;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.offer-item-main [name="element_type"] { grid-column: span 2; }
.offer-item-main [name="wing_type"] { grid-column: span 2; }
.offer-item-main [name="product"] { grid-column: span 4; }
.offer-item-main [name="quantity"] { grid-column: span 1; }
.offer-item-main [name="unit"] { grid-column: span 1; }
.offer-item-main [name="unit_price"] { grid-column: span 1; }
.offer-item-main .remove-offer-item { grid-column: span 1; }
.offer-item-detail [name="room"] { grid-column: span 3; }
.offer-item-detail [name="width"] { grid-column: span 2; }
.offer-item-detail [name="height"] { grid-column: span 2; }
.offer-item-detail [name="color"] { grid-column: span 2; }
.offer-item-detail [name="mounting_note"] { grid-column: span 3; }
.offer-item-detail [name="description"] { grid-column: 1 / -1; }
.offer-item-main input,
.offer-item-detail input,
.offer-item-detail select,
.offer-item-detail textarea {
  width: 100%;
}
.offer-item-row.service-item .offer-item-main {
  grid-template-columns: minmax(0, 1fr) 88px 110px minmax(100px, 140px) 42px;
}
.offer-item-row.service-item .offer-item-main [name="element_type"],
.offer-item-row.service-item .offer-item-main [name="wing_type"] {
  display: none;
}
.offer-item-row.service-item .offer-item-main [name="product"],
.offer-item-row.service-item .offer-item-main [name="quantity"],
.offer-item-row.service-item .offer-item-main [name="unit"],
.offer-item-row.service-item .offer-item-main [name="unit_price"],
.offer-item-row.service-item .offer-item-main .remove-offer-item {
  grid-column: auto;
}
.offer-item-row.service-item .offer-item-detail {
  grid-template-columns: 1fr;
}
.offer-item-row.service-item .offer-item-detail [name="room"],
.offer-item-row.service-item .offer-item-detail [name="width"],
.offer-item-row.service-item .offer-item-detail [name="height"],
.offer-item-row.service-item .offer-item-detail [name="color"],
.offer-item-row.service-item .offer-item-detail [name="mounting_note"] {
  display: none;
}
.offer-item-row.service-item .offer-item-detail [name="description"] {
  grid-column: 1 / -1;
}

.offer-payment-box {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #e0c574;
  border-left: 6px solid #d6a100;
  border-radius: 8px;
  background: #fff9df;
}

.offer-payment-title {
  grid-column: 1 / -1;
  font-weight: 800;
  color: #6e5200;
}

.offer-payment-box label {
  color: #5e4c17;
}

.offer-payment-box input[readonly] {
  background: #f0ead3;
  color: #2d2a20;
  font-weight: 800;
}

@media (max-width: 980px) {
  .wide-modal .form-grid {
    grid-template-columns: 1fr;
  }
  .offer-payment-box {
    grid-template-columns: 1fr;
  }
  .offer-item-main {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .offer-item-main [name="element_type"] { grid-column: span 3; }
  .offer-item-main [name="wing_type"] { grid-column: span 3; }
  .offer-item-main [name="product"] { grid-column: span 3; }
  .offer-item-main [name="quantity"],
  .offer-item-main [name="unit"],
  .offer-item-main [name="unit_price"] { grid-column: span 2; }
  .offer-item-main .remove-offer-item { grid-column: span 6; }
  .offer-item-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .offer-item-detail [name="room"],
  .offer-item-detail [name="color"],
  .offer-item-detail [name="mounting_note"],
  .offer-item-detail [name="description"] {
    grid-column: 1 / -1;
  }
  .offer-item-row.service-item .offer-item-main {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .offer-item-row.service-item .offer-item-main [name="product"] { grid-column: 1 / -1; }
  .offer-item-row.service-item .offer-item-main [name="quantity"],
  .offer-item-row.service-item .offer-item-main [name="unit"],
  .offer-item-row.service-item .offer-item-main [name="unit_price"] { grid-column: span 1; }
  .offer-item-row.service-item .offer-item-main .remove-offer-item { grid-column: span 1; }
}

@media (max-width: 620px) {
  .modal-card,
  .wide-modal {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    padding: 12px;
  }
  .offer-item-main,
  .offer-item-detail,
  .offer-item-row.service-item .offer-item-main {
    grid-template-columns: 1fr;
  }
  .offer-item-main > *,
  .offer-item-detail > *,
  .offer-item-row.service-item .offer-item-main > * {
    grid-column: 1 / -1 !important;
  }
}

@media (min-width: 1500px) {
  .quick-main-fields {
    grid-template-columns: repeat(6, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .quick-main-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .quick-col {
    padding: 8px;
  }
  .quick-item {
    min-height: 50px;
    padding: 8px;
  }
  .quick-item strong {
    font-size: 12px;
  }
  .quick-item span {
    font-size: 11px;
  }
}

@media (max-width: 700px) {
  .quick-main-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .quick-main-fields {
    grid-template-columns: 1fr;
  }
}
