:root {
  --bg: #000000;
  --bg-soft: #141414;
  --panel: #171717;
  --panel-alt: #232323;
  --line: rgba(255, 255, 255, 0.08);
  --text: #a5a3a3;
  --muted: #d2c3c3;
  --accent: #8a0d0d;
  --accent-strong: #801616;
  --danger: #ff9c9c;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Aptos", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(184, 0, 0, 0.18), transparent 24%),
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.05), transparent 16%),
    radial-gradient(circle at bottom right, rgba(184, 0, 0, 0.12), transparent 22%),
    var(--bg);
  color: var(--text);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 560px);
  border-radius: 28px;
  padding: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(184, 0, 0, 0.05));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.login-brand {
  margin-bottom: 24px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap input {
  padding-left: 46px;
}

.password-wrap input {
  padding-right: 52px;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 1rem;
}

.toggle-password-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
}

.toggle-password-btn:hover {
  color: var(--text);
}

.login-btn {
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}

.login-error {
  margin: 0;
  color: #ffb4b4;
  font-size: 0.95rem;
}

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

.app-shell {
  max-width: 1540px;
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
  max-width: 820px;
}

.hero-copy {
  margin-top: 14px;
  max-width: 800px;
  color: var(--muted);
  line-height: 1.5;
}

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

.primary-btn,
.ghost-btn,
.text-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.primary-btn:hover,
.ghost-btn:hover,
.text-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff6f6;
  padding: 14px 22px;
  font-weight: 700;
}

.ghost-btn {
  background: rgba(184, 0, 0, 0.08);
  color: var(--text);
  padding: 14px 22px;
  border: 1px solid var(--line);
}

.text-btn {
  background: transparent;
  color: var(--danger);
  padding: 4px 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel,
.summary-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(184, 0, 0, 0.03));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.panel h2,
.summary-card h2 {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.section-copy {
  color: var(--muted);
  line-height: 1.5;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label span {
  color: var(--muted);
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--panel-alt);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(184, 0, 0, 0.18);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.capacity-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 10px;
}

.capacity-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
}

.capacity-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7d0000, var(--accent-strong));
  transition: width 0.2s ease;
}

.progress-fill.is-danger {
  background: linear-gradient(90deg, #f39b86, #ff6a5c);
}

.summary-column {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 18px;
}

.summary-card.accent {
  background:
    linear-gradient(140deg, rgba(184, 0, 0, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.metric-list {
  display: grid;
  gap: 12px;
}

.metric-list div,
.mini-grid div,
.saved-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.metric-list span,
.mini-grid span {
  color: var(--muted);
}

.metric-list strong {
  font-size: 1.08rem;
}

.mini-grid {
  display: grid;
  gap: 12px;
}

.saved-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

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

.products-list {
  display: grid;
  gap: 12px;
}

.product-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
}

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

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

.product-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.product-metrics div {
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 5px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(184, 0, 0, 0.12);
  border: 1px solid rgba(184, 0, 0, 0.3);
  color: #ffdddd;
}

.saved-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}

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

.saved-item small,
.empty-state {
  color: var(--muted);
}

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

.chip-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.chip-btn.danger {
  color: var(--danger);
}

@media (max-width: 1160px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .summary-column {
    position: static;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 16px;
  }

  .hero {
    flex-direction: column;
    align-items: start;
  }

  .form-grid,
  .two-cols,
  .three-cols,
  .product-metrics {
    grid-template-columns: 1fr;
  }

  .panel-title-row,
  .product-item-head {
    flex-direction: column;
  }

  .span-2 {
    grid-column: auto;
  }
}
