:root {
  --color-bg: #0f172a;
  --color-card: #1e293b;
  --color-accent: #38bdf8;
  --color-danger: #fb7185;
  --color-success: #4ade80;
  --color-text: #f8fafc;
  --color-muted: #94a3b8;
  --color-pastel-green: #dcfce7;
  --color-pastel-pink: #ffe4e6;
  --color-pastel-blue: #e0f2fe;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  padding: clamp(1rem, 3vw, 1.5rem);
  margin: 0 auto;
  width: min(100%, 640px);
}

.card {
  background: var(--color-card);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.title {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
  font-weight: 600;
}

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

.btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-bg);
  background: var(--color-accent);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.stats {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0;
}

.stat {
  flex: 1;
  padding: 0.8rem;
  border-radius: 0.8rem;
  margin-right: 0.5rem;
  background: rgba(56, 189, 248, 0.15);
}

.stat:last-child {
  margin-right: 0;
  background: rgba(74, 222, 128, 0.15);
}

.stat label {
  display: block;
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: 0.2rem;
}

.stat strong {
  font-size: 1.3rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  cursor: pointer;
  font-size: 0.9rem;
}

.tab.active {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: transparent;
}

.tab.active .muted {
  color: #fff;
}

.positions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 6rem;
}

.rack-group {
  background: var(--color-card);
  border-radius: 1rem;
  padding: 1rem;
}

.rack-group + .rack-group {
  margin-top: 1rem;
}

.rack-header {
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--color-text);
}

.rack-photo {
  display: block;
  border-radius: 0.8rem;
  overflow: hidden;
  border: 2px solid rgba(148, 163, 184, 0.2);
  margin-bottom: 0.8rem;
}

.rack-photo img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: #fff;
}

.rack-group .position-card {
  margin-bottom: 0.8rem;
}

.rack-group .position-card:last-child {
  margin-bottom: 0;
}

.position-card {
  background: #fff;
  color: #0f172a;
  border-radius: 1rem;
  padding: 1rem;
}

.position-card.status-declined {
  background: var(--color-pastel-pink);
}

.position-card.status-solved {
  background: var(--color-pastel-green);
}

.position-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.position-body {
  display: flex;
  gap: 0.8rem;
}

.position-card.obstacle .position-body,
.position-card.obstacle .position-details {
  display: block;
}

.position-card.obstacle .position-body {
  padding: 0;
}

.position-images {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.position-images img {
  width: clamp(110px, 32vw, 140px);
  height: clamp(110px, 32vw, 140px);
  object-fit: contain;
  background: #fff;
  padding: 0.25rem;
  border-radius: 0.8rem;
  border: 2px solid rgba(15, 23, 42, 0.1);
  display: block;
}

.position-images.single {
  flex-direction: column;
}

.position-details {
  flex: 1;
  font-size: 0.9rem;
}

.position-details strong {
  display: block;
  margin-bottom: 0.2rem;
}

.position-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.position-actions button {
  width: 100%;
  padding: 0.6rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.position-card.obstacle .position-actions {
  flex-direction: row;
}

.position-images.single,
.position-card.obstacle .position-images {
  flex-direction: column;
}

.position-images.single img {
  width: 100%;
  height: auto;
  max-height: 280px;
}

.position-card.obstacle .position-images img {
  width: 100%;
  height: auto;
  max-height: none;
}

.position-actions .decline {
  background: var(--color-danger);
  color: #fff;
}

.position-actions .solve {
  background: var(--color-success);
  color: #0f172a;
}

.toolbar {
  position: sticky;
  bottom: 0;
  margin: 0 auto;
  max-width: 500px;
  background: rgba(15, 23, 42, 0.9);
  padding: 1rem 1.5rem;
  display: flex;
  gap: 0.8rem;
}

.toolbar button {
  flex: 1;
  border-radius: 999px;
  border: none;
  padding: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.toolbar .decline {
  background: rgba(248, 113, 113, 0.2);
  color: var(--color-danger);
  border: 1px solid rgba(248, 113, 113, 0.6);
}

.toolbar .complete {
  background: var(--color-accent);
  color: var(--color-bg);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-content {
  background: #fff;
  color: #0f172a;
  padding: 1.5rem;
  border-radius: 1rem;
  width: 100%;
  max-width: 420px;
}

.modal-content textarea {
  width: 100%;
  min-height: 120px;
  border-radius: 0.5rem;
  border: 1px solid rgba(15, 23, 42, 0.2);
  padding: 0.8rem;
  font-size: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.modal-actions button {
  flex: 1;
  padding: 0.8rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.text-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.2);
  color: var(--color-text);
  margin-bottom: 1rem;
}

.badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-accent);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: var(--color-text);
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 5;
}

@media (max-width: 480px) {
  .screen {
    padding: 1rem;
  }

  .position-body {
    flex-direction: column;
  }

  .position-images {
    justify-content: space-between;
  }

  .position-images img {
    flex: 1;
    height: 120px;
  }
}
.position-card.obstacle .position-images {
  flex-direction: column;
}

.position-card.obstacle .position-images img {
  width: 100%;
  height: auto;
  max-height: 260px;
}
+
++.position-actions {
++  display: flex;
++  flex-direction: column;
++  gap: 0.6rem;
++  margin-top: 0.8rem;
++}
+
++.position-card.obstacle .position-actions {
++  flex-direction: row;
++}
