:root {
  --bg: #f3f7f8;
  --surface: #fbfdfe;
  --surface-strong: #ffffff;
  --ink: #121b20;
  --muted: #66747a;
  --line: #d9e3e5;
  --accent: #1f8077;
  --accent-dark: #0b5c55;
  --accent-soft: #ddf3ef;
  --gold: #b98633;
  --danger: #b64a42;
  --danger-soft: #f6e1dd;
  --warning-soft: #fff0c8;
  --warning: #7c5b16;
  --night: #142235;
  --shadow: 0 18px 50px rgba(18, 27, 32, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(145deg, rgba(31, 128, 119, 0.12), rgba(31, 128, 119, 0) 360px),
    linear-gradient(225deg, rgba(185, 134, 51, 0.12), rgba(185, 134, 51, 0) 380px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 52px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 58px;
  padding: 9px max(16px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(251, 253, 254, 0.78);
  box-shadow: 0 12px 34px rgba(18, 27, 32, 0.06);
  backdrop-filter: blur(20px) saturate(140%);
}

.brand {
  display: none;
  flex: 0 0 auto;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--accent-dark);
}

.nav {
  display: flex;
  width: min(1120px, 100%);
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

.nav a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  white-space: nowrap;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav a:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.user-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  white-space: nowrap;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.view-switcher {
  display: inline-flex;
  align-items: end;
  gap: 6px;
  padding: 3px;
  border: 1px solid rgba(47, 117, 108, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 8px 18px rgba(18, 27, 32, 0.06);
  backdrop-filter: blur(16px);
}

.view-switcher label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.view-switcher select {
  min-height: 32px;
  width: auto;
  min-width: 174px;
  padding: 5px 28px 5px 10px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  text-transform: none;
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 13px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 28px;
  align-items: stretch;
  min-height: 440px;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(31, 128, 119, 0.1), rgba(185, 134, 51, 0.08)),
    var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero h1,
.page-title h1 {
  max-width: 760px;
  margin: 0;
  font-size: 44px;
  line-height: 1.08;
}

.hero p,
.page-title p {
  max-width: 700px;
  color: var(--muted);
  font-size: 18px;
}

.hero-panel {
  display: flex;
  align-items: end;
}

.hero-actions,
.admin-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button.primary {
  background: linear-gradient(135deg, #1f8077, #45aa9c 62%, #c6923a);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(31, 128, 119, 0.24);
}

.button.primary:hover {
  background: linear-gradient(135deg, #176d65, #39998d 62%, #b98633);
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(31, 128, 119, 0.3);
}

.button.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(18, 27, 32, 0.06);
  backdrop-filter: blur(12px);
}

.button.danger {
  border-color: rgba(182, 74, 66, 0.2);
  background: rgba(246, 225, 221, 0.88);
  color: var(--danger);
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 3px solid rgba(70, 163, 149, 0.24);
  outline-offset: 2px;
}

.button.small {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1;
}

.button.full {
  width: 100%;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.section,
.page-title,
.two-columns,
.detail-layout,
.auth-page,
.table-wrap,
.settings-form,
.form-grid {
  margin-top: 22px;
}

.compact-title {
  display: block;
}

.compact-title h1 {
  font-size: 34px;
}

.filter-panel {
  margin-top: 16px;
}

.filter-panel summary {
  display: none;
}

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

.section-heading h2,
.info-block h2,
.form-card h1,
.form-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.section-heading a {
  color: var(--accent);
  font-weight: 700;
}

.swatch-row,
.swatch-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.swatch-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 6px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.swatch-card small {
  grid-column: 2;
  color: var(--muted);
}

.swatch {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 50%;
}

.two-columns,
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.5fr);
  gap: 24px;
  align-items: start;
}

.auth-page {
  display: grid;
  min-height: calc(100svh - 68px);
  place-items: center;
}

.auth-body {
  min-height: 100svh;
  background: #071015;
  overflow-x: hidden;
}

.auth-body .site-header {
  position: fixed;
  right: 0;
  left: 0;
  border-bottom-color: rgba(255, 255, 255, 0.14);
  background: rgba(7, 16, 21, 0.34);
  box-shadow: none;
}

.auth-body .brand {
  color: #ffffff;
}

.auth-body main {
  width: 100%;
  min-height: 100svh;
  padding: 0;
}

.auth-body .auth-page {
  margin-top: 0;
}

.login-shell {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 100svh;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 450px);
  gap: clamp(28px, 6vw, 96px);
  align-items: center;
  padding: clamp(96px, 12vw, 150px) max(22px, calc((100vw - 1120px) / 2)) clamp(36px, 7vw, 80px);
  background-image:
    linear-gradient(90deg, rgba(4, 11, 16, 0.82), rgba(4, 11, 16, 0.3) 46%, rgba(4, 11, 16, 0.72)),
    var(--login-image-desktop);
  background-position: center;
  background-size: cover;
}

.login-shell,
.login-form-panel {
  min-width: 0;
}

.login-copy {
  position: relative;
  max-width: 620px;
  color: #ffffff;
}

.login-copy .eyebrow {
  color: #ffd27a;
}

.login-copy h1 {
  margin: 0;
  max-width: 620px;
  font-size: clamp(46px, 7vw, 86px);
  line-height: 1.04;
  text-wrap: balance;
}

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  width: min(100%, 430px);
  justify-self: end;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(247, 253, 250, 0.18);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

.login-form-panel label {
  min-width: 0;
  color: rgba(255, 255, 255, 0.78);
}

.login-form-panel h2 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.12;
  color: #ffffff;
}

.login-form-panel .eyebrow {
  color: #ffd27a;
}

.login-form-panel input {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.login-form-panel input:focus {
  border-color: rgba(122, 229, 211, 0.9);
  outline: 3px solid rgba(122, 229, 211, 0.22);
}

.login-form-panel input:-webkit-autofill {
  -webkit-text-fill-color: #ffffff;
  transition: background-color 9999s ease-out;
}

.form-card,
.detail-main,
.table-wrap,
.toolbar,
.form-grid,
.settings-form,
.stat-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.form-card,
.detail-main,
.settings-form {
  padding: 24px;
}

.form-card {
  width: min(100%, 430px);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(47, 117, 108, 0.72);
  outline: 3px solid rgba(47, 117, 108, 0.14);
}

textarea {
  resize: vertical;
}

.form-card form,
.settings-form {
  display: grid;
  gap: 16px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 220px 180px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
}

.filter-toolbar {
  grid-template-columns: repeat(14, minmax(0, 1fr));
}

.filter-toolbar .search-field {
  grid-column: span 3;
}

.filter-toolbar .select-field,
.filter-toolbar .sort-field {
  grid-column: span 2;
}

.filter-toolbar .price-field {
  grid-column: span 2;
}

.filter-toolbar .button {
  grid-column: span 1;
  align-self: end;
  justify-self: stretch;
  min-width: 0;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.item-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  width: 100%;
  min-height: 210px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 252, 0.92)),
    var(--surface);
  box-shadow: 0 10px 30px rgba(18, 27, 32, 0.07);
  min-width: 0;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.item-card:hover {
  border-color: rgba(47, 117, 108, 0.36);
  box-shadow: 0 16px 34px rgba(18, 27, 32, 0.12);
  transform: translateY(-2px);
}

.item-card:focus-visible {
  outline: 3px solid rgba(31, 128, 119, 0.2);
  outline-offset: 3px;
}

.item-card h2,
.detail-main h1 {
  margin: 0;
  line-height: 1.18;
}

.item-card h2 {
  min-height: 46px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.item-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.category,
.status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.category {
  background: #edf2f4;
  color: #526158;
  max-width: 56%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-available {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-partial {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-reserved {
  background: #e5e0f3;
  color: #4e4276;
}

.status-bought {
  background: #e1ecd7;
  color: #46622d;
}

.status-not_purchased {
  background: var(--danger-soft);
  color: var(--danger);
}

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

.item-card .meta-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item-card .meta-list .price-meta {
  grid-column: 1 / -1;
}

.meta-list.wide {
  grid-template-columns: repeat(4, 1fr);
  margin: 20px 0;
}

.meta-list div {
  padding: 9px;
  border: 1px solid rgba(47, 117, 108, 0.08);
  border-radius: 8px;
  background: rgba(221, 243, 239, 0.44);
  min-width: 0;
}

.meta-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.meta-list dd {
  margin: 4px 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.item-card .meta-list .price-meta dd {
  font-size: 16px;
}

.item-card-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  min-width: 0;
}

.open-chip {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.item-color-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.color-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 24px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.color-chip {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.detail-colors {
  margin-top: 10px;
}

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

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--accent);
  font-weight: 700;
}

.info-block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.sticky-card {
  position: sticky;
  top: 92px;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 13px;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.actions form {
  margin: 0;
}

.actions .button {
  border-radius: 999px;
  white-space: nowrap;
}

.admin-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.admin-item-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 252, 0.92)),
    var(--surface);
  box-shadow: 0 12px 32px rgba(18, 27, 32, 0.08);
}

.admin-item-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.admin-meta-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.admin-meta-list div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(31, 128, 119, 0.08);
  border-radius: 8px;
  background: rgba(221, 243, 239, 0.42);
}

.admin-meta-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-meta-list dd {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.reservation-note {
  padding: 9px 10px;
  border: 1px solid rgba(31, 128, 119, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
}

.reservation-note strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
}

.item-inactive-note {
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.inline-user-form {
  display: grid;
  min-width: 520px;
  grid-template-columns: minmax(130px, 1fr) minmax(170px, 1fr) 96px auto;
  gap: 8px;
  align-items: center;
}

.compact-check {
  min-height: 42px;
  align-content: center;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-grid.compact {
  width: 100%;
  grid-template-columns: repeat(2, 1fr);
}

.stat-grid > div {
  padding: 18px;
}

.stat-grid strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
}

.stat-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ops-dashboard {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(18, 79, 90, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(218, 239, 237, 0.9), rgba(255, 255, 255, 0.94)),
    var(--surface);
  box-shadow: 0 12px 28px rgba(18, 27, 32, 0.07);
}

.ops-dashboard-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.ops-dashboard-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.ops-dashboard-head p {
  margin: 0;
  font-size: 13px;
}

.ops-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.ops-kpi {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(31, 128, 119, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.ops-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ops-kpi strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.ops-kpi small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ops-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

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

.ops-status-card {
  padding: 10px;
  border: 1px solid rgba(31, 128, 119, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.ops-status-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.ops-status-top span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ops-status-top strong {
  font-size: 16px;
}

.ops-meter {
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(18, 27, 32, 0.09);
  overflow: hidden;
}

.ops-meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
}

.ops-meter.available span {
  background: linear-gradient(90deg, #2f978d, #5db4ac);
}

.ops-meter.reserved span {
  background: linear-gradient(90deg, #cb9f55, #debe7f);
}

.ops-meter.bought span {
  background: linear-gradient(90deg, #2f7d4d, #58a96f);
}

.ops-meter.not-purchased span {
  background: linear-gradient(90deg, #b15d57, #d18780);
}

.ops-category-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(31, 128, 119, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.ops-category-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.ops-category-head h3 {
  margin: 0;
  font-size: 18px;
}

.ops-category-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.ops-category-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.5fr) repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(18, 27, 32, 0.08);
  background: rgba(248, 251, 252, 0.84);
}

.ops-category-row-head {
  border-style: dashed;
  background: rgba(226, 240, 238, 0.64);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ops-category-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.ops-category-row span:first-child {
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
}

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

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

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

.color-editor {
  display: grid;
  gap: 12px;
}

.color-row {
  display: grid;
  grid-template-columns: 62px minmax(140px, 0.7fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.color-row input[type="color"] {
  padding: 4px;
}

.flash-wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto 0;
}

.flash {
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.flash-success {
  border-color: #b9d8ce;
  background: #e7f3ef;
}

.flash-error {
  border-color: #e1aaa6;
  background: #f8e5e2;
}

@media (max-width: 840px) {
  .site-header {
    position: sticky;
    align-items: center;
    flex-direction: row;
    gap: 8px;
    min-height: 52px;
    padding: 7px 8px;
  }

  .nav {
    flex: 1;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .brand {
    display: none;
  }

  .nav a,
  .user-pill {
    min-height: 32px;
    padding: 6px 7px;
    font-size: 11.5px;
  }

  .view-switcher {
    flex: 0 0 auto;
    padding: 2px;
  }

  .view-switcher label {
    font-size: 0;
  }

  .view-switcher select {
    min-height: 30px;
    min-width: 104px;
    max-width: 110px;
    padding: 4px 24px 4px 8px;
    font-size: 11.5px;
  }

  .view-switcher .button {
    display: none;
  }

  .hero,
  .two-columns,
  .detail-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
    align-content: end;
    gap: 28px;
    padding: 104px 18px 24px;
    background-image:
      linear-gradient(180deg, rgba(4, 11, 16, 0.32), rgba(4, 11, 16, 0.42) 36%, rgba(4, 11, 16, 0.9)),
      var(--login-image-mobile);
    background-position: center;
  }

  .login-copy {
    align-self: end;
    max-width: 520px;
  }

  .login-copy h1 {
    font-size: 42px;
  }

  .login-form-panel {
    width: min(100%, 460px);
    justify-self: stretch;
  }

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

  .filter-toolbar .search-field,
  .filter-toolbar .select-field,
  .filter-toolbar .price-field,
  .filter-toolbar .sort-field,
  .filter-toolbar .button {
    grid-column: span 1;
  }

  .filter-toolbar .button {
    justify-self: stretch;
  }

  .hero {
    min-height: 0;
    padding: 28px;
  }

  .hero h1,
  .page-title h1 {
    font-size: 34px;
  }

  .meta-list,
  .meta-list.wide,
  .stat-grid,
  .stat-grid.compact {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .ops-category-row {
    grid-template-columns: minmax(120px, 1.2fr) repeat(6, minmax(72px, 1fr));
  }

  .sticky-card {
    position: static;
  }

  .inline-user-form {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .admin-item-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .color-row {
    grid-template-columns: 54px 1fr;
  }

  .color-row .button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  main {
    width: 100%;
    padding: 14px 12px 42px;
  }

  .site-footer,
  .flash-wrap {
    width: calc(100% - 24px);
  }

  .auth-body main {
    width: 100%;
  }

  .auth-body .flash-wrap {
    width: calc(100% - 20px);
  }

  .login-shell {
    min-height: 100svh;
    gap: 18px;
    padding: 34px 12px 28px;
  }

  .hero,
  .form-card,
  .detail-main,
  .settings-form {
    padding: 18px;
  }

  .hero h1,
  .page-title h1 {
    font-size: 28px;
  }

  .login-copy {
    max-width: 340px;
  }

  .login-copy h1 {
    font-size: 34px;
  }

  .login-form-panel {
    width: 100%;
    padding: 20px;
  }

  .login-form-panel h2 {
    font-size: 25px;
  }

  .toolbar,
  .filter-toolbar {
    grid-template-columns: 1fr;
  }

  .page-title {
    margin-top: 12px;
  }

  .page-title p {
    margin-bottom: 5px;
    font-size: 12px;
  }

  .compact-title {
    display: block;
  }

  .user-pill {
    display: none;
  }

  .filter-toolbar .search-field,
  .filter-toolbar .select-field,
  .filter-toolbar .price-field,
  .filter-toolbar .sort-field,
  .filter-toolbar .button {
    grid-column: 1;
  }

  .filter-panel {
    margin-top: 10px;
  }

  .filter-panel summary {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 20px rgba(18, 27, 32, 0.06);
    color: var(--accent-dark);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
  }

  .filter-panel summary::after {
    content: "+";
    font-size: 16px;
  }

  .filter-panel[open] summary::after {
    content: "-";
  }

  .filter-panel .toolbar {
    margin-top: 8px;
    padding: 10px;
  }

  .item-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
    width: 100%;
  }

  .item-card {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    padding: 12px;
  }

  .item-card h2 {
    min-height: 0;
    font-size: 17px;
  }

  .category,
  .status {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 11px;
  }

  .item-card-head {
    justify-content: flex-start;
  }

  .category {
    max-width: 100%;
  }

  .open-chip {
    display: none;
  }

  .meta-list,
  .meta-list.wide {
    grid-template-columns: 1fr;
  }

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

  .admin-actions {
    gap: 7px;
    margin-top: 14px;
  }

  .admin-actions .button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .stat-grid {
    gap: 8px;
  }

  .stat-grid > div {
    padding: 12px;
  }

  .stat-grid strong {
    font-size: 22px;
  }

  .ops-dashboard {
    margin-top: 10px;
    padding: 12px;
  }

  .ops-dashboard-head h2 {
    font-size: 19px;
  }

  .ops-kpi-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ops-kpi strong {
    font-size: 21px;
  }

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

  .ops-status-top strong {
    font-size: 14px;
  }

  .ops-category-panel {
    padding: 10px;
  }

  .ops-category-row-head {
    display: none;
  }

  .ops-category-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 10px;
  }

  .ops-category-row span {
    display: grid;
    gap: 2px;
    font-size: 12px;
  }

  .ops-category-row span::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .ops-category-row span:first-child {
    grid-column: 1 / -1;
    font-size: 14px;
  }

  .admin-item-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
  }

  .admin-item-card {
    padding: 12px;
  }

  .admin-item-card h2 {
    font-size: 17px;
  }

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

  .actions {
    gap: 6px;
  }

  .actions .button {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 11px;
  }
}
