:root {
  color-scheme: dark;
  --bg-0: #040c09;
  --surface-1: rgba(12, 28, 20, 0.98);
  --surface-2: rgba(255, 255, 255, 0.04);
  --border: rgba(56, 140, 90, 0.22);
  --border-strong: rgba(56, 140, 90, 0.35);
  --text: rgba(255, 255, 255, 0.95);
  --muted: rgba(255, 255, 255, 0.52);
  --accent: #2eb872;
  --accent-2: #1e8f5a;
  --accent-soft: rgba(46, 184, 114, 0.18);
  --danger: #f07178;
  --warn: #f1c86a;
  --status-ok: #3ee88a;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--bg-0);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.5;
}

.bg-blob-a {
  width: min(440px, 72vw);
  height: min(440px, 72vw);
  left: -10%;
  top: 8%;
  background: radial-gradient(circle, rgba(46, 184, 114, 0.34), transparent 68%);
  animation: blob-drift-a 24s ease-in-out infinite;
}

.bg-blob-b {
  width: min(380px, 58vw);
  height: min(380px, 58vw);
  right: -8%;
  bottom: 12%;
  background: radial-gradient(circle, rgba(30, 143, 90, 0.26), transparent 70%);
  animation: blob-drift-b 28s ease-in-out infinite;
}

.bg-blob-c {
  width: min(300px, 48vw);
  height: min(300px, 48vw);
  left: 36%;
  top: 52%;
  background: radial-gradient(circle, rgba(120, 220, 160, 0.16), transparent 72%);
  animation: blob-drift-c 20s ease-in-out infinite;
}

@keyframes blob-drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 7%) scale(1.05); }
}

@keyframes blob-drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6%, -4%) scale(1.03); }
}

@keyframes blob-drift-c {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(3%, -5%); }
}

body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(280px, 52vw);
  height: min(280px, 52vw);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20role%3D%22img%22%20aria-hidden%3D%22true%22%3E%3Cpath%20fill%3D%22%232eb872%22%20fill-opacity%3D%220.14%22%20d%3D%22M20%2011c-.2%200-.4%200-.5.1L17.4%209H20V6l-3.7%201.9L13.4%205H9v2h3.6l2%202H11l-4%202l-2-2H0v2h4c-2.2%200-4%201.8-4%204s1.8%204%204%204s4-1.8%204-4l2%202h3l3.5-6.1l1%201c-.9.7-1.5%201.9-1.5%203.1c0%202.2%201.8%204%204%204s4-1.8%204-4s-1.8-4-4-4M4%2017c-1.1%200-2-.9-2-2s.9-2%202-2s2%20.9%202%202s-.9%202-2%202m16%200c-1.1%200-2-.9-2-2s.9-2%202-2s2%20.9%202%202s-.9%202-2%202%22/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 0.75rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100vh;
}

@keyframes brand-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

#edavoda-portal .top-brand {
  text-align: center !important;
  font-size: clamp(1.05rem, 5.8vw, 1.72rem) !important;
  font-weight: 500 !important;
  letter-spacing: 0.32em !important;
  text-indent: 0.16em !important;
  text-transform: uppercase !important;
  margin: 0.35rem 0 0.15rem !important;
  padding-left: 0.32em !important;
  width: 100%;
  display: block;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(46, 184, 114, 0.45) 22%,
    rgba(210, 255, 228, 0.95) 48%,
    rgba(46, 184, 114, 0.5) 78%,
    rgba(255, 255, 255, 0.18) 100%
  );
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  animation: brand-shimmer 9s ease-in-out infinite !important;
}

.session-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.88rem;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(12, 28, 20, 0.55);
  backdrop-filter: blur(12px);
}

.container { flex: 1; width: 100%; }

.footer {
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.04em;
  margin-top: auto;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tagline, .lead {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 36rem;
}

.card {
  background: rgba(12, 28, 20, 0.48);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 12px;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  color: rgba(210, 255, 228, 0.96);
}

.card.narrow { max-width: 440px; margin-inline: auto; }
.card.muted { color: var(--muted); }

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 4px 0;
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

@keyframes btn-shimmer {
  0%, 100% { background-position: 12% 40%; }
  50% { background-position: 88% 60%; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
}

.btn-lg {
  padding: 14px 18px;
  font-size: 1rem;
  width: 100%;
  min-height: 48px;
}

.btn-sm { padding: 8px 10px; font-size: 0.85rem; }

.btn-primary {
  color: #fff !important;
  border: 1px solid var(--border);
  background: linear-gradient(
    125deg,
    var(--accent-2) 0%,
    var(--accent) 35%,
    #3bdc8f 52%,
    var(--accent) 68%,
    var(--accent-2) 100%
  );
  background-size: 220% 220%;
  animation: btn-shimmer 14s ease-in-out infinite;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:active { filter: brightness(0.97); transform: translateY(0); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: rgba(4, 12, 9, 0.72);
  color: var(--text);
  font-size: 1rem;
}

.input-lg {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

textarea { resize: vertical; }
label { display: block; font-size: 0.88rem; color: var(--muted); }

.stack { display: grid; gap: 12px; }
.grid-2 { display: grid; gap: 10px; }
.grid-3 { display: grid; gap: 10px; }

@media (min-width: 700px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr auto; }
}

.back-link { color: var(--muted); font-size: 0.88rem; }
.link-muted { color: var(--muted); font-size: 0.88rem; }
.link-muted:hover { color: var(--text); }

.alert { padding: 10px 12px; border-radius: var(--radius-md); margin-bottom: 10px; font-size: 0.9rem; }
.alert-error {
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid rgba(240, 113, 120, 0.35);
  color: #ffd0d3;
}
.alert-ok {
  background: rgba(62, 232, 138, 0.1);
  border: 1px solid rgba(62, 232, 138, 0.35);
  color: #c8ffe0;
}

.pill {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
}

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

.list-item {
  display: block;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(12, 28, 20, 0.48);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

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

.list-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.list-item-sub { color: var(--muted); margin-top: 6px; font-size: 0.92rem; }
.list-item-meta { color: rgba(255, 255, 255, 0.35); font-size: 0.78rem; margin-top: 6px; }

.status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.status-sent_from_loading, .status-handed_to_recipient { color: var(--status-ok); border-color: rgba(62, 232, 138, 0.35); }
.status-closed_with_discrepancy { color: #ffd0d3; border-color: rgba(240, 113, 120, 0.35); }
.status-draft { color: var(--warn); border-color: rgba(241, 200, 106, 0.35); }

.meta-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.label { display: block; color: var(--muted); font-size: 0.78rem; margin-bottom: 2px; }
.note { color: var(--muted); margin: 0; }

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.table th { color: var(--muted); font-size: 0.78rem; }

.items-editor .item-row, .verify-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 90px 70px auto;
  align-items: end;
  margin-bottom: 10px;
}

.item-name-wrap { position: relative; }
.item-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  background: rgba(8, 22, 14, 0.98);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.item-suggest-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.92rem;
}
.item-suggest-btn:hover { background: var(--accent-soft); }

.list-item-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}
.list-delete { display: flex; align-items: center; }
.list-delete .btn { min-width: 42px; }

.verify-check { margin: 0; align-self: center; }
.verify-hint { margin: 0 0 12px; text-align: center; }

.status-request_submitted, .status-request_accepted { color: #c8e6ff; border-color: rgba(120, 200, 255, 0.35); }
.status-assembled { color: var(--warn); border-color: rgba(241, 200, 106, 0.45); }
.status-delivered { color: var(--status-ok); border-color: rgba(62, 232, 138, 0.35); }

@media (max-width: 640px) {
  .items-editor .item-row, .verify-row { grid-template-columns: 1fr 1fr; }
  .verify-row .mark-disc, .verify-row .verify-check { grid-column: 1 / -1; }
}

.qty, .unit { text-align: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.verify-name strong { display: block; }
.muted { color: var(--muted); font-size: 0.88rem; }

.disc-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.timeline time { display: block; color: rgba(255, 255, 255, 0.35); font-size: 0.78rem; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.checkbox-row { display: flex; gap: 10px; align-items: center; color: var(--text); }
.checkbox-row input { width: auto; margin: 0; }

.disc-form {
  border: 1px dashed rgba(241, 200, 106, 0.45);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  display: grid;
  gap: 8px;
}

.admin-list { margin: 0; padding-left: 18px; color: var(--muted); }
code.small { font-size: 0.72rem; word-break: break-all; }

.admin-hint {
  margin: -4px 0 0;
  padding: 8px 10px;
  font-size: 0.82rem;
  color: #c8ffe0;
  background: rgba(62, 232, 138, 0.08);
  border: 1px solid rgba(62, 232, 138, 0.28);
  border-radius: var(--radius-md);
}

.otp-label {
  margin: 0 0 10px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.otp-row {
  display: flex;
  gap: clamp(6px, 2vw, 10px);
  justify-content: center;
  margin: 0 auto 8px;
  max-width: 360px;
}

.otp-cell {
  width: clamp(42px, 12vw, 52px);
  height: clamp(48px, 13vw, 58px);
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: rgba(4, 12, 9, 0.82);
  color: var(--text);
  caret-color: var(--accent);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.otp-cell:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46, 184, 114, 0.22);
  background: rgba(8, 22, 14, 0.95);
}

.otp-cell.filled {
  border-color: rgba(46, 184, 114, 0.55);
  background: rgba(46, 184, 114, 0.08);
}

.otp-hint {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
}

.otp-status {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.otp-status.is-busy { color: #c8ffe0; }
.otp-status.is-error { color: #ffd0d3; }

@media (prefers-reduced-motion: reduce) {
  .bg-blob, #edavoda-portal .top-brand, .btn-primary { animation: none !important; }
  #edavoda-portal .top-brand {
    color: rgba(210, 255, 228, 0.94) !important;
    -webkit-text-fill-color: rgba(210, 255, 228, 0.94) !important;
    background: none !important;
  }
}
