:root {
  --ink: #1c2420;
  --muted: #5b6a63;
  --paper: #f4f1ea;
  --card: #fffaf2;
  --line: rgba(28, 36, 32, 0.12);
  --lake: #1f6b73;
  --lake-deep: #0f3d44;
  --amber: #c9852c;
  --danger: #9b2c2c;
  --font: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #eef2ec, var(--paper));
  min-height: 100vh;
}
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a5a32;
}
.hint { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.error { color: var(--danger); margin: 0.5rem 0 0; }
.ok { color: #1b6b3a; margin: 0.5rem 0 0; }

.btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--lake-deep); border-color: var(--lake-deep); color: #fff; }
.btn.danger { background: #fff5f5; border-color: #e8b4b4; color: var(--danger); }
.btn.ghost { background: transparent; }

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background:
    radial-gradient(700px 360px at 10% 0%, rgba(31, 107, 115, 0.14), transparent 60%),
    radial-gradient(560px 300px at 100% 100%, rgba(201, 133, 44, 0.12), transparent 55%),
    linear-gradient(180deg, #eef2ec, var(--paper));
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem;
  display: grid;
  gap: 0.85rem;
  box-shadow: 0 18px 40px rgba(15, 40, 36, 0.12);
}
.login-card h1 { margin: 0; font-size: clamp(1.35rem, 5vw, 1.6rem); line-height: 1.15; }
.login-card > .muted { margin: 0; font-size: 0.92rem; line-height: 1.45; }
.login-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.15rem;
}
.login-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}
.login-card label,
.editor-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.login-card input {
  font-size: 16px;
  min-height: 48px;
}
textarea { resize: vertical; }

@media (max-width: 520px) {
  .login-screen {
    align-items: center;
    place-items: center;
    padding: 0.85rem;
  }
  .login-card {
    width: 100%;
    border-radius: 16px;
    padding: 1.25rem 1.1rem;
    align-content: start;
    gap: 0.75rem;
  }
  .login-card .hint {
    font-size: 0.8rem;
    line-height: 1.4;
    word-break: break-word;
  }
  .header-actions {
    width: 100%;
  }
  .header-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
    text-decoration: none;
  }
  .admin-header {
    flex-direction: column;
    align-items: stretch;
  }
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.9);
  position: sticky;
  top: 0;
  z-index: 5;
}
.header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.admin-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  min-height: calc(100vh - 64px);
}

.list-pane {
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.55);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
}
.list-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.drink-list {
  overflow: auto;
  padding: 0.5rem;
  display: grid;
  gap: 0.35rem;
  align-content: start;
}
.drink-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 0.45rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.drink-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: #d9e2dc;
}
.drink-item strong { display: block; font-size: 0.92rem; }
.drink-item span { color: var(--muted); font-size: 0.75rem; }
.drink-item.active,
.drink-item:hover {
  background: var(--card);
  border-color: var(--line);
}

.editor-pane { padding: 1rem; }
.editor-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.editor-top h2 { margin: 0; font-size: 1.35rem; }
.editor-actions { display: flex; gap: 0.5rem; }
.editor-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}
.fields { display: grid; gap: 0.75rem; }
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.check {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  grid-template-columns: none !important;
}
.check input { width: auto; }

.image-pane {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem;
  display: grid;
  gap: 0.7rem;
  align-content: start;
}
.image-pane .label { margin: 0; font-weight: 700; }
.image-preview {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: #e7ebe4;
  display: grid;
  place-items: center;
}
.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.empty-editor {
  display: grid;
  place-items: center;
  min-height: 50vh;
  text-align: center;
}

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .list-pane { max-height: 280px; border-right: 0; border-bottom: 1px solid var(--line); }
  .editor-grid { grid-template-columns: 1fr; }
}

.subs-pane { padding: 1rem; }
.subs-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.subs-toolbar h2 { margin: 0; font-size: 1.35rem; }
.subs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 1rem;
  min-height: 60vh;
}
.subs-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,250,242,0.55);
  overflow: auto;
  max-height: calc(100vh - 140px);
  padding: 0.5rem;
  display: grid;
  gap: 0.35rem;
  align-content: start;
}
.subs-detail {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 1rem;
}
@media (max-width: 900px) {
  .subs-layout { grid-template-columns: 1fr; }
  .subs-list { max-height: 240px; }
}

.stock-pane { padding: 1rem; }
.stock-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(260px, 0.9fr);
  gap: 1rem;
  align-items: start;
}
.stock-catalog, .stock-results {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 1rem;
  max-height: calc(100vh - 160px);
  overflow: auto;
}
.stock-cat { margin-bottom: 1.25rem; }
.stock-cat h3 { margin: 0 0 0.55rem; font-size: 1rem; }
.stock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.9rem;
}
.stock-row select {
  width: auto;
  min-width: 96px;
  padding: 0.4rem 0.55rem;
}
.stock-drink-cat { margin-bottom: 0.85rem; }
.stock-drink-cat h4 { margin: 0 0 0.35rem; }
.stock-drink-cat ul, .almost-list, .stock-menu-cat ul {
  margin: 0;
  padding-left: 1.1rem;
}
.stock-menu-cat { margin-bottom: 0.45rem; }
@media (max-width: 900px) {
  .stock-layout { grid-template-columns: 1fr; }
  .stock-catalog, .stock-results { max-height: none; }
}
