:root {
  --accent: #4A6345;
  --accent-soft: #C9DEC2;
  --accent-soft-hover: #B4CFAB;
  --bg: #F3F1EA;
  --ink: #1A1A1A;
  --muted: #8A8574;
  --border: #E4E0D3;
  --input-border: #D5D0C3;
  --btn-neutral: #EFECE2;
  --btn-neutral-hover: #E4E0D3;
  --danger: #B3452C;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.brand-text p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.btn-clear {
  background-color: var(--btn-neutral);
  color: var(--ink);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}

.btn-clear:hover {
  background-color: var(--btn-neutral-hover);
}

/* Main container */
.app-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 18px 48px;
}

/* Cards */
.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(26, 26, 26, 0.04);
}

.hidden {
  display: none !important;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}

.subsection-title {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Segmented Button */
.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background-color: var(--btn-neutral);
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.seg-btn.active {
  background-color: var(--accent-soft);
}

.seg-btn.active:hover {
  background-color: var(--accent-soft-hover);
}

/* Date Row */
.date-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-field label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.select-pill {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--accent-soft);
  color: var(--ink);
  border: none;
  border-radius: 8px;
  height: 38px;
  padding: 0 32px 0 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231A1A1A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: background-color 0.15s ease;
}

.select-pill:hover,
.select-pill:focus {
  background-color: var(--accent-soft-hover);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.date-dia .select-pill {
  min-width: 82px;
}

.date-mes .select-pill {
  min-width: 165px;
}

.date-anio .select-pill {
  min-width: 105px;
}

/* Inputs & Grids */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-group label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.field-group input,
.uni-input {
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1.5px solid var(--input-border);
  background: #FAFAFA;
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.field-group input::placeholder,
.uni-input::placeholder {
  color: #9E9A8E;
}

.field-group input:focus,
.uni-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 99, 69, 0.15);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.grid-2 .field-group {
  margin-bottom: 0;
}

/* Checklists */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  min-height: 28px;
  gap: 10px;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.uni-checklist .check-label {
  min-width: 175px;
}

.check-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid #9E9A8E;
  border-radius: 6px;
  background-color: #ffffff;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background-color 0.12s ease, border-color 0.12s ease;
  flex-shrink: 0;
}

.check-label input[type="checkbox"]:hover {
  border-color: var(--accent);
}

.check-label input[type="checkbox"]:checked {
  background-color: var(--accent-soft);
  border-color: var(--accent);
}

.check-label input[type="checkbox"]:checked::before {
  content: "";
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A1A1A' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.uni-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.uni-input.talla {
  width: 78px;
  height: 34px;
}

.uni-input.cant {
  width: 70px;
  height: 34px;
}

/* Generate Button & Status */
.generate-wrap {
  margin-top: 14px;
  text-align: center;
}

.status-msg {
  min-height: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent);
}

.status-msg.error {
  color: var(--danger);
}

.btn-generate {
  width: 100%;
  height: 48px;
  background-color: var(--accent-soft);
  color: var(--ink);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.btn-generate:hover {
  background-color: var(--accent-soft-hover);
}

.btn-generate:active {
  transform: translateY(1px);
}

@media (max-width: 520px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .check-row {
    flex-wrap: wrap;
  }
}
