:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #17231f;
  background: #f3f6f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

.site-header {
  min-height: 64px;
  padding: 12px clamp(16px, 5vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #fff;
  background: #183b32;
}

.brand {
  color: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
}

.page-content {
  width: min(100% - 32px, 960px);
  margin: 40px auto;
}

.auth-card,
.welcome {
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid #dce5df;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgb(23 35 31 / 6%);
}

.auth-card {
  width: min(100%, 440px);
  margin: 8vh auto;
}

h1 {
  margin-top: 0;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
}

.auth-card form {
  display: grid;
  gap: 12px;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #b9c9bf;
  border-radius: 8px;
  font: inherit;
}

.button {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.button-primary {
  margin-top: 8px;
  color: #fff;
  background: #24634d;
}

.button-secondary {
  color: #fff;
  background: #315a4e;
}

.form-error {
  color: #a32121;
}

.eyebrow {
  color: #527362;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.role-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  color: #234f3d;
  background: #e4f2e9;
  font-weight: 650;
}

.catalog-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 32px;
}

.catalog-nav h2 {
  grid-column: 1 / -1;
}

.catalog-nav a,
.row-actions a,
.back-link {
  color: #24634d;
  font-weight: 650;
}

.catalog-nav a {
  padding: 16px;
  border: 1px solid #dce5df;
  border-radius: 10px;
  text-decoration: none;
}

.catalog-card {
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid #dce5df;
  border-radius: 16px;
  background: #fff;
}

.section-heading,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h1 {
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #e3eae5;
  white-space: nowrap;
}

th {
  color: #527362;
  font-size: 0.9rem;
}

.row-actions {
  display: flex;
  gap: 12px;
}

.danger-link,
.field-error {
  color: #a32121 !important;
}

.form-card {
  width: min(100%, 640px);
  margin-inline: auto;
}

.catalog-form,
.field-group {
  display: grid;
  gap: 8px;
}

.catalog-form {
  gap: 18px;
}

.field-group small {
  color: #527362;
}

.field-error {
  margin: 0;
  font-size: 0.9rem;
}

.form-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.button-danger {
  color: #fff;
  background: #a32121;
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  text-decoration: none;
}

.messages {
  margin-bottom: 16px;
}

.message {
  padding: 12px 16px;
  border-radius: 8px;
  background: #e4f2e9;
}

.message-warning,
.message-error {
  color: #7f261d;
  background: #fff0ec;
}

.state-filters {
  display: flex;
  gap: 8px;
  padding: 8px 0 16px;
  overflow-x: auto;
}

.state-filters a {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #dce5df;
  border-radius: 999px;
  color: #315a4e;
  text-decoration: none;
}

.state-filters a.selected {
  color: #fff;
  border-color: #24634d;
  background: #24634d;
}

.sort-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.sort-form select {
  min-height: 42px;
  padding: 8px;
  border: 1px solid #b9c9bf;
  border-radius: 8px;
  font: inherit;
}

.tank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.tank-card,
.allocation-card {
  padding: 18px;
  border: 1px solid #dce5df;
  border-radius: 12px;
  background: #fff;
}

.tank-card p {
  margin: 8px 0;
}

.tank-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tank-heading h2 {
  margin: 0;
}

.state-pill {
  padding: 5px 9px;
  border-radius: 999px;
  color: #234f3d;
  background: #e4f2e9;
  font-size: 0.85rem;
  white-space: nowrap;
}

.tank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.tank-actions a {
  color: #24634d;
  font-weight: 650;
}

.bulk-actions {
  margin: 0 0 16px;
}

.help-note {
  padding: 12px 16px;
  border-radius: 8px;
  color: #315a4e;
  background: #eaf3ed;
}

.negative-volume {
  color: #a32121;
  font-weight: 700;
}

.journal-filter {
  flex-wrap: wrap;
  margin: 20px 0;
}

.journal-filter input {
  width: auto;
  min-width: 150px;
}

.journal-group {
  margin-top: 24px;
}

.journal-group h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid #dce5df;
  font-size: 1.15rem;
}

.journal-entries {
  display: grid;
  gap: 10px;
}

.journal-entry {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid #e3eae5;
  border-radius: 10px;
}

.journal-description {
  margin: 0 0 6px;
}

.cancelled-label {
  color: #a32121;
}

.cancel-control summary,
.audit-history summary {
  color: #a32121;
  font-weight: 650;
  cursor: pointer;
}

.operation-controls {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.edit-link {
  color: #24634d;
  font-weight: 650;
}

.cancel-control form {
  display: grid;
  gap: 8px;
  min-width: min(260px, 70vw);
  margin-top: 10px;
}

.audit-history {
  margin-top: 24px;
  padding: 14px;
  border: 1px solid #dce5df;
  border-radius: 10px;
}

.report-filter {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid #dce5df;
}

.report-filter .field-group {
  min-width: 180px;
}

.report-actions,
.report-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.report-actions .button-primary,
.report-tabs .button-primary {
  margin-top: 0;
}

.report-tabs {
  margin-top: 20px;
}

.report-section {
  margin-top: 28px;
}

.report-section h2 {
  font-size: 1.2rem;
}

.catalog-card > h2 {
  margin: 22px 0 8px;
  font-size: 1.15rem;
}

.brew-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.allocation-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 12px 0;
}

.allocation-card legend {
  padding: 0 8px;
  color: #527362;
  font-weight: 650;
}

.allocation-card input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
}

@media (max-width: 520px) {
  .page-content {
    width: min(100% - 24px, 960px);
    margin: 20px auto;
  }

  .site-header {
    min-height: 60px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .sort-form {
    align-items: stretch;
    flex-direction: column;
  }
}

:root {
  color: #17241f;
  background: #f3f6f2;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

body {
  background:
    radial-gradient(ellipse at 82% 0, rgb(221 236 224 / 72%), transparent 34rem),
    #f3f6f2;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  justify-content: flex-start;
  min-height: 72px;
  padding-inline: clamp(18px, 5vw, 72px);
  background: rgb(20 49 40 / 96%);
  box-shadow: 0 4px 18px rgb(15 32 25 / 15%);
  backdrop-filter: blur(14px);
}

.site-header > form {
  margin-left: auto;
}

.menu-toggle {
  display: grid;
  width: 48px;
  height: 48px;
  align-items: center;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 14px;
  color: #fff;
  background: rgb(255 255 255 / 9%);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  border-color: rgb(255 255 255 / 52%);
  background: rgb(255 255 255 / 17%);
}

.menu-toggle:focus-visible {
  outline: 3px solid rgb(255 255 255 / 50%);
  outline-offset: 3px;
}

.menu-toggle-icon {
  display: grid;
  justify-self: center;
  width: 21px;
  gap: 5px;
}

.menu-toggle-icon i {
  display: block;
  width: 21px;
  height: 2px;
  border-radius: 2px;
  background: white;
}

.navigation-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(390px, 90vw);
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  color: #31483d;
  background: transparent;
}

.navigation-drawer[open] {
  animation: navigation-drawer-in 220ms ease-out both;
}

.navigation-drawer::backdrop {
  background: rgb(14 27 22 / 48%);
  backdrop-filter: blur(2px);
}

@keyframes navigation-drawer-in {
  from {
    transform: translateX(-24px);
    opacity: 0.75;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.navigation-sidebar {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #dfe8df;
  border-radius: 0 20px 20px 0;
  background: #fff;
  box-shadow: 16px 0 48px rgb(23 35 31 / 20%);
}

.navigation-heading {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid #edf1ed;
  background: linear-gradient(120deg, #f8fbf7, #edf5ee);
}

.navigation-heading h2 {
  margin: 0;
  color: #203a2e;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.navigation-heading p {
  margin: 5px 0 0;
  color: #718078;
  font-size: 0.9rem;
}

.navigation-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #dfe8df;
  border-radius: 12px;
  color: #385044;
  background: #fff;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
}

.navigation-close:hover,
.navigation-close:focus-visible {
  color: #174e38;
  background: #edf5ee;
}

.navigation-links {
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 18px 16px 28px;
}

.navigation-links > p {
  margin: 20px 12px 8px;
  color: #819087;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.navigation-link {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  color: #31483d;
  font-size: 0.98rem;
  font-weight: 620;
  text-decoration: none;
  transition: color 120ms ease, background 120ms ease, transform 120ms ease;
}

.navigation-link > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 9px;
  color: #63766a;
  background: #f0f4f0;
  font-size: 0.75rem;
  font-weight: 750;
}

.navigation-link:hover,
.navigation-link:focus-visible {
  color: #174e38;
  background: #edf5ee;
  transform: translateX(2px);
}

.navigation-link:hover > span,
.navigation-link:focus-visible > span,
.navigation-home > span {
  color: #276241;
  background: #dcecdf;
}

.navigation-home {
  color: #174e38;
  background: #e7f2e8;
}

.brand {
  margin-left: 4px;
  letter-spacing: -0.02em;
}

.page-content {
  width: min(100% - 40px, 1440px);
  margin: 32px auto 64px;
}

.catalog-card,
.auth-card {
  border-color: #e0e8e0;
  border-radius: 18px;
  box-shadow: 0 12px 36px rgb(35 54 43 / 6%);
}

.catalog-card {
  padding: clamp(20px, 3.2vw, 38px);
}

.dashboard-page {
  width: min(100% - 40px, 1440px);
  margin-top: clamp(28px, 5vw, 58px);
}

.dashboard {
  display: grid;
  gap: 28px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.dashboard-heading h1 {
  margin: 8px 0 0;
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  letter-spacing: -0.045em;
}

.dashboard-heading .role-badge {
  margin: 0 0 6px;
}

.eyebrow {
  margin: 0;
  color: #638171;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
}

.department-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.department-card {
  position: relative;
  display: flex;
  min-height: 302px;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(20px, 2.5vw, 30px);
  border: 1px solid #dfe8df;
  border-radius: 18px;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 12px 30px rgb(35 54 43 / 5%);
}

.department-card::after {
  position: absolute;
  top: -50px;
  right: -52px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgb(222 239 223 / 70%);
  content: "";
}

.department-lager::after {
  background: rgb(222 235 244 / 72%);
}

.department-bottling::after {
  background: rgb(248 233 215 / 75%);
}

.department-card-heading,
.department-stats,
.department-link {
  position: relative;
  z-index: 1;
}

.department-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.department-number {
  color: #2b5b43;
  font-size: 1.15rem;
  font-weight: 800;
}

.department-caption {
  color: #728078;
  font-size: 0.78rem;
  font-weight: 650;
}

.department-card h2 {
  margin: 24px 0 7px;
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  letter-spacing: -0.035em;
}

.department-summary {
  min-height: 26px;
  margin: 0;
  color: #6a7970;
  font-size: 0.9rem;
}

.department-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 14px 10px;
  margin: 18px 0 24px;
}

.department-stats div {
  display: grid;
  gap: 3px;
}

.department-stats strong {
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  letter-spacing: -0.04em;
}

.department-stats span {
  color: #718078;
  font-size: 0.72rem;
  line-height: 1.3;
}

.department-stats .department-stat-volume {
  margin-top: 5px;
  color: #335b45;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.department-actions {
  display: grid;
  margin-top: auto;
}

.department-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #edf1ec;
  color: #22563c;
  font-weight: 720;
  text-decoration: none;
}

.department-actions .department-link {
  margin-top: 0;
}

.department-link span {
  font-size: 1.2rem;
  transition: transform 160ms ease;
}

.department-link:hover span {
  transform: translateX(4px);
}

.department-link-secondary {
  color: #64746a;
  font-size: 0.9rem;
  font-weight: 600;
}

.dashboard-today {
  min-height: 0;
}

.dashboard-today-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
  margin-top: 20px;
}

.dashboard-today-group {
  padding: 16px;
  border: 1px solid #e0e8e0;
  border-radius: 12px;
  background: #f8faf8;
  overflow-wrap: anywhere;
}

.dashboard-today-group h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.dashboard-today-group p,
.dashboard-today-group ul {
  margin: 0 0 10px;
  color: #53665b;
  font-size: 0.9rem;
}

.dashboard-today-group ul {
  padding-left: 1.2em;
}

.dashboard-today-group a {
  color: #22563c;
  font-weight: 700;
}

.dashboard-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-shortcuts a {
  display: grid;
  grid-template-columns: 42px 1fr 18px;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid #e0e8e0;
  border-radius: 14px;
  color: #283c31;
  background: rgb(255 255 255 / 82%);
  text-decoration: none;
}

.dashboard-shortcuts a > span:nth-child(2) {
  display: grid;
  gap: 4px;
}

.dashboard-shortcuts small {
  color: #748078;
  font-size: 0.78rem;
}

.shortcut-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: #285d43;
  background: #eaf3e9;
  font-size: 1.2rem;
}

.section-heading {
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section-heading h1 {
  margin: 4px 0 0;
  letter-spacing: -0.035em;
}

.button,
.tank-action-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 680;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

#start-dispensing[hidden] {
  display: none;
}

.button:hover,
.tank-action-button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: #24634d;
}

.button-primary:hover {
  background: #1c503d;
}

.button-secondary {
  color: #2d5140;
  border-color: #d7e3d8;
  background: #f7faf6;
}

.button-secondary:hover {
  background: #eaf2e9;
}

.state-filters {
  flex-wrap: wrap;
  padding-block: 12px 18px;
}

.state-filters a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  border-color: #e0e8df;
  background: #fff;
  font-size: 0.88rem;
  transition: background 120ms ease, color 120ms ease;
}

.state-filters .filter-volume {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eaf2e9;
  color: #355a45;
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
}

.state-filters a.selected .filter-volume {
  background: rgb(255 255 255 / 20%);
  color: #fff;
}

.tank-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 16px;
}

.tank-card {
  border-color: #e0e8e0;
  border-radius: 15px;
  box-shadow: 0 5px 16px rgb(35 54 43 / 4%);
}

.tank-heading h2 {
  font-size: 1.12rem;
}

.state-pill {
  background: #edf4ed;
}

.tank-actions,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tank-action-button {
  min-height: 38px;
  padding: 8px 12px;
  border-color: #dce8dd;
  color: #24573d;
  background: #f1f7f0;
  font-size: 0.86rem;
}

.tank-action-secondary {
  color: #53675b;
  border-color: #e3e9e3;
  background: #fff;
}

.tank-action-warning {
  color: #9c4a31;
  border-color: #f0ddd5;
  background: #fff6f1;
}

.bulk-actions {
  display: grid;
  gap: 9px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #e2eae1;
  border-radius: 14px;
  background: #fafcf9;
}

.allocation-card {
  position: relative;
  padding-top: 20px;
}

.allocation-card > legend {
  padding-right: 110px;
}

.remove-allocation {
  position: absolute;
  top: 10px;
  right: 12px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #eadbd6;
  border-radius: 9px;
  color: #9c4a31;
  background: #fff8f5;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
}

.remove-allocation:hover:not(:disabled),
.remove-allocation:focus-visible {
  background: #fcece6;
}

.remove-allocation:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.remove-bottling-tank {
  position: static;
  grid-column: 1 / -1;
  justify-self: end;
}

.generation-input {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #cbd9ce;
  border-radius: 10px;
  background: #fff;
}

.generation-input > span {
  display: grid;
  min-width: 46px;
  align-self: stretch;
  place-items: center;
  border-right: 1px solid #dfe8df;
  color: #315a43;
  background: #edf5ee;
  font-weight: 800;
}

.generation-input input {
  min-width: 0;
  border: 0;
  box-shadow: none;
}

.generation-input input:focus {
  outline: 0;
}

.yeast-generation-field {
  padding: 12px;
  border: 1px solid #e2eae1;
  border-radius: 12px;
  background: #f7faf6;
}

#generation-fallback:empty {
  display: none;
}

.yeast-generation-field[hidden] {
  display: none;
}

.catalog-form,
.field-group {
  gap: 10px;
}

.catalog-form {
  gap: 18px;
}

.field-group label,
.field-label,
.field-group > label {
  color: #34493c;
  font-size: 0.91rem;
  font-weight: 680;
}

.field-group input:not([type="checkbox"]):not([type="radio"]),
.field-group select,
.field-group textarea,
.catalog-form input:not([type="checkbox"]):not([type="radio"]),
.catalog-form select,
.catalog-form textarea,
.sort-form select,
.sort-form input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #d5e0d6;
  border-radius: 10px;
  color: #20342a;
  background: #fff;
  font: inherit;
}

.sort-form {
  flex-wrap: wrap;
}

.sort-form select,
.sort-form input {
  width: auto;
  flex: 1 1 190px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(53 126 80 / 26%);
  outline-offset: 2px;
}

.brew-details {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.allocation-card {
  border-color: #dfe8df;
  border-radius: 14px;
  background: #fbfcfa;
}

.choice-button-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.choice-button-list ul {
  display: contents;
  margin: 0;
  padding: 0;
  list-style: none;
}

.choice-button-list li {
  display: contents;
}

.choice-button {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid #dce6dc;
  border-radius: 11px;
  color: #43564a;
  background: #fff;
  cursor: pointer;
  user-select: none;
}

.choice-button:has(input:checked) {
  border-color: #32754c;
  color: #1c5537;
  background: #e9f4e9;
  box-shadow: inset 0 0 0 1px #32754c;
}

.choice-button input[type="checkbox"],
.choice-button input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: #287044;
}

.tank-choice {
  min-width: 92px;
  justify-content: center;
}

.tank-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}

.tank-choice-list .tank-choice {
  width: 100%;
  justify-content: flex-start;
}

.beer-style-choice-list .choice-button {
  min-width: 120px;
  justify-content: center;
  font-weight: 650;
}

.beer-style-choice-list input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
}

.beer-style-choice-list .choice-button:has(input:focus-visible) {
  outline: 3px solid #8bb89a;
  outline-offset: 2px;
}

.toggle-choice {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e0e8df;
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
}

.toggle-choice input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  accent-color: #287044;
}

.permission-field-heading h2 {
  margin: 0;
  color: #20342a;
  font-size: 1.15rem;
}

.permission-field-heading p {
  margin: 5px 0 0;
  color: #527362;
  font-size: 0.9rem;
}

.permission-section {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #e0e8df;
  border-radius: 12px;
  background: #f8faf7;
}

.permission-section h3 {
  margin: 0 0 2px;
  color: #34493c;
  font-size: 1rem;
}

.permission-choice-list {
  display: grid;
  gap: 7px;
}

.permission-choice {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e2e9e1;
  border-radius: 9px;
  background: #fff;
  color: #34493c;
  cursor: pointer;
  font-size: 0.93rem;
  font-weight: 500;
}

.permission-choice input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  margin: 0;
  padding: 0;
  accent-color: #287044;
}

.permission-choice span {
  line-height: 1.4;
}

.user-group-choice-list {
  margin-top: 2px;
}

.journal-filter .journal-hidden-toggle input {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  flex: 0 0 20px;
  padding: 0;
}

.conditional-field[hidden],
.completion-field[hidden],
.field-group[hidden] {
  display: none;
}

.fixed-tank-data {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 18px 0 22px;
  padding: 16px;
  border: 1px solid #e0e8df;
  border-radius: 12px;
  background: #f8faf7;
}

.fixed-tank-data span {
  display: grid;
  gap: 3px;
  color: #718077;
  font-size: 0.79rem;
}

.fixed-tank-data strong {
  color: #2c4235;
  font-size: 0.98rem;
}

.fixed-tank-data small {
  flex-basis: 100%;
  color: #78857c;
}

.form-actions {
  position: sticky;
  z-index: 5;
  bottom: 0;
  gap: 10px;
  margin: 8px calc(clamp(20px, 3.2vw, 38px) * -1) calc(clamp(20px, 3.2vw, 38px) * -1);
  padding: 14px clamp(20px, 3.2vw, 38px);
  border-top: 1px solid #e4eae3;
  border-radius: 0 0 18px 18px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 -8px 20px rgb(28 43 33 / 6%);
  backdrop-filter: blur(12px);
}

.back-link {
  margin-top: 22px;
}

.table-wrap {
  border: 1px solid #e1e9e0;
  border-radius: 12px;
}

table {
  background: #fff;
}

thead {
  background: #f4f8f3;
}

th,
td {
  padding: 13px 14px;
}

.journal-entry {
  border-color: #e1e9e0;
  background: #fff;
}

.report-filter {
  align-items: flex-end;
}

.empty-state {
  padding: 20px;
  color: #748078;
  text-align: center;
}

.department-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid #e6dfd4;
  border-radius: 20px;
  background: linear-gradient(120deg, #fff 20%, #fbf2e7);
}

.department-hero::after {
  position: absolute;
  top: -90px;
  right: -40px;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  background: rgb(244 222 190 / 50%);
  content: "";
}

.department-hero > * {
  position: relative;
  z-index: 1;
}

.department-hero h1 {
  margin: 8px 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.05em;
}

.department-hero > p:last-child {
  max-width: 600px;
  color: #6b776f;
}

.bottling-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-top: 20px;
}

.bottling-method-card {
  display: grid;
  min-height: 176px;
  grid-template-columns: 46px 1fr 22px;
  align-items: start;
  gap: 16px;
  padding: 24px;
  border: 1px solid #e2e8de;
  border-radius: 16px;
  color: #273b30;
  background: #fff;
  box-shadow: 0 8px 24px rgb(35 54 43 / 5%);
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.bottling-method-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgb(35 54 43 / 10%);
}

.bottling-method-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  color: #875b2a;
  background: #f7eddf;
  font-size: 0.9rem;
  font-weight: 800;
}

.bottling-method-copy {
  display: grid;
  gap: 9px;
}

.bottling-method-copy strong {
  font-size: 1.2rem;
}

.bottling-method-copy small {
  color: #718078;
  font-size: 0.89rem;
  line-height: 1.5;
}

.bottling-method-arrow {
  color: #875b2a;
  font-size: 1.3rem;
}

.bottling-report-card {
  min-height: auto;
  grid-column: 1 / -1;
  align-items: center;
  background: #fafcf9;
}

.quick-actions .tank-action-button {
  min-height: 42px;
}

.choice-button:focus-within {
  outline: 3px solid rgb(53 126 80 / 26%);
  outline-offset: 2px;
}

.field-group > .field-error {
  margin-top: 0;
}

.form-card > h1,
.catalog-card > h1 {
  letter-spacing: -0.035em;
}

@media (max-width: 600px) {
  .department-hero {
    padding: 24px 20px;
  }

  .bottling-method-card {
    min-height: 148px;
    padding: 18px;
  }

  .bottling-report-card {
    grid-column: auto;
  }
}
@media (max-width: 900px) {
  .department-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .department-bottling {
    grid-column: 1 / -1;
  }

  .dashboard-shortcuts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .site-header {
    min-height: 62px;
    padding-inline: 14px;
  }
}

.account-menu {
  position: relative;
  margin-left: auto;
}

.account-menu > summary {
  list-style: none;
}

.account-menu > summary::-webkit-details-marker {
  display: none;
}

.account-menu-trigger {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 999px;
  color: #fff;
  background: rgb(255 255 255 / 9%);
  cursor: pointer;
}

.account-menu-trigger:hover,
.account-menu[open] .account-menu-trigger {
  background: rgb(255 255 255 / 17%);
}

.account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #214f3a;
  background: #dcefe1;
  font-weight: 800;
}

.account-menu-name {
  max-width: min(32vw, 220px);
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-chevron {
  font-size: 1.1rem;
  transition: transform 150ms ease;
}

.account-menu[open] .account-menu-chevron {
  transform: rotate(180deg);
}

.account-menu-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  width: min(290px, calc(100vw - 24px));
  gap: 4px;
  padding: 8px;
  border: 1px solid #e0e8e1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 42px rgb(19 42 30 / 20%);
}

.account-menu-heading {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-bottom: 1px solid #e8eee8;
  color: #20352a;
}

.account-menu-heading small {
  color: #708078;
}

.account-menu-panel > a,
.account-menu-panel > form > button {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 9px;
  color: #2c4436;
  background: transparent;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu-panel > a:hover,
.account-menu-panel > form > button:hover {
  background: #eff5ef;
}

.account-menu-panel > form {
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid #e8eee8;
}

.account-menu-panel > form > button {
  color: #9c2828;
}

.account-card {
  width: min(100%, 980px);
  margin-inline: auto;
}

.user-table-wrap {
  margin: 20px 0;
  overflow-x: auto;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.user-table th,
.user-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #e5ebe5;
  vertical-align: middle;
}

.user-table th {
  color: #627268;
  font-size: 0.85rem;
}

.user-actions {
  display: flex;
  gap: 8px;
}

.user-actions .button {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 0.9rem;
  text-decoration: none;
}

.user-status {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 650;
}

.user-status.is-active {
  color: #245c3c;
  background: #e6f3e8;
}

.user-status.is-inactive {
  color: #85422d;
  background: #f9ece5;
}

.account-return {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  text-decoration: none;
}

@media (max-width: 600px) {
  .account-menu-name {
    max-width: 32vw;
  }

  .user-table {
    min-width: 700px;
  }
}

.technical-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px;
  margin: 22px 0;
}

.technical-menu-card {
  display: grid;
  min-height: 148px;
  align-content: start;
  gap: 10px;
  padding: 20px;
  border: 1px solid #e2e8de;
  border-radius: 16px;
  color: #273b30;
  background: #fff;
  text-decoration: none;
  box-shadow: 0 8px 24px rgb(35 54 43 / 5%);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.technical-menu-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgb(35 54 43 / 10%);
}

.technical-menu-card > span {
  color: #7b8b7f;
  font-size: 0.8rem;
  font-weight: 800;
}

.technical-menu-card strong {
  font-size: 1.1rem;
}

.technical-menu-card small {
  color: #718078;
  line-height: 1.5;
}

.operation-warning {
  padding: 18px;
  border: 1px solid #e6c77e;
  border-radius: 14px;
  color: #583d12;
  background: #fff8e7;
}

.operation-warning > .form-actions,
.operation-success + .form-actions {
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.operation-success {
  padding: 18px;
  border: 1px solid #a7d2ad;
  border-radius: 14px;
  color: #205a32;
  background: #eff9f0;
}

.operation-success p {
  margin: 8px 0 0;
}

.operation-warning ul {
  margin: 10px 0 16px;
  padding-left: 22px;
}

.operation-warning li + li {
  margin-top: 6px;
}

@media (max-width: 600px) {
  .navigation-drawer {
    width: min(370px, 92vw);
  }

  .page-content,
  .dashboard-page {
    width: min(100% - 20px, 1440px);
    margin: 16px auto 40px;
  }

  .catalog-card {
    padding: 18px 14px;
    border-radius: 15px;
  }

  .dashboard {
    gap: 18px;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-heading h1 {
    font-size: 1.85rem;
  }

  .department-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .department-bottling {
    grid-column: auto;
  }

  .department-card {
    min-height: 280px;
    padding: 20px;
  }

  .department-stats {
    margin: 18px 0 20px;
  }

  .section-heading {
    gap: 10px;
  }

  .section-heading > .form-actions,
  .section-heading > .button {
    width: 100%;
  }

  .section-heading > .form-actions {
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .state-filters {
    flex-wrap: nowrap;
    margin-inline: -4px;
    padding: 8px 4px 14px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .state-filters a {
    flex: 0 0 auto;
  }

  .tank-grid {
    grid-template-columns: 1fr;
  }

  .sort-form,
  .report-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-form select,
  .sort-form input {
    width: 100%;
    flex: none;
  }

  .sort-form .button {
    width: 100%;
  }

  .form-actions {
    margin: 8px -14px -18px;
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
  }

  .form-actions .button {
    flex: 1 1 auto;
  }

  .allocation-card {
    padding: 14px 10px;
  }

  .choice-button {
    min-height: 46px;
  }

  .tank-choice-list {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  }

  .tank-choice-list .tank-choice {
    padding-inline: 8px;
    font-size: 0.86rem;
  }

  .journal-entry {
    flex-direction: column;
  }

  .operation-controls {
    justify-items: start;
  }
}
