:root {
  --surface-0: #f4f2ec;
  --surface-1: #eeece4;
  --surface-2: #ffffff;
  --border: rgba(27, 36, 32, 0.13);
  --border-strong: rgba(27, 36, 32, 0.28);
  --text-primary: #1b2420;
  --text-secondary: #5f6b62;
  --text-muted: #8a9089;
  --accent-bg: #e1eef0;
  --accent-text: #205e66;
  --warning-bg: #f7ecd9;
  --warning-text: #8a5a12;
  --success-fill: #2e7d5b;
  --on-success: #ffffff;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

a { color: var(--accent-text); text-decoration: none; }

.card {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 16px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.hub-tile {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--text-primary);
  display: block;
}

.hub-tile.disabled {
  color: var(--text-muted);
  opacity: 0.6;
  pointer-events: none;
}

.hub-tile .label {
  font-weight: 500;
  font-size: 14px;
  margin-top: 8px;
  display: block;
}

button {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-primary);
  cursor: pointer;
}
button:hover { background: var(--surface-1); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }

input[type="number"], input[type="datetime-local"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border-strong);
  font-family: inherit;
  font-size: 14px;
}

.badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius);
  background: var(--surface-1);
  color: var(--text-secondary);
}
.badge.active { background: var(--accent-bg); color: var(--accent-text); }

.fill-bar-track {
  width: 56px;
  height: 170px;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  background: var(--surface-1);
}
.fill-bar-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--accent-bg);
}

.stat-card {
  flex: 1;
  background: var(--surface-1);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.stat-card.warning { background: var(--warning-bg); }
.stat-card .stat-label { font-size: 12px; color: var(--text-secondary); margin: 0 0 2px; }
.stat-card.warning .stat-label { color: var(--warning-text); }
.stat-card .stat-value { font-size: 18px; font-weight: 500; margin: 0; }
.stat-card.warning .stat-value { color: var(--warning-text); }

.next-step-card {
  background: var(--surface-1);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.lifecycle-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.lifecycle-connector { width: 1px; height: 8px; background: var(--border); margin-left: 8px; }
.lifecycle-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 0.5px solid var(--border-strong);
  flex-shrink: 0;
}
.lifecycle-dot.done { background: var(--success-fill); border: none; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; }
.lifecycle-dot.current { width: 18px; height: 18px; background: var(--text-primary); border: none; }
.lifecycle-label { font-size: 12px; color: var(--text-secondary); margin: 0; }
.lifecycle-label.current { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.lifecycle-label.done { color: var(--text-muted); }

.history-entry {
  display: flex; gap: 12px; padding: 8px 0;
  border-top: 0.5px solid var(--border);
  font-size: 13px;
}
.history-entry .time { color: var(--text-muted); width: 110px; flex-shrink: 0; font-size: 12px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.modal-box {
  background: var(--surface-2); border-radius: 12px; border: 0.5px solid var(--border);
  padding: 1.25rem 1.5rem; width: 320px; max-width: 90vw;
}
.warning-text { font-size: 12px; color: var(--warning-text); margin: 8px 0; }
.hidden { display: none; }
