:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #2b2620;
  --text-muted: #7a7266;
  --primary: #9c7a3c;
  --primary-dark: #7d6130;
  --available: #4caf7d;
  --negotiable: #e0a835;
  --blocked: #d9534f;
  --border: #e8e1d6;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body {
  padding-bottom: 72px;
}

a { color: var(--primary-dark); }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 16px;
}

button, .btn {
  font-family: inherit;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--primary);
  color: white;
  font-weight: 600;
}

button:active { background: var(--primary-dark); }

button.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

button.danger { background: var(--blocked); }
button.block { width: 100%; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  width: 100%;
  background: var(--surface);
  color: var(--text);
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.field { margin-bottom: 14px; }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.proposed { background: #eee; color: #555; }
.badge.negotiating { background: #fdecd2; color: #a15c00; }
.badge.confirmed { background: #dff3e6; color: #1f7a4d; }
.badge.completed { background: #e4e4e4; color: #666; }
.badge.cancelled { background: #f6dede; color: #a03a3a; }
.badge.unresolved { background: #f8d9c4; color: #a1501b; }

.status-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.available { background: var(--available); }
.status-dot.negotiable { background: var(--negotiable); }
.status-dot.blocked { background: var(--blocked); }
.status-dot.unspecified { background: #ccc; }

.navbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  max-width: 480px;
  margin: 0 auto;
}

.navbar a {
  flex: 1;
  text-align: center;
  padding: 10px 4px 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.navbar a.active { color: var(--primary-dark); }
.navbar .icon { font-size: 1.3rem; display: block; }

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.avatar-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 10px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
}

.avatar-btn.selected { border-color: var(--primary); background: #fdf1ea; }

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 260px;
  margin: 16px auto;
}

.pin-pad button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 1.3rem;
  padding: 16px 0;
}

.pin-dots { text-align: center; font-size: 1.6rem; letter-spacing: 8px; margin: 10px 0; }

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.tabs button {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  padding: 8px 12px;
  white-space: nowrap;
}

.tabs button.active { background: var(--primary); color: white; border-color: var(--primary); }

.warning-banner {
  background: #fff3e0;
  border: 1px solid #f0c78a;
  color: #8a5a1c;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.warning-banner.strong { background: #fdecec; border-color: #eab3b0; color: #a03a3a; }

.participant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.participant-row:last-child { border-bottom: none; }

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.checklist-item input[type="checkbox"] { width: 20px; height: 20px; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

.error-msg {
  color: var(--blocked);
  font-size: 0.85rem;
  margin-top: 6px;
}

.weekly-grid {
  display: grid;
  grid-template-columns: 40px repeat(7, 1fr);
  gap: 2px;
  font-size: 0.7rem;
}

.weekly-grid .head { text-align: center; font-weight: 700; padding: 4px 0; }
.weekly-grid .hourlabel { text-align: right; padding-right: 4px; color: var(--text-muted); }

.slot-cell {
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  background: #eee;
}
.slot-cell.available { background: var(--available); }
.slot-cell.negotiable { background: var(--negotiable); }
.slot-cell.blocked { background: var(--blocked); }

.link-btn {
  background: none;
  border: none;
  color: var(--primary-dark);
  text-decoration: underline;
  padding: 4px 0;
  font-weight: 600;
}

.meeting-link {
  display: inline-block;
  margin-top: 8px;
  background: #e6f0fb;
  color: #1d5fa8;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
}
