:root {
  --bg: #f2ede2;
  --bg-panel: rgba(255, 250, 240, 0.9);
  --bg-card: #fffaf0;
  --bg-card-finished: #e7e2d8;
  --line: #2d261f;
  --line-soft: rgba(45, 38, 31, 0.18);
  --ink: #1f1a15;
  --muted: #6c6258;
  --accent: #bb5d2d;
  --accent-soft: #f0c8b4;
  --error: #b12822;
  --success: #24553a;
  --shadow: 0 12px 35px rgba(31, 26, 21, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(187, 93, 45, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(36, 85, 58, 0.12), transparent 22%),
    linear-gradient(180deg, #f6f0e6 0%, var(--bg) 100%);
  font-family: Georgia, "Times New Roman", serif;
}

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

.topbar {
  display: none;
}

.corner-menu {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 25;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.menu-toggle {
  display: inline-grid;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.92);
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--line);
}

.menu-panel {
  display: grid;
  gap: 10px;
  min-width: 238px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.menu-panel.is-hidden {
  display: none;
}

.action-button.is-hidden {
  display: none;
}

.menu-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
}

.menu-check input {
  margin: 0;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.tab {
  border: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab.is-active {
  background: var(--line);
  color: #fffaf0;
}

.date-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
}

.date-picker span {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.date-picker input {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.page {
  padding: 66px 14px 24px;
}

.view.is-hidden {
  display: none;
}

.toast-host {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 40;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #fffaf0;
  box-shadow: var(--shadow);
}

.toast.is-error {
  background: var(--error);
}

.toast.is-success {
  background: var(--success);
}

.view-header,
.summary-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.view-title h2,
.summary-toolbar h2 {
  margin: 0;
  font-size: 28px;
}

.view-title p,
.summary-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.toggle-button,
.action-button,
.finish-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf0;
  color: var(--ink);
  padding: 10px 14px;
  cursor: pointer;
}

.action-button.is-primary,
.finish-button {
  background: var(--line);
  color: #fffaf0;
}

.finish-button[disabled],
.action-button[disabled],
.toggle-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.board-section {
  margin-bottom: 28px;
}

.view-footer {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

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

.card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(45, 38, 31, 0.14);
  border-radius: 20px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.card.is-bath-only {
  border: 3px solid #4c82d9;
  background:
    linear-gradient(180deg, rgba(112, 152, 226, 0.22) 0%, rgba(255, 250, 240, 0.96) 42%, rgba(255, 250, 240, 0.96) 100%);
}

.card.is-finished {
  background: var(--bg-card-finished);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.card-heading {
  display: grid;
  gap: 2px;
}

.card-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.card-title h4 {
  margin: 0;
  font-size: 21px;
}

.owner {
  font-size: 14px;
  color: var(--muted);
}

.card-meta-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
  align-items: start;
}

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

.field,
.notes-field {
  position: relative;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.field-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-value,
.notes-preview,
.field-input,
.notes-input,
.staff-trigger,
.split-row button {
  min-height: 34px;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  white-space: pre-line;
}

.staff-field {
  position: relative;
  align-content: start;
  overflow: visible;
  z-index: 5;
}

.field-input,
.notes-input {
  display: block;
  font: inherit;
}

.field-input:focus,
.notes-input:focus {
  outline: 2px solid rgba(187, 93, 45, 0.25);
  border-color: rgba(187, 93, 45, 0.45);
}

.field--compact {
  gap: 0;
}

.field--compact .field-value,
.field--compact .notes-preview,
.field--compact .field-input,
.field--compact .notes-input {
  min-height: 32px;
  padding: 6px 10px;
}

.field-value--pill {
  display: inline-flex;
  width: auto;
  min-width: 120px;
  border-radius: 999px;
}

.field--full {
  grid-column: 1 / -1;
}

.field-value.is-readonly {
  cursor: default;
  background: rgba(45, 38, 31, 0.04);
}

.field-value--truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-value--services {
  display: grid;
  gap: 2px;
  align-items: stretch;
}

.service-line {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-line.is-empty {
  color: var(--muted);
  font-style: italic;
}

.field-value.is-empty,
.notes-preview.is-empty,
.staff-trigger.is-empty {
  color: var(--muted);
  font-style: italic;
}

.field-input::placeholder,
.notes-input::placeholder {
  color: var(--muted);
  font-style: italic;
}

.field-error {
  position: absolute;
  top: 29px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--error);
}

.card-section {
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.card-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.card-section details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-section details > summary::-webkit-details-marker {
  display: none;
}

.card-section-body {
  margin-top: 0;
  display: grid;
  gap: 8px;
}

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

.checkbox-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  line-height: 1.1;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.checkbox-chip input {
  margin: 0;
  transform: scale(0.92);
}

.checkbox-chip.is-checked {
  background: rgba(146, 108, 190, 0.34);
  border-color: rgba(103, 63, 149, 0.55);
  color: #2f1d45;
  font-weight: 700;
}

.stack {
  display: grid;
  gap: 8px;
}

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

.finish-row {
  display: flex;
  justify-content: flex-end;
}

.editor-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.editor-popover {
  position: absolute;
  min-width: 240px;
  max-width: min(520px, calc(100vw - 24px));
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: #fffaf0;
  box-shadow: 0 18px 50px rgba(31, 26, 21, 0.18);
  pointer-events: auto;
}

.editor-popover textarea,
.editor-popover input,
.editor-popover select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid var(--line-soft);
  background: #fff;
}

.editor-popover textarea {
  min-height: 130px;
  resize: vertical;
}

.multi-list {
  display: grid;
  gap: 5px;
  max-height: 240px;
  overflow: auto;
}

.staff-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  margin-top: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 32px rgba(45, 38, 31, 0.18);
  min-width: max(100%, 320px);
  max-width: min(92vw, 360px);
  z-index: 999;
}

.staff-dropdown:focus {
  outline: 2px solid rgba(187, 93, 45, 0.25);
  border-color: rgba(187, 93, 45, 0.45);
}

.multi-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(45, 38, 31, 0.04);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

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

.multi-option span {
  font-size: 16px;
  line-height: 1.15;
}

.multi-option:hover {
  border-color: var(--line-soft);
}

.multi-option.is-selected {
  background: var(--accent-soft);
  border-color: rgba(187, 93, 45, 0.45);
  color: #412013;
}

.split-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 110px;
  align-items: center;
}

.split-row--slider {
  grid-template-columns: minmax(74px, auto) 1fr minmax(82px, auto);
  gap: 8px;
}

.split-row input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}

.split-side {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 12px;
  color: var(--muted);
}

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

.stat-card,
.status-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line-soft);
  background: var(--bg-panel);
  box-shadow: var(--shadow);
}

.stat-label,
.status-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  margin-top: 10px;
  font-size: 34px;
}

.status-main {
  margin-top: 10px;
  font-size: 20px;
}

.status-meta {
  margin-top: 8px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line-soft);
  border-radius: 20px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

.report-page {
  min-height: 100vh;
  padding: 28px 16px 40px;
}

.report-shell {
  display: grid;
  gap: 18px;
  max-width: 100%;
}

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.report-error {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(177, 40, 34, 0.12);
  border: 1px solid rgba(177, 40, 34, 0.24);
  color: var(--error);
}

.report-table-host {
  min-width: 0;
}

.report-table-wrap {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.86);
  box-shadow: var(--shadow);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.report-table th,
.report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(45, 38, 31, 0.1);
  text-align: left;
  vertical-align: top;
}

.report-table th {
  position: sticky;
  top: 0;
  background: #f6f0e6;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.report-table td.is-multiline {
  white-space: pre-line;
}

@media (min-width: 720px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

}

@media (min-width: 980px) {
  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (min-width: 1240px) {
  .cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1480px) {
  .cards-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1720px) {
  .cards-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 719px) {
  .page {
    padding: 14px 12px 28px;
  }

  .card-grid,
  .split-row {
    grid-template-columns: 1fr;
  }

  .card-title h4 {
    font-size: 22px;
  }
}
