:root {
  color-scheme: light;
  --bg: #f4f1ec;
  --panel: #ffffff;
  --ink: #1d2525;
  --muted: #67706f;
  --line: #d9ded9;
  --accent: #0e7c66;
  --accent-strong: #095a4b;
  --warn: #b45f06;
  --danger: #b3261e;
  --shadow: 0 14px 32px rgba(29, 37, 37, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0 14px;
}

button:hover {
  border-color: var(--accent);
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #eef3ef;
  padding: 24px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

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

h1 {
  font-size: 22px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 18px;
}

h4 {
  margin: 0;
  font-size: 14px;
}

.brand p,
.hint,
.eyebrow,
#user-role {
  color: var(--muted);
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-panel,
.user-panel,
.panel,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel,
.user-panel,
.panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.hint {
  font-size: 13px;
  line-height: 1.45;
}

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

.auth-widget {
  min-height: 42px;
  display: flex;
  align-items: center;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.nav-button {
  justify-content: flex-start;
  text-align: left;
}

.nav-button.is-active {
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 700;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

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

.notice {
  margin-bottom: 18px;
  padding: 12px 14px;
  color: var(--accent-strong);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
  align-items: start;
}

.items-grid {
  display: grid;
  gap: 14px;
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
}

.request-category,
.delivery-category {
  display: grid;
  gap: 8px;
}

.item-row,
.request-card,
.compact-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.item-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.item-row:has(input[type="checkbox"]:checked) {
  border-color: var(--accent);
  background: #eef8f1;
}

.item-row:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.item-row input[type="checkbox"],
.purchase-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.item-meta {
  display: grid;
  gap: 6px;
}

.item-name {
  color: var(--ink);
  font-weight: 700;
}

.item-category,
.request-meta,
.status-pill {
  color: var(--muted);
  font-size: 12px;
}

.list {
  display: grid;
  gap: 10px;
}

.request-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.request-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.request-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
}

.status-pill.is-closed {
  color: var(--muted);
  text-decoration: line-through;
  background: #f1f3f1;
}

.purchase-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.delivery-card {
  padding: 0;
  overflow: hidden;
}

.delivery-summary {
  display: flex;
  width: 100%;
  min-height: 56px;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 0;
  text-align: left;
  background: #fbfcfb;
}

.delivery-summary span:first-child {
  display: grid;
  gap: 4px;
}

.delivery-summary small {
  color: var(--muted);
}

.delivery-details {
  display: grid;
  gap: 14px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.delivery-items {
  display: grid;
  gap: 8px;
}

.delivery-item {
  position: relative;
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 48px;
  justify-items: start;
  text-align: left;
  background: #fff;
}

.delivery-item small {
  color: var(--muted);
}

.delivery-item.is-delivered {
  border-color: var(--accent);
  background: #e9f7ee;
}

.delivered-flash {
  position: absolute;
  right: 10px;
  top: 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 4px 8px;
  font-size: 12px;
  animation: delivered-flash 900ms ease forwards;
}

@keyframes delivered-flash {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  20%,
  70% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.compact-row small {
  color: var(--muted);
}

.admin-list-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selectable-row {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  text-align: left;
  color: var(--ink);
  background: #fbfcfb;
}

.selectable-row:hover,
.selectable-row.is-selected {
  border-color: var(--accent);
  background: #f1f8f3;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .shell,
  .two-column,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    padding: 16px;
  }
}
