:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-soft: #eef3ed;
  --ink: #20231f;
  --muted: #6b7167;
  --line: #d9dfd5;
  --brand: #315f4b;
  --brand-2: #8f2f3c;
  --gold: #b8842b;
  --danger: #b83d3d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

a {
  color: inherit;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 212px 1fr;
}

.app.public-app {
  display: block;
}

.public-app .content {
  max-width: 1180px;
  margin: 0 auto;
}

.sidebar {
  background: #23352e;
  color: #f6faf4;
  padding: 18px 14px;
}

.brand {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 18px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 6px;
  color: #dce8df;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sidebar-user {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.sidebar-user a {
  display: inline-block;
  margin-top: 6px;
  color: #fff;
  font-weight: 700;
}

.content {
  padding: 20px 24px;
  max-width: 1500px;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.subtitle {
  color: var(--muted);
  margin-top: 6px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

.daily-status {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: var(--panel);
}

.daily-status.ok {
  border-left-color: #2f7b52;
}

.daily-status.warn {
  border-left-color: var(--gold);
}

.daily-status-title {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 800;
}

.daily-status-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.daily-status-items a,
.daily-status-items span {
  min-width: 130px;
  padding: 9px 11px;
  border-radius: 6px;
  text-decoration: none;
  background: var(--panel-soft);
  color: #26372f;
  font-weight: 700;
}

.daily-status-items strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.daily-status-items span span,
.daily-status-items a span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.daily-status-items .ok {
  background: #dcefe4;
  color: #1f6140;
}

.daily-status-items .warn {
  background: #f6e7cd;
  color: #825519;
}

.dashboard-cleaning-target {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
  padding: 14px;
}

.dashboard-cleaning-target h3 {
  margin: 10px 0 0;
  font-size: 20px;
}

.dashboard-cleaning-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.panel,
.stat,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat {
  padding: 12px 14px;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 4px;
}

.section {
  margin-top: 16px;
}

.section h2 {
  font-size: 18px;
  margin: 0 0 10px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stacked-sections {
  display: grid;
  gap: 16px;
}

.actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 230px;
}

.panel {
  padding: 14px;
}

.date-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.date-toolbar label {
  min-width: 190px;
}

.production-summary {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  margin-bottom: 14px;
}

.list-search {
  display: grid;
  grid-template-columns: minmax(240px, 420px) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.list-search .subtitle {
  margin: 0 0 8px;
}

.table-wrap {
  overflow: auto;
  max-height: min(68vh, 760px);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

th,
td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel-soft);
  font-size: 12px;
  text-transform: uppercase;
  color: #455149;
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: #314137;
  font-size: 11px;
  font-weight: 700;
}

.badge.ok {
  background: #dcefe4;
  color: #1f6140;
}

.badge.warn {
  background: #f6e7cd;
  color: #825519;
}

.badge.danger {
  background: #f3d6d6;
  color: #8b2424;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}

.button.secondary {
  background: #e7ece7;
  color: #24352e;
}

.button.danger-button {
  background: var(--danger);
}

.button.compact {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.link-action {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #b7dfc5;
  background: #e6f5eb;
  color: #235b39;
  border-radius: 8px;
}

.danger-notice {
  border-color: #f0b5ad;
  background: #fdebe8;
  color: #8b2424;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-panel h1 {
  margin: 0;
  font-size: 34px;
}

.google-button {
  justify-content: center;
}

.small-text {
  font-size: 13px;
}

.form-panel,
.danger-zone {
  max-width: 760px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(260px, 1fr);
  gap: 14px;
  align-items: start;
}

.preview-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.preview-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.equipment-photo,
.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.equipment-photo {
  object-fit: cover;
  display: block;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--panel-soft);
}

dl {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 0 0 8px;
}

.form-panel {
  display: grid;
  gap: 11px;
}

.wide-form {
  max-width: 940px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: #405047;
  font-size: 13px;
  font-weight: 700;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: #405047;
  font-size: 13px;
  font-weight: 700;
}

.locked-value {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: #24352e;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
}

.large-textarea {
  min-height: 420px;
  line-height: 1.45;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 24px;
}

.checkline.no-pad {
  padding-top: 0;
}

.checkline input {
  width: 18px;
  min-height: 18px;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #24352e;
  font-weight: 700;
}

.choice-row input {
  width: 16px;
  min-height: 16px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.danger-zone {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.danger-zone p {
  margin: 4px 0 0;
  color: var(--muted);
}

.multi-action-zone {
  max-width: 760px;
}

.multi-action-zone form {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.empty {
  padding: 22px;
  color: var(--muted);
}

.dashboard-table {
  max-height: 330px;
}

.cycle-grid {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.done-row td {
  color: var(--muted);
  background: #fbfcfa;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

.process-list {
  display: grid;
  gap: 9px;
}

.parameter-groups,
.display-param-groups {
  display: grid;
  gap: 14px;
}

.parameter-group,
.display-param-groups section {
  display: grid;
  gap: 9px;
}

.parameter-group h3,
.display-param-groups h3 {
  margin: 0;
  color: #33483d;
  font-size: 16px;
}

.parameter-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.parameter-chip {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.parameter-chip div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.parameter-chip strong {
  overflow-wrap: anywhere;
}

.parameter-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parameter-chip p {
  margin: 0;
  color: var(--brand);
  font-size: 24px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.parameter-chip small,
.parameter-chip em {
  color: var(--muted);
  font-size: 13px;
}

.parameter-chip em {
  font-style: normal;
  line-height: 1.35;
}

.process-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
}

.step-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.step-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.step-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.step-body p {
  margin: 5px 0 8px;
  color: #28342e;
}

.free-process-step p {
  line-height: 1.5;
  white-space: normal;
}

.process-step.free-process-step,
.display-process-step.free-process-step {
  grid-template-columns: 1fr;
}

.inline-meta {
  grid-template-columns: max-content 1fr;
  gap: 5px 10px;
}

.inline-meta dt,
.inline-meta dd {
  margin: 0;
}

.recipe-display {
  display: grid;
  gap: 18px;
}

.recipe-display-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.recipe-display-title {
  margin: 4px 0 12px;
  font-size: 64px;
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.recipe-display-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.display-section {
  display: grid;
  gap: 12px;
}

.display-section h2 {
  margin: 0;
  font-size: 22px;
}

.display-ingredient-list,
.display-process-list {
  display: grid;
  gap: 10px;
}

.display-ingredient {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: baseline;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.icon-action {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand);
  background: #fff;
  text-decoration: none;
  cursor: pointer;
}

.icon-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-action:hover {
  background: var(--panel-soft);
}

.ingredient-card-actions {
  display: flex;
  gap: 5px;
  align-self: center;
}

.ingredient-card-actions form {
  margin: 0;
}

button.icon-action {
  padding: 0;
  font: inherit;
}

.quick-notes {
  padding: 14px;
}

.quick-notes p {
  margin: 0;
  line-height: 1.45;
}

.display-ingredient-name {
  font-size: 42px;
  line-height: 1.02;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.display-ingredient-qty {
  color: var(--brand);
  font-size: 48px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.display-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.display-param-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.display-param {
  min-height: 112px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.display-param-name {
  color: var(--muted);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.display-param-value {
  margin-top: 6px;
  font-size: 34px;
  line-height: 1.08;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.display-param-value span {
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.display-details {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
}

.display-process-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.display-process-step h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.display-process-step p {
  margin: 0 0 8px;
  line-height: 1.45;
}

.cleaning-objective {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(200px, 320px) 1fr;
  gap: 18px;
  align-items: start;
}

.cleaning-objective h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.objective-instructions {
  border-left: 3px solid var(--line);
  padding-left: 14px;
}

.objective-instructions p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.cleaning-photo-stack {
  display: grid;
  gap: 10px;
}

.compact-form {
  display: grid;
  gap: 11px;
}

@media (max-width: 920px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .grid,
  .two-col,
  .form-grid,
  .editor-layout,
  .display-details,
  .dashboard-cleaning-target,
  .cleaning-objective {
    grid-template-columns: 1fr;
  }

  .danger-zone,
  .form-actions,
  .actions-row,
  .daily-status,
  .date-toolbar,
  .list-search {
    align-items: stretch;
    flex-direction: column;
  }

  .list-search {
    display: grid;
    grid-template-columns: 1fr;
  }

  .recipe-display-hero {
    flex-direction: column;
  }

  .recipe-display-title {
    font-size: 42px;
  }

  .display-ingredient {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .display-ingredient-name {
    font-size: 32px;
  }

  .display-ingredient-qty {
    font-size: 38px;
  }

  .display-param-value {
    font-size: 28px;
  }

  .daily-status-items {
    justify-content: stretch;
  }

  .daily-status-items a,
  .daily-status-items span {
    width: 100%;
  }
}

@media (min-width: 921px) and (max-width: 1280px) {
  .grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}
