/* ============================================================
   GIFT GENIE — Complete Design System
   Mobile-first, Material Design inspired
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --primary:        #FF8C00;
  --primary-dark:   #E07800;
  --primary-light:  #FFB347;
  --primary-bg:     #FFF4E6;
  --secondary:      #FFD700;
  --accent:         #4B0082;
  --accent-light:   #7B2FBE;

  --bg:             #F8F4F0;
  --surface:        #FFFFFF;
  --surface-2:      #FAFAFA;
  --border:         #F0EBE4;
  --divider:        #EEE8E0;

  --text-primary:   #1A1204;
  --text-secondary: #6B5E4C;
  --text-hint:      #A89880;

  --status-planned:   #FF8C00;
  --status-purchased: #16A34A;
  --status-delivered: #4B0082;

  --status-planned-bg:   #FFF4E6;
  --status-purchased-bg: #F0FDF4;
  --status-delivered-bg: #F5F0FF;

  --error:          #DC2626;
  --error-bg:       #FEF2F2;
  --success:        #16A34A;
  --success-bg:     #F0FDF4;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);
  --shadow-fab: 0 4px 16px rgba(255,140,0,0.45);

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --app-bar-h:   56px;
  --bottom-nav-h: 64px;
  --fab-size:    56px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button { background: none; border: none; cursor: pointer; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ---- App Layout ---- */
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
}

/* ---- App Bar ---- */
.app-bar {
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--app-bar-h);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}
.app-bar-center {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.app-bar-logo { font-size: 20px; line-height: 1; }
.app-bar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.app-bar-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  transition: background 0.15s;
  position: relative;
  flex-shrink: 0;
}
.app-bar-btn:active { background: var(--border); }
.app-bar-btn .material-icons-round { font-size: 22px; }
.app-bar-actions { display: flex; align-items: center; }

.notif-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

/* ---- Icon Button ---- */
.icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: background 0.15s;
  flex-shrink: 0;
}
.icon-btn:active { background: var(--border); }
.icon-btn .material-icons-round { font-size: 20px; }

/* ---- Main Content ---- */
.main {
  position: fixed;
  top: var(--app-bar-h);
  bottom: var(--bottom-nav-h);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}

/* ---- Screens ---- */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.screen.screen-active {
  opacity: 1;
  pointer-events: auto;
}
.screen-content {
  padding: 16px 16px 24px;
  min-height: 100%;
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--bottom-nav-h);
  background: var(--surface);
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: var(--safe-bottom);
}
.nav-item {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-hint);
  transition: color 0.2s;
  position: relative;
  padding-top: 4px;
}
.nav-item.active { color: var(--primary); }
.nav-icon { font-size: 22px !important; transition: transform 0.2s; }
.nav-item.active .nav-icon { transform: scale(1.05); }
.nav-label { font-size: 10px; font-weight: 500; letter-spacing: 0.2px; }
.nav-item::before {
  content: '';
  position: absolute;
  top: 6px;
  width: 48px; height: 28px;
  background: transparent;
  border-radius: var(--radius-full);
  transition: background 0.2s;
}
.nav-item.active::before { background: var(--primary-bg); }

/* ---- FAB ---- */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  right: calc(50% - min(240px, 50vw) + 16px);
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  z-index: 90;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
}
@media (max-width: 480px) {
  .fab { right: 16px; }
}
.fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(255,140,0,0.3);
}
.fab .material-icons-round { font-size: 24px; transition: transform 0.3s; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-pressable {
  transition: transform 0.15s, box-shadow 0.15s;
}
.card-pressable:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-xs);
}

/* ---- Chips ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.chip-planned   { background: var(--status-planned-bg);   color: var(--status-planned); }
.chip-purchased { background: var(--status-purchased-bg); color: var(--status-purchased); }
.chip-delivered { background: var(--status-delivered-bg); color: var(--status-delivered); }
.chip-default   { background: var(--border); color: var(--text-secondary); }
.chip .material-icons-round { font-size: 12px !important; }

/* ---- Filter Chips ---- */
.filter-chips {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1.5px solid var(--border);
  transition: all 0.2s;
  flex-shrink: 0;
}
.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.filter-chip .material-icons-round { font-size: 14px !important; }

/* ---- Search Bar ---- */
.search-wrap {
  padding: 12px 16px 4px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-full);
  padding: 0 16px;
  height: 44px;
  box-shadow: var(--shadow-xs);
  border: 1.5px solid var(--border);
  transition: border-color 0.2s;
}
.search-field:focus-within { border-color: var(--primary); }
.search-field .material-icons-round { font-size: 20px; color: var(--text-hint); }
.search-field input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-size: 14px;
  color: var(--text-primary);
}
.search-field input::placeholder { color: var(--text-hint); }

/* ---- Section Headers ---- */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 16px 8px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}
.section-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.section-header .view-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* ======================================================
   DASHBOARD
   ====================================================== */
.dashboard-header {
  background: linear-gradient(135deg, var(--primary) 0%, #FF6B00 100%);
  padding: 20px 16px 28px;
  color: white;
  position: relative;
  overflow: hidden;
}
.dashboard-header::before {
  content: '';
  position: absolute;
  top: -30px; right: -20px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.dashboard-header::after {
  content: '';
  position: absolute;
  bottom: -20px; right: 40px;
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.dashboard-greeting {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.85;
  margin-bottom: 4px;
}
.dashboard-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.dashboard-subtitle {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 16px 0;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-icon-wrap {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.stat-icon-wrap .material-icons-round { font-size: 20px; }
.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text-primary);
}
.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.budget-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin: 12px 16px 0;
}
.budget-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.budget-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.budget-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
.budget-breakdown {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}
.budget-item { display: flex; align-items: center; gap: 6px; }
.budget-dot { width: 8px; height: 8px; border-radius: 50%; }
.budget-item-label { font-size: 11px; color: var(--text-secondary); }
.budget-item-val { font-size: 11px; font-weight: 600; color: var(--text-primary); }

/* Upcoming events list */
.upcoming-list { padding: 0 16px; }
.upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-xs);
}
.upcoming-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary-bg);
  flex-shrink: 0;
}
.upcoming-date-day { font-size: 16px; font-weight: 800; color: var(--primary); line-height: 1; }
.upcoming-date-mon { font-size: 10px; font-weight: 600; color: var(--primary); text-transform: uppercase; }
.upcoming-info { flex: 1; min-width: 0; }
.upcoming-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.upcoming-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.upcoming-days {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-bg);
  color: var(--primary);
  white-space: nowrap;
}
.upcoming-days.soon { background: #FEF2F2; color: var(--error); }

/* Recent ideas mini list */
.recent-list { padding: 0 16px; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
}
.recent-item:last-child { border-bottom: none; }
.recent-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.recent-icon .material-icons-round { font-size: 18px; color: var(--primary); }
.recent-info { flex: 1; min-width: 0; }
.recent-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-sub { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.recent-cost {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

/* ======================================================
   IDEAS SCREEN
   ====================================================== */
.ideas-list { padding: 0 16px 16px; }
.idea-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}
.idea-card:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-xs);
}
.idea-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}
.idea-status-bar {
  width: 4px;
  height: 48px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.bar-planned   { background: var(--status-planned); }
.bar-purchased { background: var(--status-purchased); }
.bar-delivered { background: var(--status-delivered); }
.bar-default   { background: var(--border); }

.idea-info { flex: 1; min-width: 0; }
.idea-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.idea-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.idea-recipient, .idea-occasion {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-secondary);
}
.idea-recipient .material-icons-round,
.idea-occasion .material-icons-round { font-size: 12px !important; }

.idea-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.idea-cost {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.idea-more-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-hint);
  transition: background 0.15s;
}
.idea-more-btn:active { background: var(--border); }
.idea-more-btn .material-icons-round { font-size: 18px !important; }

/* Context Menu */
.ctx-menu {
  position: fixed;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  overflow: hidden;
  min-width: 160px;
  animation: menuIn 0.15s ease;
}
@keyframes menuIn {
  from { opacity: 0; transform: scale(0.9) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.ctx-item:active { background: var(--border); }
.ctx-item .material-icons-round { font-size: 18px !important; color: var(--text-secondary); }
.ctx-item.danger { color: var(--error); }
.ctx-item.danger .material-icons-round { color: var(--error); }
.ctx-divider { height: 1px; background: var(--divider); }

/* ======================================================
   OCCASIONS SCREEN
   ====================================================== */
.occasions-list { padding: 0 16px 80px; }
.occasion-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  position: relative;
}
.occasion-card:active { transform: scale(0.985); }
.occasion-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}
.occasion-type-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}
.occasion-info { flex: 1; min-width: 0; }
.occasion-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.occasion-date { font-size: 12px; color: var(--text-secondary); }
.occasion-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.occasion-ideas-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-bg);
  color: var(--primary);
}
.occasion-days {
  font-size: 11px;
  color: var(--text-hint);
}
.occasion-days.past { color: var(--text-hint); }
.occasion-days.soon { color: var(--error); font-weight: 600; }
.occasion-days.upcoming { color: var(--primary); font-weight: 600; }

/* ======================================================
   RECIPIENTS SCREEN
   ====================================================== */
.recipients-list { padding: 0 16px 80px; }
.recipient-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  position: relative;
}
.recipient-card:active { transform: scale(0.985); }
.recipient-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}
.recipient-avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.recipient-info { flex: 1; min-width: 0; }
.recipient-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.recipient-relationship { font-size: 12px; color: var(--text-secondary); }
.recipient-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.recipient-ideas-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-bg);
  color: var(--primary);
}
.recipient-budget {
  font-size: 11px;
  color: var(--text-hint);
}

/* ======================================================
   EMPTY STATE
   ====================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
  gap: 12px;
}
.empty-icon {
  width: 80px; height: 80px;
  border-radius: var(--radius-xl);
  background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.empty-icon .material-icons-round { font-size: 40px; color: var(--primary); }
.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.empty-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 240px;
}
.empty-action {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-fab);
  transition: transform 0.15s, opacity 0.15s;
}
.empty-action:active { transform: scale(0.95); opacity: 0.9; }
.empty-action .material-icons-round { font-size: 18px !important; }

/* ======================================================
   BOTTOM SHEET
   ====================================================== */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s;
}
.backdrop.visible { opacity: 1; }

.bottom-sheet {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(110%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 160;
  display: flex;
  flex-direction: column;
  max-height: 90dvh;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.12);
}
.bottom-sheet.sheet-open {
  transform: translateX(-50%) translateY(0);
}
.sheet-handle-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.sheet-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.sheet-close-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: var(--bg);
  transition: background 0.15s;
}
.sheet-close-btn:active { background: var(--border); }
.sheet-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet-body { padding: 16px 16px 32px; }

/* ======================================================
   FORMS
   ====================================================== */
.form-group { margin-bottom: 18px; position: relative; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-label .required { color: var(--error); margin-left: 2px; }
.form-input {
  width: 100%;
  height: 48px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,140,0,0.12);
}
.form-textarea {
  width: 100%;
  min-height: 90px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,140,0,0.12);
}
.form-select {
  width: 100%;
  height: 48px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 36px 0 14px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%239E9E9E'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s;
}
.form-select:focus { border-color: var(--primary); }
.cost-input-wrap {
  position: relative;
}
.cost-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  pointer-events: none;
}
.cost-input-wrap .form-input { padding-left: 26px; }
.form-error {
  font-size: 11px;
  color: var(--error);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.form-error .material-icons-round { font-size: 12px !important; }
.form-hint { font-size: 11px; color: var(--text-hint); margin-top: 4px; }

.status-selector {
  display: flex;
  gap: 8px;
}
.status-option {
  flex: 1;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
  color: var(--text-secondary);
}
.status-option.selected-planned   { border-color: var(--status-planned);   background: var(--status-planned-bg);   color: var(--status-planned); }
.status-option.selected-purchased { border-color: var(--status-purchased); background: var(--status-purchased-bg); color: var(--status-purchased); }
.status-option.selected-delivered { border-color: var(--status-delivered); background: var(--status-delivered-bg); color: var(--status-delivered); }

/* Form actions */
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.btn-primary {
  flex: 1;
  height: 50px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(255,140,0,0.3);
  transition: transform 0.15s, opacity 0.15s;
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary .material-icons-round { font-size: 18px !important; }
.btn-secondary {
  height: 50px;
  padding: 0 20px;
  background: var(--bg);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-secondary:active { background: var(--border); }

/* ======================================================
   DETAIL MODAL
   ====================================================== */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 170;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.detail-overlay.detail-open {
  transform: translateY(0);
}
.detail-screen {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.detail-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--app-bar-h);
  padding: 0 8px;
  box-shadow: 0 1px 0 var(--border);
  z-index: 10;
}
.detail-header-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
}
.detail-header-actions { display: flex; align-items: center; }
.detail-hero {
  padding: 24px 16px 16px;
  text-align: center;
}
.detail-status-icon {
  width: 72px; height: 72px;
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
}
.detail-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.detail-cost-big {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -1px;
}
.detail-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.detail-section {
  padding: 0 16px 16px;
}
.detail-info-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
}
.detail-row:last-child { border-bottom: none; }
.detail-row-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.detail-row-icon .material-icons-round { font-size: 16px !important; color: var(--primary); }
.detail-row-content { flex: 1; }
.detail-row-label { font-size: 11px; color: var(--text-hint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.detail-row-value { font-size: 14px; color: var(--text-primary); font-weight: 500; margin-top: 2px; line-height: 1.4; }
.detail-actions { padding: 16px; display: flex; gap: 10px; }
.btn-edit {
  flex: 1;
  height: 50px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(255,140,0,0.3);
  transition: transform 0.15s;
}
.btn-edit:active { transform: scale(0.97); }
.btn-delete {
  height: 50px; width: 50px;
  background: var(--error-bg);
  color: var(--error);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.btn-delete:active { transform: scale(0.95); }
.btn-delete .material-icons-round { font-size: 20px !important; }

/* ======================================================
   DIALOG
   ====================================================== */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.dialog {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px 20px 20px;
  width: 100%;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  animation: dialogIn 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes dialogIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
.dialog-icon-wrap {
  width: 56px; height: 56px;
  border-radius: var(--radius-full);
  background: var(--error-bg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.dialog-icon-wrap .material-icons-round { font-size: 28px; color: var(--error); }
.dialog-title { font-size: 17px; font-weight: 700; text-align: center; color: var(--text-primary); margin-bottom: 8px; }
.dialog-message { font-size: 14px; text-align: center; color: var(--text-secondary); line-height: 1.5; }
.dialog-actions { display: flex; gap: 10px; margin-top: 20px; }
.dialog-btn {
  flex: 1;
  height: 46px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  transition: opacity 0.15s, transform 0.15s;
}
.dialog-btn:active { transform: scale(0.96); }
.dialog-cancel {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.dialog-confirm {
  background: var(--error);
  color: white;
  box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}

/* ======================================================
   SNACKBAR
   ====================================================== */
.snackbar {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  left: 16px; right: 16px;
  max-width: calc(480px - 32px);
  margin: 0 auto;
  background: #1A1204;
  color: white;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 400;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.32,0.72,0,1), opacity 0.3s;
}
.snackbar.snackbar-show {
  transform: translateY(0);
  opacity: 1;
}
.snackbar-icon { font-size: 18px !important; flex-shrink: 0; color: #4ade80; }
.snackbar-icon.error { color: #f87171; }
.snackbar-msg { flex: 1; font-size: 14px; font-weight: 500; }
.snackbar-action {
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: 0.5px;
  padding: 4px 0;
  flex-shrink: 0;
}

/* ======================================================
   OCCASION TYPE ICONS (emoji backgrounds)
   ====================================================== */
.occ-birthday   { background: #FFF4E6; }
.occ-christmas  { background: #F0FDF4; }
.occ-anniversary{ background: #FFF1F2; }
.occ-wedding    { background: #FFF1F2; }
.occ-graduation { background: #EFF6FF; }
.occ-other      { background: var(--primary-bg); }

/* ======================================================
   UTILITY CLASSES
   ====================================================== */
.hidden { display: none !important; }
.pb-80  { padding-bottom: 80px; }
.pb-96  { padding-bottom: 96px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }

.text-center { text-align: center; }
.text-muted  { color: var(--text-secondary); font-size: 13px; }

/* Separator */
.separator { height: 8px; background: var(--bg); }

/* ======================================================
   SCROLLBAR STYLING
   ====================================================== */
.screen::-webkit-scrollbar { display: none; }
.sheet-scroll::-webkit-scrollbar { display: none; }
.detail-screen::-webkit-scrollbar { display: none; }

/* ======================================================
   ANIMATIONS
   ====================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-fade-up {
  animation: fadeInUp 0.3s ease forwards;
}
.anim-delay-1 { animation-delay: 0.05s; opacity: 0; }
.anim-delay-2 { animation-delay: 0.1s;  opacity: 0; }
.anim-delay-3 { animation-delay: 0.15s; opacity: 0; }
.anim-delay-4 { animation-delay: 0.2s;  opacity: 0; }
.anim-delay-5 { animation-delay: 0.25s; opacity: 0; }

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,140,0,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Notification panel */
.notif-panel {
  position: fixed;
  top: var(--app-bar-h);
  right: 0;
  left: 50%;
  transform: translateX(0%);
  max-width: 480px;
  margin-left: -480px;
  background: var(--surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 120;
  overflow: hidden;
  transition: transform 0.3s, opacity 0.3s;
}
.notif-panel.hidden {
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
}
