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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  min-height: 100vh;
  font-size: 13px;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

.app-header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left h1 {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Tabs ────────────────────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 0 24px;
}

.tab {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: #6e6e73;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: #1d1d1f; }
.tab.active {
  color: #0071e3;
  border-bottom-color: #0071e3;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-primary { background: #0071e3; color: #fff; }
.btn-primary:hover { background: #0077ed; }

.btn-secondary { background: #f0f0f5; color: #1d1d1f; border: 1px solid #d1d1d6; }
.btn-secondary:hover { background: #e5e5ea; }

.btn-danger { background: #ff3b30; color: #fff; }
.btn-danger:hover { background: #e0332b; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
  color: #6e6e73;
  border-radius: 4px;
  transition: all 0.15s;
}
.btn-icon:hover { background: #f0f0f5; color: #0071e3; }

/* ─── Form inputs ─────────────────────────────────────────────────────────── */

.form-input {
  padding: 6px 10px;
  border: 1px solid #d1d1d6;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: #0071e3; }

textarea.form-input {
  resize: vertical;
  line-height: 1.5;
}

/* ─── Reminder list ──────────────────────────────────────────────────────── */

.reminder-list {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reminder-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.reminder-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.reminder-card.disabled { opacity: 0.55; }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.card-info { display: flex; align-items: center; gap: 8px; }
.card-title { font-weight: 600; font-size: 14px; }

.card-actions {
  display: flex;
  gap: 4px;
}

.status-active {
  background: #d4f5e2; color: #1a7a3a;
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.status-disabled {
  background: #f0f0f5; color: #999;
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
}

.card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #6e6e73;
  margin-bottom: 6px;
}

.card-message {
  font-size: 12px;
  color: #6e6e73;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.badge {
  background: #d6e8ff; color: #0071e3;
  padding: 1px 6px; border-radius: 8px; font-size: 11px; font-weight: 600;
}

.empty-state {
  text-align: center;
  color: #999;
  padding: 48px;
  font-size: 14px;
}

/* ─── Modal ───────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: #fff;
  border-radius: 12px;
  width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e5e5;
}
.modal-header h3 { font-size: 15px; font-weight: 600; }

.modal-close {
  background: none; border: none; font-size: 20px;
  cursor: pointer; color: #999; padding: 4px;
}

.modal-body {
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.modal-body label {
  font-size: 12px; font-weight: 600; color: #6e6e73; margin-top: 4px;
}
.modal-body .form-input { width: 100%; }

.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #e5e5e5;
}

/* ─── Channel / Member checkboxes ────────────────────────────────────────── */

.channel-row {
  display: flex; gap: 6px;
}
.channel-row .form-input { flex: 1; }

.member-checkboxes {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.member-checkboxes:empty { display: none; }

.member-check {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px; background: #f0f0f5; border-radius: 4px;
  font-size: 12px; cursor: pointer; transition: background 0.1s;
}
.member-check:hover { background: #e0e0ea; }
.member-check input { margin: 0; }
.member-check.checked { background: #d6e8ff; }

/* ─── Day-of-week checkboxes ─────────────────────────────────────────────── */

.dow-checks {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px;
}
.dow-check {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; background: #f0f0f5; border-radius: 6px;
  font-size: 12px; cursor: pointer; transition: all 0.15s;
}
.dow-check:hover { background: #e0e0ea; }
.dow-check input { margin: 0; }
.dow-check.checked { background: #d6e8ff; }

/* ─── Toast ───────────────────────────────────────────────────────────────── */

.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1d1d1f; color: #fff;
  padding: 10px 24px; border-radius: 8px; font-size: 13px;
  z-index: 200; opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #ff3b30; }
.toast.success { background: #34c759; }

/* ─── Utility ─────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
