/* Fausti Hitos — mobile-first minimal CSS v2 */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  background: #0b0f14;
  color: #e7eef7;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.4;
}

.hidden { display: none !important; }
.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #7c8a9a;
  font-weight: 600;
}
.muted { color: #7c8a9a; }
.small { font-size: 13px; }
.error { color: #fca5a5; font-size: 14px; margin-top: 8px; }

/* ===== Botones ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #e7eef7;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
}
.btn--primary {
  background: #22c55e;
  color: #062a13;
  font-weight: 600;
}
.btn--primary:active { background: #16a34a; }
.btn--ghost {
  background: transparent;
  border: 1px solid #2a3441;
  color: #b8c4d2;
}
.btn--small { padding: 6px 12px; font-size: 13px; min-height: 32px; }
.btn--block { width: 100%; }

/* ===== Login ===== */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #131a23;
  border: 1px solid #1f2a37;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
}
.login-card h1 { font-size: 24px; margin: 4px 0 8px; }
.login-card label {
  display: block;
  margin-top: 16px;
  font-size: 14px;
  color: #b8c4d2;
}
.login-card input {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  background: #0b0f14;
  border: 1px solid #2a3441;
  border-radius: 10px;
  color: #e7eef7;
  font-size: 15px;
}
.login-card .btn { margin-top: 20px; width: 100%; }

/* ===== Topbar ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #1a2330;
  position: sticky;
  top: 0;
  background: #0b0f14;
  z-index: 10;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #062a13;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.topbar h1 { font-size: 18px; margin: 2px 0; }

/* ===== Main ===== */
.main {
  padding: 16px;
  padding-bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: #131a23;
  border: 1px solid #1f2a37;
  border-radius: 14px;
  padding: 16px;
}
.card h2 { font-size: 16px; margin-bottom: 8px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.card-head h2 { margin-bottom: 0; }

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge--ok { background: #052e1a; color: #4ade80; }
.badge--warn { background: #2d1f08; color: #fbbf24; }
.badge--auto { background: #0c2236; color: #7dd3fc; }

/* ===== Alerts/Info ===== */
.alerts { border-color: #4a2c1a; }
.alerts h2 { color: #fbbf24; }
.alerts .alert-item {
  background: #1f1611;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 14px;
}
.alerts .alert-item--alert { background: #2a1310; }
.info { border-color: #1a3a2a; }
.info .info-item {
  background: #0e1f17;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 14px;
  color: #4ade80;
}

/* ===== Check-in ===== */
.checkin-block {
  padding: 12px 0;
  border-bottom: 1px solid #1a2330;
}
.checkin-block:last-child { border-bottom: none; padding-bottom: 0; }
.checkin-block:first-of-type { padding-top: 0; }
.checkin-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.checkin-label { flex: 1; }
.checkin-yesterday { font-size: 14px; color: #7c8a9a; margin-top: 2px; }
.checkin-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
}
.checkin-inputs input {
  width: 60px;
  padding: 8px;
  background: #0b0f14;
  border: 1px solid #2a3441;
  border-radius: 8px;
  color: #e7eef7;
  font-size: 16px;
  text-align: center;
  font-weight: 600;
}
.checkin-inputs input:focus { outline: none; border-color: #22c55e; }
.checkin-inputs span { color: #7c8a9a; font-size: 14px; }
.checkin-total {
  font-size: 13px;
  color: #7c8a9a;
  margin-bottom: 8px;
  text-align: right;
}

/* ===== Growth summary ===== */
.growth-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.growth-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
}
.growth-item__value { font-weight: 600; }
.growth-item__pct {
  font-size: 12px;
  color: #7c8a9a;
  margin-left: 6px;
}
.band { color: #7dd3fc; }
.band--low { color: #fbbf24; }
.band--high { color: #4ade80; }

/* ===== Chart tabs ===== */
.chart-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: #0b0f14;
  padding: 4px;
  border-radius: 10px;
}
.chart-tab {
  flex: 1;
  padding: 6px;
  background: transparent;
  border: none;
  color: #7c8a9a;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chart-tab--active {
  background: #1a2330;
  color: #e7eef7;
}

/* ===== Chart (SVG inline) ===== */
.growth-chart {
  margin-top: 12px;
}
.growth-chart svg {
  width: 100%;
  height: 160px;
  display: block;
}
.growth-chart-large {
  margin-bottom: 16px;
}
.growth-chart-large svg {
  width: 100%;
  height: 240px;
  display: block;
}

.chart-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #7c8a9a;
  margin-top: 6px;
  flex-wrap: wrap;
}
.chart-legend__item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.chart-legend__swatch {
  width: 10px;
  height: 3px;
  border-radius: 2px;
}

/* ===== Weekly bars ===== */
.weekly-block { margin-bottom: 16px; }
.weekly-block:last-child { margin-bottom: 0; }
.weekly-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.weekly-pattern {
  font-size: 12px;
  color: #7c8a9a;
}
.weekly-bars {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 80px;
  position: relative;
  border-bottom: 1px solid #1a2330;
  padding-top: 4px;
}
.weekly-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  justify-content: flex-end;
}
.weekly-bar__fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: #22c55e;
  min-height: 2px;
  transition: height 0.3s ease;
}
.weekly-bar__fill--low { background: #fbbf24; }
.weekly-bar__fill--very-low { background: #f87171; }
.weekly-bar__fill--empty { background: #1a2330; }
.weekly-bar__label {
  font-size: 10px;
  color: #7c8a9a;
  font-weight: 500;
  text-transform: uppercase;
}
.weekly-bar__value {
  font-size: 10px;
  color: #e7eef7;
  font-weight: 600;
}
.weekly-bar--today .weekly-bar__label {
  color: #22c55e;
  font-weight: 700;
}

/* ===== History week ===== */
.history-week-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  background: #0b0f14;
  border-radius: 8px;
  font-size: 14px;
}
.history-item__icon {
  font-size: 18px;
  flex-shrink: 0;
}
.history-item__body {
  flex: 1;
  min-width: 0;
}
.history-item__title {
  font-weight: 500;
  margin-bottom: 2px;
}
.history-item__date {
  font-size: 12px;
  color: #7c8a9a;
}
.history-item__auto {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #0c2236;
  color: #7dd3fc;
  margin-left: 6px;
  text-transform: uppercase;
  font-weight: 600;
}

/* ===== Events ===== */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.event-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: #0b0f14;
  border-radius: 8px;
  font-size: 14px;
}
.event-emoji { font-size: 18px; }
.event-text { flex: 1; }
.event-date { font-size: 12px; color: #7c8a9a; }

/* ===== Growth sheet list ===== */
.growth-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 16px;
}
.growth-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #0b0f14;
  border-radius: 10px;
  font-size: 14px;
}
.growth-list__date { color: #7c8a9a; }
.growth-list__values {
  display: flex;
  gap: 12px;
  font-size: 13px;
}
.growth-list__value { text-align: right; }
.growth-list__pct { font-size: 11px; color: #7c8a9a; }

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #22c55e;
  color: #062a13;
  border: none;
  font-size: 28px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
  cursor: pointer;
  z-index: 20;
  -webkit-tap-highlight-color: transparent;
}
.fab:active { background: #16a34a; }

/* ===== Sheets ===== */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  background: #131a23;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
  animation: slideUp 0.25s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #1a2330;
  position: sticky;
  top: 0;
  background: #131a23;
}
.sheet-header h2 { font-size: 18px; }
.sheet-body { padding: 16px; }
.sheet-body.stack { display: flex; flex-direction: column; gap: 12px; }
.sheet-body label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #b8c4d2;
}
.sheet-body input,
.sheet-body select,
.sheet-body textarea {
  padding: 10px 12px;
  background: #0b0f14;
  border: 1px solid #2a3441;
  border-radius: 10px;
  color: #e7eef7;
  font-size: 15px;
  font-family: inherit;
}
.sheet-body input:focus,
.sheet-body select:focus,
.sheet-body textarea:focus { outline: none; border-color: #22c55e; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.check-row {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.check-row input[type="checkbox"] { width: 18px; height: 18px; }

.action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #0b0f14;
  border: 1px solid #1a2330;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  -webkit-tap-highlight-color: transparent;
}
.action-btn:active { background: #1a2330; }
.action-emoji { font-size: 24px; }
.action-label { font-size: 15px; color: #e7eef7; }

.sheet-body h3 {
  font-size: 14px;
  margin-top: 8px;
  color: #7c8a9a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 380px) {
  .topbar h1 { font-size: 16px; }
  .card { padding: 12px; }
  .checkin-inputs input { width: 52px; padding: 6px; font-size: 14px; }
  .growth-chart svg { height: 130px; }
  .growth-chart-large svg { height: 200px; }
}
