[hidden] {
  display: none !important;
}

:root {
  --ink: #16302b;
  --ink-soft: #4b625d;
  --teal: #0f6e56;
  --teal-dark: #085041;
  --teal-pale: #e1f5ee;
  --line: #dbe3e0;
  --bg: #f4f7f6;
  --card: #ffffff;
  --danger: #a32d2d;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

.app-header h1 {
  font-size: 22px;
  margin: 4px 0 2px;
}
.app-header .subtitle {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 14px;
}

.progress {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}
.progress .seg {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  transition: background 0.2s ease;
}
.progress .seg.done,
.progress .seg.active {
  background: var(--teal);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(15, 30, 26, 0.04);
}

.phase-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--teal-dark);
}
.phase-hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}
.field input[type="text"]:focus,
.field input[type="password"]:focus,
.field input[type="number"]:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-pale);
}

.item-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: none; }

.item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item-label {
  font-size: 14.5px;
  line-height: 1.35;
}

.item-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stepper button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 18px;
  line-height: 1;
  color: var(--teal-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper button:active { transform: scale(0.94); }
.stepper .val {
  min-width: 22px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

.unit-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
}
.unit-toggle button {
  border: none;
  background: #fff;
  padding: 6px 8px;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.unit-toggle button.active {
  background: var(--teal);
  color: #fff;
}

.model-input {
  margin-top: 8px;
}
.model-input input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  gap: 10px;
}

button.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
button.btn.primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 110, 86, 0.25);
}
button.btn.primary:hover { background: var(--teal-dark); }
button.btn.primary:active { background: var(--teal-dark); transform: scale(0.98); }
button.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
button.btn.ghost:hover {
  background: var(--teal-pale);
  color: var(--teal-dark);
  border-color: var(--teal-pale);
}
button.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.summary-phase {
  font-weight: 600;
  font-size: 14px;
  color: var(--teal-dark);
  margin: 16px 0 4px;
}
.summary-phase:first-child { margin-top: 0; }

.empty-note {
  font-size: 13px;
  color: var(--ink-soft);
}

.success-box {
  text-align: center;
  padding: 30px 10px;
}
.success-box .check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--teal-pale);
  color: var(--teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 28px;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
}

/* ---- Admin ---- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-box {
  max-width: 340px;
  width: 100%;
  margin: 0;
  box-shadow: 0 8px 30px rgba(15, 30, 26, 0.08);
}

html, body {
  height: 100%;
}

.admin-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  background: var(--bg);
}

.admin-sidebar {
  flex: 0 0 40%;
  max-width: 300px;
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 0 0 22px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sidebar-logo-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  display: inline-block;
  box-shadow: 0 0 0 4px var(--teal-pale);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: none;
  background: transparent;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 14.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
}
.nav-item:hover {
  background: var(--teal-pale);
  color: var(--teal-dark);
}
.nav-item.active {
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(15, 110, 86, 0.25);
}
.nav-item.active svg { opacity: 1; }

.admin-content {
  flex: 1 1 60%;
  padding: 28px 32px 60px;
  max-width: 780px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.admin-header h1 { font-size: 21px; margin: 0; letter-spacing: -0.01em; }

@media (max-width: 800px) {
  .admin-shell {
    flex-direction: column;
    min-height: 0;
  }
  .admin-sidebar {
    flex: none;
    max-width: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    position: static;
    height: auto;
    overflow: visible;
  }
  .sidebar-title { display: none; }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .nav-item { padding: 9px 12px; font-size: 13.5px; }
  .admin-content {
    padding: 18px 16px 60px;
    max-width: none;
  }
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.filter-row input[type="text"] {
  flex: 1;
  min-width: 140px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.filter-row input[type="date"] {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.request-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.request-card:hover {
  box-shadow: 0 4px 14px rgba(15, 30, 26, 0.07);
  border-color: #c7d6d1;
}
.request-card .top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.request-card .name { font-weight: 600; font-size: 15px; }
.request-card .date { font-size: 12px; color: var(--ink-soft); }
.request-card .meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-badge.pendiente { background: #faeeda; color: #854f0b; }
.status-badge.comprado { background: #e6f1fb; color: #0c447c; }
.status-badge.entregado { background: #eaf3de; color: #27500a; }
.request-card details { margin-top: 8px; }
.request-card summary {
  font-size: 13px;
  color: var(--teal-dark);
  cursor: pointer;
}
.status-select {
  margin-top: 10px;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
