*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

/* HEADER */
header {
  background: linear-gradient(135deg, #6d28d9, #db2777);
  color: white;
  text-align: center;
  padding: 36px 20px 28px;
}
header h1 { font-size: 1.9rem; margin-bottom: 6px; }
header p  { font-size: 0.85rem; opacity: 0.8; }

/* MAIN */
main { max-width: 860px; margin: 0 auto; padding: 24px 16px 80px; }

/* TABS */
.tabs {
  display: flex; gap: 6px;
  background: white; padding: 6px;
  border-radius: 50px; margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  flex-wrap: wrap;
}
.tab {
  flex: 1; padding: 9px 12px; border-radius: 50px;
  border: none; background: none; cursor: pointer;
  font-size: 0.85rem; font-weight: 500; color: #6b7280;
  transition: all 0.2s; white-space: nowrap;
}
.tab.active { background: #6d28d9; color: white; }

/* TAB CONTENT */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* STATS */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.stat {
  background: white; border-radius: 12px;
  padding: 14px; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat .num { font-size: 1.8rem; font-weight: 700; }
.stat .lbl { font-size: 0.72rem; color: #9ca3af; text-transform: uppercase; margin-top: 3px; }

/* FILTERS */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
#search {
  flex: 1; min-width: 160px; padding: 9px 16px;
  border-radius: 50px; border: 1px solid #e5e7eb;
  font-size: 0.875rem; outline: none;
}
#search:focus { border-color: #6d28d9; }
.filter {
  padding: 7px 16px; border-radius: 50px; border: 1px solid #e5e7eb;
  background: white; cursor: pointer; font-size: 0.82rem;
  transition: all 0.2s;
}
.filter.active { background: #6d28d9; color: white; border-color: #6d28d9; }

/* SECTION LABELS */
.section-lbl {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: #9ca3af; margin: 18px 0 8px;
  border-bottom: 1px solid #e5e7eb; padding-bottom: 5px;
}

/* EVENT CARDS */
.card {
  background: white; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: transform 0.15s;
}
.card:hover { transform: translateY(-1px); }
.card.today  { border-left: 4px solid #f59e0b; }
.card.soon   { border-left: 4px solid #ef4444; }

.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.card-info { flex: 1; min-width: 0; }
.card-name { font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub  { font-size: 0.78rem; color: #6b7280; margin-top: 2px; }
.badge {
  font-size: 0.72rem; font-weight: 600;
  padding: 4px 11px; border-radius: 50px;
  flex-shrink: 0;
}
.badge.today  { background: #fef3c7; color: #92400e; }
.badge.soon   { background: #fee2e2; color: #991b1b; }
.badge.normal { background: #f3f4f6; color: #6b7280; }

/* CALENDAR */
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.cal-nav button {
  background: white; border: 1px solid #e5e7eb;
  border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 1rem;
}
.cal-nav span { font-weight: 600; font-size: 1rem; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 3px; background: white; border-radius: 12px;
  padding: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.cal-day-name {
  text-align: center; font-size: 0.72rem; color: #9ca3af;
  text-transform: uppercase; padding: 4px 0 8px;
}
.cal-day {
  aspect-ratio: 1; border-radius: 8px; padding: 4px;
  font-size: 0.8rem; position: relative; min-height: 44px;
  cursor: default;
}
.cal-day.other-month { color: #d1d5db; }
.cal-day.today-date  { background: #6d28d9; color: white; font-weight: 700; }
.cal-day.has-event   { background: #f5f3ff; cursor: pointer; }
.cal-day .day-num    { font-size: 0.78rem; }
.event-dot { width: 6px; height: 6px; border-radius: 50%; margin: 1px auto 0; }

/* ADD FORM */
.add-form {
  background: white; border-radius: 12px;
  padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.add-form h2 { font-size: 1.1rem; margin-bottom: 4px; }
.form-note { font-size: 0.82rem; color: #6b7280; margin-bottom: 18px; }
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.form-grid label { display: flex; flex-direction: column; font-size: 0.8rem; color: #6b7280; gap: 5px; }
.form-grid input, .form-grid select {
  padding: 9px 12px; border-radius: 8px; border: 1px solid #e5e7eb;
  font-size: 0.9rem; outline: none; color: #1a1a2e;
}
.form-grid input:focus, .form-grid select:focus { border-color: #6d28d9; }
.btn-primary {
  padding: 10px 26px; background: #6d28d9; color: white;
  border: none; border-radius: 50px; font-size: 0.9rem;
  font-weight: 600; cursor: pointer;
}
.btn-primary:hover { background: #5b21b6; }

/* REMINDERS */
.reminder-intro { margin-bottom: 16px; }
.reminder-intro h2 { font-size: 1.1rem; margin-bottom: 4px; }
.reminder-intro p  { font-size: 0.85rem; color: #6b7280; }
.reminder-card {
  background: white; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.reminder-card .icon { font-size: 1.6rem; flex-shrink: 0; }
.reminder-card .text { flex: 1; }
.reminder-card .text strong { display: block; font-size: 0.9rem; }
.reminder-card .text span   { font-size: 0.78rem; color: #6b7280; }
.copy-btn {
  padding: 6px 14px; border-radius: 50px;
  border: 1px solid #e5e7eb; background: white;
  font-size: 0.78rem; cursor: pointer; white-space: nowrap;
  transition: all 0.2s;
}
.copy-btn:hover { border-color: #6d28d9; color: #6d28d9; }

/* EMPTY STATES */
.empty { text-align: center; padding: 50px 20px; color: #9ca3af; font-size: 0.9rem; }

/* RESPONSIVE */
@media (max-width: 500px) {
  header h1 { font-size: 1.4rem; }
  .tabs { gap: 4px; }
  .tab  { font-size: 0.75rem; padding: 7px 8px; }
}