:root {
  color-scheme: light;
  --ink: #211f1c;
  --muted: #746d63;
  --line: #ded8cd;
  --paper: #f8f5ef;
  --panel: #fffdf9;
  --accent: #1c625e;
  --accent-dark: #123f3c;
  --rose: #a84555;
  --amber: #a97726;
  --blue: #435f8f;
  --green: #3c7350;
  --violet: #74619a;
  --shadow: 0 14px 34px rgba(40, 35, 26, 0.09);
  --font-display: "Cormorant Garamond", "Didot", "Bodoni 72", Georgia, serif;
  --font-ui: "Manrope", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4efe6;
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 4rem);
  font-weight: 700;
  line-height: 0.94;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  font-weight: 700;
}

h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

h4 {
  font-family: var(--font-ui);
  font-size: 0.98rem;
  font-weight: 800;
}

main {
  padding: 18px clamp(14px, 3vw, 42px) 42px;
}

.hidden {
  display: none !important;
}

.eyebrow {
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
  gap: 24px;
  min-height: 100vh;
  padding: clamp(20px, 4vw, 52px);
}

.admin-view {
  min-height: 100vh;
  padding: 18px;
}

.admin-view main {
  display: grid;
  gap: 16px;
}

.brand-panel,
.auth-card,
.toolbar,
.panel,
.day-group,
.association-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brand-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(24px, 5vw, 54px);
}

.brand-copy {
  max-width: 460px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.45;
}

.auth-card {
  align-self: center;
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.auth-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.auth-tab.active {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.auth-form,
form,
.view {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.auth-message {
  min-height: 22px;
  color: var(--rose);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.88rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.admin-create-form {
  margin-top: 14px;
}

.admin-links {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.admin-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.admin-link-row strong,
.admin-link-row span {
  display: block;
  font-family: var(--font-ui);
}

.admin-link-row strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.admin-link-row span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 760;
}

.password-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.password-rules span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 4px 8px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
}

.password-rules .rule-ok {
  border-color: #b8d7c0;
  background: #f0faf2;
  color: var(--green);
}

.topbar,
.top-actions,
.toolbar,
.section-heading,
.record-top,
.record-footer,
.day-header,
.form-footer,
.association-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar {
  padding: 20px clamp(14px, 3vw, 42px) 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 245, 239, 0.94);
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.metric,
.total-box {
  display: grid;
  gap: 2px;
  min-width: 132px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.metric span,
.total-box span,
.day-count {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.78rem;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.icon-action-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--accent-dark);
}

.price-list-icon {
  position: relative;
  width: 18px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px 3px 3px 4px;
  transform: rotate(-10deg);
}

.price-list-icon::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.price-list-icon::after {
  content: "";
  position: absolute;
  top: 5px;
  right: -6px;
  width: 7px;
  border-top: 2px solid currentColor;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.delete-button {
  min-height: 32px;
  border: 1px solid #ebc3c9;
  background: #fff7f8;
  color: var(--rose);
  padding: 0 10px;
}

.link-button,
.inline-link {
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  text-decoration: underline;
}

.toolbar,
.panel,
.day-group,
.association-panel {
  padding: clamp(14px, 2vw, 20px);
  min-width: 0;
  max-width: 100%;
}

.compact-toolbar {
  padding-top: 14px;
  padding-bottom: 14px;
}

.toolbar-fields,
.listino-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.listino-controls {
  align-items: stretch;
  min-width: 0;
}

.category-filter,
.status-choice,
.owner-choice {
  display: flex;
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.category-chip,
.status-choice-chip,
.owner-choice-chip {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--chip-border, var(--line));
  border-radius: 999px;
  background: var(--chip-bg, #fff);
  color: var(--chip-text, var(--muted));
  padding: 0 13px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.listino-controls label {
  flex: 1 1 260px;
  min-width: 0;
}

.category-chip.active {
  border-color: var(--chip-text, var(--accent));
  box-shadow: inset 0 0 0 1px var(--chip-text, var(--accent));
}

.status-choice-chip {
  --chip-bg: #fff;
  --chip-border: rgba(33, 31, 28, 0.16);
  position: relative;
  color: #fff;
  opacity: 0.74;
  padding-left: 15px;
  padding-right: 15px;
}

.status-choice-chip.active {
  opacity: 1;
  padding-left: 32px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72), 0 0 0 2px currentColor, 0 8px 18px rgba(33, 31, 28, 0.14);
  transform: translateY(-1px);
}

.status-choice-chip.active::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: currentColor;
  transform: translateY(-50%);
}

.owner-choice-chip {
  --chip-bg: #fff;
  --chip-border: rgba(33, 31, 28, 0.16);
  color: var(--ink);
}

.owner-choice-chip.active {
  border-color: var(--accent);
  background: #f6ebe5;
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.current-owner-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(123, 74, 49, 0.22);
  border-radius: 999px;
  padding: 2px 9px;
  background: #f7eee9;
  color: var(--accent-dark);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.muted-field {
  opacity: 0.68;
}

.muted-field input {
  background: #f7f3ef;
}

.association-panel p:last-child {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.86rem;
}

label,
.choice-field {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 780;
  line-height: 1.35;
  min-width: 0;
}

.choice-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.current-status-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  line-height: 1.25;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(28, 98, 94, 0.14);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 82px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--accent-dark);
  padding: 0 9px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 900;
  transform: translateY(-50%);
}

.primary-field {
  color: var(--ink);
  font-size: 0.91rem;
  font-weight: 900;
}

.primary-field input {
  min-height: 48px;
  border: 1.5px solid rgba(28, 98, 94, 0.5);
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfa 100%);
  box-shadow: 0 10px 22px rgba(31, 42, 68, 0.08);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 720;
}

.primary-field input::placeholder {
  color: rgba(31, 42, 68, 0.5);
}

.primary-field.date-priority input {
  border-color: rgba(143, 91, 55, 0.52);
  background: linear-gradient(180deg, #fff 0%, #fff8f2 100%);
}

.primary-field input:focus {
  border-color: var(--accent);
  outline: 4px solid rgba(28, 98, 94, 0.16);
  box-shadow: 0 12px 26px rgba(31, 42, 68, 0.12);
}

.customer-search-field {
  position: relative;
}

.customer-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  display: grid;
  gap: 5px;
  max-height: 245px;
  overflow-y: auto;
  border: 1px solid rgba(31, 42, 68, 0.14);
  border-radius: 8px;
  background: #fff;
  padding: 7px;
  box-shadow: 0 18px 34px rgba(31, 42, 68, 0.15);
}

.customer-suggestion {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.customer-suggestion:hover,
.customer-suggestion:focus {
  background: rgba(28, 98, 94, 0.08);
  outline: none;
}

.customer-suggestion-name {
  font-size: 0.9rem;
  font-weight: 900;
}

.customer-suggestion-meta,
.customer-suggestion-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.customer-suggestion-empty {
  padding: 10px;
}

.compact-field {
  min-width: 230px;
}

.compact-field.small {
  min-width: 170px;
}

.field-grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.customer-panel .section-heading + .field-grid {
  margin-top: 18px;
}

.customer-panel .field-grid + .field-grid {
  margin-top: 20px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.work-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.work-editor-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.status-timeline-panel {
  position: sticky;
  top: 16px;
  min-width: 0;
  align-self: start;
}

.status-timeline {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.status-timeline-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 30px;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px;
  min-width: 0;
}

.status-timeline-item > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.status-timeline-item .icon-button {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  justify-self: end;
  align-self: center;
  font-size: 0.78rem;
}

.status-timeline-dot {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 2px currentColor;
}

.status-timeline-dot.status-new {
  color: var(--blue);
}

.status-timeline-dot.status-working {
  color: var(--amber);
}

.status-timeline-dot.status-fitting {
  color: var(--violet);
}

.status-timeline-dot.status-ready {
  color: var(--green);
}

.status-timeline-dot.status-delivered {
  color: var(--accent);
}

.status-timeline-dot.status-issue {
  color: var(--rose);
}

.status-timeline-item strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.status-timeline-item span:not(.status-timeline-dot) {
  display: block;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 650;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

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

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.checkbox-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 3px 9px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-new {
  background: var(--blue);
}

.status-working {
  background: var(--amber);
}

.status-fitting {
  background: var(--violet);
}

.status-ready {
  background: var(--green);
}

.status-delivered {
  background: var(--accent);
}

.status-issue {
  background: var(--rose);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  max-height: 505px;
  overflow-y: auto;
  padding-right: 4px;
}

.service-tile {
  display: grid;
  align-content: space-between;
  gap: 6px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  padding: 10px;
  text-align: left;
}

.service-tile:hover,
.service-tile.selected {
  border-color: var(--accent);
  background: #f1faf8;
}

.service-category,
.service-code,
.service-price {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 850;
}

.service-category {
  justify-self: start;
  border: 1px solid var(--chip-border, var(--line));
  border-radius: 999px;
  background: var(--chip-bg, #fff);
  color: var(--chip-text, var(--muted));
  padding: 2px 7px;
}

.service-code {
  color: var(--accent-dark);
}

.service-name {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.18;
}

.selected-services {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  min-width: 0;
}

.selected-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 82px 132px 118px 40px;
  gap: 9px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  min-width: 0;
}

.selected-row strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.86rem;
}

.selected-row .row-total {
  display: grid;
  align-content: end;
  justify-items: end;
  min-height: 64px;
  padding-bottom: 10px;
  color: var(--accent-dark);
  text-align: right;
}

.selected-row .row-total span {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 780;
}

.selected-row .row-total strong {
  color: var(--accent-dark);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 900;
  white-space: nowrap;
}

.icon-button {
  min-width: 38px;
  padding: 0;
  border: 1px solid #ebc3c9;
  background: #fff7f8;
  color: var(--rose);
}

.file-button {
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 1px dashed var(--accent);
  border-radius: 5px;
  background: #f5faf8;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 850;
  padding: 8px 12px;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  padding: 0;
}

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

.inline-document-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  justify-content: flex-end;
  min-width: 96px;
}

.icon-file-button {
  position: relative;
  grid-template-columns: auto auto;
  grid-auto-flow: column;
  gap: 8px;
  min-height: 42px;
  border-style: solid;
  white-space: nowrap;
}

.icon-only-file-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.file-button-icon {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.camera-icon {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.camera-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 4px;
  height: 4px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.camera-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  top: -5px;
  width: 8px;
  height: 4px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.upload-icon {
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.upload-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: -2px;
  width: 2px;
  height: 14px;
  background: currentColor;
}

.upload-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: -2px;
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.document-context {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid rgba(28, 98, 94, 0.18);
  background: #f7fbfa;
  padding: 12px;
}

.document-phase-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.document-phase-chip {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid rgba(28, 98, 94, 0.22);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 900;
}

.document-phase-chip.active {
  background: var(--accent);
  color: #fff;
}

.photo-description-row {
  margin-top: 14px;
}

.document-context .photo-description-row {
  margin-top: 0;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.camera-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.camera-context {
  display: grid;
  gap: 2px;
  border-left: 3px solid var(--accent);
  background: #f5faf8;
  padding: 8px 10px;
}

.camera-context strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 900;
}

.camera-context span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.camera-panel video {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  background: #111;
}

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

.camera-message {
  min-height: 20px;
  color: var(--rose);
  font-family: var(--font-ui);
  font-size: 0.82rem;
}

.photo-timeline {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.photo-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
}

.document-preview {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--accent-dark);
  text-decoration: none;
}

.document-preview img {
  width: 58px;
  height: 58px;
  object-fit: cover;
}

.pdf-preview {
  font-size: 0.78rem;
  font-weight: 900;
}

.photo-item strong {
  display: block;
  font-size: 0.92rem;
}

.photo-item span {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.76rem;
}

.form-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.96);
}

.grouped-days {
  display: grid;
  gap: 14px;
}

.day-header {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.day-records {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.record-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  padding: 11px;
}

.record-contact,
.record-dates,
.record-notes {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.78rem;
}

.record-services {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.record-services span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 3px 7px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 800;
}

.record-total {
  margin-right: auto;
  color: var(--accent-dark);
  white-space: nowrap;
}

.price-list-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 16px;
}

.price-list-sidebar {
  align-self: start;
  display: grid;
  gap: 14px;
}

.price-list-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.price-list-note {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 760;
}

.price-list-table {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.price-list-row {
  display: grid;
  grid-template-columns: 84px 118px minmax(180px, 1fr) 128px 128px 42px;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px;
}

.price-list-header {
  background: #f7f2ec;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.price-list-row.has-override {
  border-color: rgba(28, 98, 94, 0.34);
  background: #f5fbfa;
}

.price-list-code {
  color: var(--accent-dark);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 900;
}

.price-list-name {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 760;
}

.price-list-row label {
  gap: 4px;
}

.price-list-row label span {
  color: var(--muted);
  font-size: 0.68rem;
}

.price-list-row input {
  min-height: 34px;
  padding: 7px 8px;
}

.empty-state {
  border: 1px dashed var(--line);
  background: var(--panel);
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.compact-empty {
  padding: 14px;
  font-family: var(--font-ui);
  font-size: 0.86rem;
}

@media (max-width: 1160px) {
  .day-records {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-grid.four,
  .field-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .auth-shell,
  .day-records,
  .work-editor-layout,
  .price-list-layout,
  .field-grid.two,
  .field-grid.three,
  .field-grid.four {
    grid-template-columns: 1fr;
  }

  .status-timeline-panel {
    position: static;
  }

  .service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    max-height: 472px;
  }

  .service-tile {
    min-height: 88px;
    padding: 8px;
  }

  .service-name {
    font-size: 0.78rem;
  }

  .service-category,
  .service-code,
  .service-price {
    font-size: 0.62rem;
  }

  .topbar,
  .top-actions,
  .toolbar,
  .section-heading,
  .record-top,
  .record-footer,
  .day-header,
  .form-footer,
  .association-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-fields,
  .listino-controls,
  .compact-field {
    width: 100%;
  }

  .selected-row {
    grid-template-columns: 1fr;
  }

  .document-context .photo-description-row {
    grid-template-columns: 1fr;
  }

  .price-list-row,
  .price-list-header {
    grid-template-columns: 1fr;
  }

  .price-list-header {
    display: none;
  }

  .inline-document-actions {
    justify-content: flex-start;
  }

  .selected-row .row-total {
    text-align: right;
  }
}
