/* RemindMe — Salesforce Lightning-Inspired Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --blue:       #0176D3;
  --blue-dark:  #014486;
  --blue-light: #D8EDFF;
  --navy:       #032D60;
  --bg:         #F3F3F3;
  --surface:    #FFFFFF;
  --border:     #DDDBDA;
  --border-alt: #C9C7C5;
  --text:       #181818;
  --text-muted: #706E6B;
  --text-faint: #AEACAA;
  --green:      #2E844A;
  --green-bg:   #EEF4EE;
  --orange:     #E07000;
  --orange-bg:  #FEF0E1;
  --red:        #BA0517;
  --red-bg:     #FEF1EE;
  --purple:     #7526E3;
  --teal:       #06A59A;
  --teal-bg:    #E8F7F6;
  --gold:       #DD7A01;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:  0 12px 32px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --radius:     6px;
  --radius-lg:  10px;
  --font:       'Inter', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── LAYOUT ── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.app-body { display: flex; flex: 1; }
.main-content { flex: 1; padding: 24px 32px; overflow-x: hidden; }

/* ── TOP NAV ── */
.top-nav {
  background: var(--navy);
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
}
.nav-logo-icon {
  width: 32px; height: 32px;
  background: var(--blue);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.nav-logo-icon svg { width: 18px; height: 18px; color: #fff; }

.search-wrap { flex: 1; max-width: 500px; position: relative; }
.search-wrap input {
  width: 100%;
  height: 32px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 0 36px 0 14px;
  color: #fff;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: background .2s, border-color .2s;
}
.search-wrap input::placeholder { color: rgba(255,255,255,.5); }
.search-wrap input:focus { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); }
.search-wrap .search-icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: rgba(255,255,255,.5); pointer-events: none;
}
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  z-index: 300; overflow: hidden; display: none;
}
.search-dropdown.open { display: block; }
.search-group-label {
  padding: 8px 14px 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
}
.search-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; transition: background .15s;
}
.search-item:hover { background: var(--blue-light); }
.search-item-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue-light); color: var(--blue);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.search-item-icon svg { width: 14px; height: 14px; }
.search-item-name { font-weight: 500; font-size: 13px; }
.search-item-sub { font-size: 12px; color: var(--text-muted); }
.search-empty { padding: 20px 14px; text-align: center; color: var(--text-muted); font-size: 13px; }

.nav-spacer { flex: 1; }
.nav-user {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 6px 10px; border-radius: var(--radius);
  transition: background .15s; color: #fff; position: relative;
}
.nav-user:hover { background: rgba(255,255,255,.1); }
.nav-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.nav-user-name { font-size: 13px; font-weight: 500; }
.nav-user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  min-width: 180px; z-index: 300; overflow: hidden; display: none;
}
.nav-user-menu.open { display: block; }
.nav-user-menu a, .nav-user-menu button {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; color: var(--text); font-size: 13px;
  width: 100%; text-align: left; border: none; background: none;
  cursor: pointer; font-family: var(--font); transition: background .15s;
}
.nav-user-menu a:hover, .nav-user-menu button:hover { background: var(--bg); text-decoration: none; }
.nav-user-menu svg { width: 14px; height: 14px; color: var(--text-muted); }
.nav-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.sidebar-item.donate-btn svg { color: var(--orange); }
.sidebar-item.donate-btn:hover svg { color: var(--orange); }

/* ── SIDEBAR ── */
.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  flex-shrink: 0;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
}
.sidebar-section { padding: 0 12px; margin-bottom: 8px; }
.sidebar-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 8px 12px 4px; display: block;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .15s, color .15s;
  text-decoration: none; margin-bottom: 2px;
}
.sidebar-item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.sidebar-item:hover { background: var(--bg); color: var(--blue); text-decoration: none; }
.sidebar-item:hover svg { color: var(--blue); }
.sidebar-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.sidebar-item.active svg { color: var(--blue); }
.sidebar-badge {
  margin-left: auto; background: var(--blue); color: #fff;
  border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600;
}

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-body { padding: 20px; }

/* ── STAT CARDS ── */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 24px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--stat-color, var(--blue));
}
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1.2; margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; font-family: var(--font);
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  text-decoration: none; white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue-light); }
.btn-neutral { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-neutral:hover { background: var(--bg); }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #8E0415; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 7px; }
.btn-full { width: 100%; justify-content: center; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-label span { color: var(--red); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: var(--font); color: var(--text);
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(1,118,211,.12);
}
.form-input::placeholder { color: var(--text-faint); }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23706E6B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.checkbox-item { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkbox-item input[type="checkbox"] { width: 16px; height: 16px; margin-top: 1px; accent-color: var(--blue); cursor: pointer; flex-shrink: 0; }
.checkbox-label { font-size: 13px; color: var(--text); }
.checkbox-sublabel { font-size: 12px; color: var(--text-muted); }

.input-with-icon { position: relative; }
.input-with-icon .form-input { padding-right: 40px; }
.input-with-icon .input-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-muted); }
.input-with-icon .input-icon svg { width: 16px; height: 16px; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-blue   { background: var(--blue-light); color: var(--blue); }
.badge-green  { background: var(--green-bg); color: var(--green); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-red    { background: var(--red-bg); color: var(--red); }
.badge-teal   { background: var(--teal-bg); color: var(--teal); }
.badge-purple { background: rgba(117,38,227,.1); color: var(--purple); }
.badge-gold   { background: rgba(221,122,1,.1); color: var(--gold); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 16px; text-align: left;
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #F8F8F7; }
.td-name { font-weight: 600; color: var(--blue); cursor: pointer; }
.td-name:hover { text-decoration: underline; }
.table-actions { display: flex; gap: 6px; }

/* ── CALENDAR ── */
.calendar-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.calendar-title { font-size: 16px; font-weight: 700; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day-header {
  padding: 8px 4px; text-align: center;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
.cal-day {
  min-height: 80px; padding: 6px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
  position: relative;
}
.cal-day:hover { background: var(--blue-light); }
.cal-day.other-month { background: #FAFAFA; }
.cal-day.other-month .cal-day-num { color: var(--text-faint); }
.cal-day.today { background: var(--blue-light); }
.cal-day.today .cal-day-num {
  background: var(--blue); color: #fff;
  border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.cal-day-num { font-size: 12px; font-weight: 600; color: var(--text); width: 24px; }
.cal-events { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.cal-event {
  font-size: 10px; padding: 2px 5px; border-radius: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500; cursor: pointer;
}
.cal-event.birthday  { background: rgba(117,38,227,.12); color: var(--purple); }
.cal-event.anniversary { background: var(--teal-bg); color: var(--teal); }
.cal-event.custom    { background: var(--orange-bg); color: var(--orange); }
.cal-more { font-size: 10px; color: var(--blue); font-weight: 600; cursor: pointer; padding: 0 5px; }

/* ── TODAY PANEL ── */
.today-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue-dark) 100%);
  border-radius: var(--radius-lg); padding: 24px;
  color: #fff; margin-bottom: 24px;
}
.today-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.today-title { font-size: 22px; font-weight: 700; margin-top: 4px; }
.today-items { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.today-item {
  background: rgba(255,255,255,.1); border-radius: var(--radius);
  padding: 12px 16px; display: flex; align-items: center; gap: 14px;
}
.today-item-icon { font-size: 20px; flex-shrink: 0; }
.today-item-name { font-weight: 600; font-size: 15px; }
.today-item-type { font-size: 12px; opacity: .7; }
.today-empty { opacity: .6; font-size: 14px; text-align: center; padding: 20px 0; }

/* ── UPCOMING LIST ── */
.upcoming-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.upcoming-item:last-child { border-bottom: none; }
.upcoming-date-chip {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex-shrink: 0; line-height: 1.2;
}
.upcoming-date-chip .month { font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--red); }
.upcoming-date-chip .day   { font-size: 16px; font-weight: 700; color: var(--text); }
.upcoming-name { font-weight: 600; font-size: 13px; }
.upcoming-occasion { font-size: 12px; color: var(--text-muted); }
.upcoming-days-left { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(16px); transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; padding: 4px; border-radius: 4px; }
.modal-close svg { width: 18px; height: 18px; color: var(--text-muted); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── TOAST ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text); color: #fff; padding: 12px 18px;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 500; max-width: 320px;
  display: flex; align-items: center; gap: 10px;
  animation: slideUp .25s ease;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.warning { background: var(--orange); }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── AUTH PAGES ── */
.auth-page { min-height: 100vh; background: var(--navy); display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; overflow: hidden; }
.auth-card-header { background: linear-gradient(135deg, var(--navy) 0%, var(--blue-dark) 100%); padding: 32px; text-align: center; color: #fff; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.auth-logo-icon { width: 40px; height: 40px; background: rgba(255,255,255,.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.auth-logo-icon svg { width: 22px; height: 22px; color: #fff; }
.auth-logo-name { font-size: 20px; font-weight: 700; }
.auth-tagline { font-size: 13px; opacity: .7; }
.auth-card-body { padding: 28px 32px; }
.auth-heading { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: var(--font);
  transition: background .15s; margin-bottom: 10px; color: var(--text);
}
.oauth-btn:hover { background: var(--bg); }
.oauth-btn img { width: 18px; height: 18px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }

/* ── LOADING ── */
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.spinner-dark { border-color: rgba(1,118,211,.2); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #E8E8E8 25%, #F5F5F5 50%, #E8E8E8 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 4px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state-icon { width: 56px; height: 56px; background: var(--bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.empty-state-icon svg { width: 26px; height: 26px; color: var(--text-muted); }
.empty-state h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { font-size: 13px; color: var(--text-muted); max-width: 300px; margin: 0 auto 20px; }

/* ── OCCASION FORM ── */
.occasion-block {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; position: relative;
  background: var(--bg);
}
.occasion-block-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.occasion-block-title { font-size: 13px; font-weight: 600; color: var(--text); }
.remind-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.remind-chip {
  padding: 5px 12px; border: 1px solid var(--border);
  border-radius: 20px; font-size: 12px; cursor: pointer;
  transition: background .15s, border-color .15s; color: var(--text);
  user-select: none;
}
.remind-chip.selected { background: var(--blue-light); border-color: var(--blue); color: var(--blue); font-weight: 600; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-content { padding: 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; }
  .auth-card-body { padding: 24px 20px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
