:root {
  --bg: #0f0f10;
  --bg-soft: #1a1a1c;
  --panel: #1f1f22;
  --text: #f4f4f4;
  --muted: #b8b8bc;
  --accent: #f1b54a;
  --accent-strong: #e29d1d;
  --danger: #c6383f;
  --warn: #b88912;
  --ok: #2f8c44;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  min-height: 100dvh;
}

.screen {
  min-height: 100dvh;
  padding: 20px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-screen {
  justify-content: center;
}

.home-header {
  text-align: center;
  margin-bottom: 10px;
}

.kicker {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

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

h1 {
  font-size: 2rem;
  line-height: 1.1;
}

h2 {
  font-size: 1.15rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #1b1306;
}

.btn-secondary {
  background: var(--bg-soft);
  border: 1px solid #2c2c2f;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #343438;
  color: var(--muted);
}

.btn-xl {
  min-height: 64px;
  font-size: 1.1rem;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid #35353a;
  background: #141417;
  color: var(--text);
  padding: 10px 12px;
  font-size: 1rem;
}

.items-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.item-group {
  background: #161619;
  border: 1px solid #2d2d31;
  border-radius: 12px;
  padding: 10px;
}

.item-group h3 {
  color: var(--accent);
  margin-bottom: 8px;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #2b2b30;
}

.item-row:first-of-type {
  border-top: 0;
}

.delete-btn {
  min-height: 40px;
  min-width: 84px;
  background: rgba(198, 56, 63, 0.2);
  color: #ffb8bc;
  border: 1px solid rgba(198, 56, 63, 0.5);
  border-radius: 10px;
}

.status {
  color: var(--muted);
  font-size: 0.95rem;
}

.status.error {
  color: #ffb8bc;
}

.status.success {
  color: #b3f2c0;
}

.centered {
  text-align: center;
}

.stocktake-page,
.stocktake-screen {
  overflow: hidden;
}

.stocktake-screen {
  justify-content: center;
}

.stock-card {
  min-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px;
}

.stock-card-top {
  display: flex;
  justify-content: flex-end;
}

.exit-btn {
  width: auto;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 0.95rem;
}

.card-category {
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.card-item {
  text-align: center;
  font-size: 2rem;
  line-height: 1.15;
  margin: auto 0;
}

.card-progress {
  text-align: center;
  color: var(--muted);
}

.card-actions {
  margin-top: auto;
}

.btn-out {
  background: var(--danger);
}

.btn-low {
  background: var(--warn);
}

.btn-enough {
  background: var(--ok);
}

.results-screen {
  height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 20px;
}

.result-section {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-group {
  background: #17171b;
  border-radius: 10px;
  padding: 10px;
}

.result-group strong {
  color: var(--accent);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-card {
  background: #17171b;
  border: 1px solid #2c2c31;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-card h2 {
  font-size: 1rem;
}

.history-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-section h3 {
  color: var(--accent);
  font-size: 0.95rem;
}

.history-line {
  font-size: 0.95rem;
  color: var(--text);
}

.history-line strong {
  color: var(--accent);
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 20;
}

.confirm-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid #313136;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.confirm-card p {
  color: var(--muted);
}