:root {
  --green: #2f6f4f;
  --green-light: #e4f3ea;
  --orange: #b5590a;
  --orange-light: #fdece0;
  --red: #a3272c;
  --red-light: #fbe6e6;
  --grey: #5a5a5a;
  --grey-light: #eeeeee;
  --text: #1c1c1c;
  --bg: #ffffff;
}

* { box-sizing: border-box; }

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 1.2em;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  vertical-align: middle;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 20px;
  line-height: 1.4;
}

h1, h2, h3 { margin: 0.6em 0 0.3em; }

/* ---------- Home view (elder-facing) ---------- */

.home-header {
  text-align: center;
  padding: 20px 10px;
  background: var(--green);
  color: white;
}
.header-icon { font-size: 2.2rem; }
.clock { font-size: 3rem; font-weight: bold; }
.today-date { font-size: 1.3rem; text-transform: capitalize; }

main { padding: 10px 16px 40px; max-width: 640px; margin: 0 auto; }

.card-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }

.card {
  border-radius: 14px;
  padding: 16px;
  border: 2px solid var(--grey-light);
}
.card.status-upcoming { background: var(--grey-light); }
.card.status-due { background: var(--orange-light); border-color: var(--orange); }
.card.status-taken { background: var(--green-light); border-color: var(--green); }
.card.status-available { background: var(--green-light); border-color: var(--green); }
.card.status-unavailable { background: var(--grey-light); }

.card-title { font-size: 1.4rem; font-weight: bold; }
.card-detail { font-size: 1.1rem; margin-top: 4px; }
.card-status { font-size: 1.1rem; margin-top: 6px; font-weight: bold; }

.big-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 18px;
  font-size: 1.3rem;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  min-height: 64px;
  cursor: pointer;
}
.big-button.action { background: var(--green); color: white; }
.big-button.action:active { background: #24583e; }
.big-button:disabled { background: #cfcfcf; color: #777; cursor: default; }

.home-footer { text-align: center; padding: 10px 0 30px; }
.link-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--grey);
  font-size: 1rem;
  padding: 12px;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Settings view (caregiver-facing) ---------- */

#settings-view { font-size: 16px; }

.settings-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--grey-light);
}
.settings-header h1 { font-size: 1.3rem; margin: 0; }
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--grey);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 1rem;
  cursor: pointer;
}

.settings-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.settings-item {
  border: 1px solid var(--grey-light);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.settings-item-info strong { display: block; font-size: 1.05rem; }
.settings-item-info span { color: var(--grey); font-size: 0.9rem; }
.settings-item-actions { display: flex; gap: 8px; white-space: nowrap; }
.settings-item-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--grey);
  background: white;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: white;
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1rem;
  cursor: pointer;
}
.secondary-button.small { padding: 6px 10px; font-size: 0.9rem; }

/* ---------- Overlays / forms ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.overlay[hidden] {
  display: none;
}

.form-panel {
  background: white;
  border-radius: 14px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

.form-panel label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: var(--grey);
}
.form-panel input[type="text"],
.form-panel input[type="number"],
.form-panel input[type="time"] {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.field-label { font-size: 0.95rem; color: var(--grey); }

.time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.time-row input { flex: 1; }
.time-row button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--red);
  color: var(--red);
  background: white;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.primary-button {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 1rem;
  cursor: pointer;
}
