/* ══════════════════════════════════════════════════════
   GIFT IDEA JAR — Design System
   Mobile-first, Material Design inspired
   ══════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────── */
:root {
  --primary:       #FF6F61;
  --primary-dark:  #e85d50;
  --primary-light: #ffe8e6;
  --secondary:     #FFD700;
  --secondary-light: #fff8cc;
  --accent:        #4CAF50;
  --accent-light:  #e8f5e9;

  --bg:            #f7f4f2;
  --surface:       #ffffff;
  --surface-2:     #fdf9f8;
  --border:        #ede8e6;

  --text-primary:  #1a1a1a;
  --text-secondary:#6b6360;
  --text-hint:     #a09896;
  --text-on-primary:#ffffff;

  --shadow-sm:  0 1px 4px rgba(0,0,0,.08), 0 0 1px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  --shadow-fab: 0 6px 20px rgba(255,111,97,.45);

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --nav-h:      64px;
  --bar-h:      58px;
  --transition: 280ms cubic-bezier(.4,0,.2,1);

  /* category colours */
  --c-tech:    #5C6BC0;
  --c-books:   #26A69A;
  --c-clothing:#EC407A;
  --c-jewelry: #AB47BC;
  --c-home:    #8D6E63;
  --c-food:    #FF7043;
  --c-exp:     #42A5F5;
  --c-toys:    #FFCA28;
  --c-beauty:  #EF5350;
  --c-sports:  #66BB6A;
  --c-art:     #FFA726;
  --c-other:   #78909C;
}

/* ── Reset & Base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ── App Shell ──────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,.2);
}

/* ── App Bar ────────────────────────────────────────── */
.app-bar {
  height: var(--bar-h);
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 4px;
  position: relative;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.app-bar-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -.3px;
}

.app-bar-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: background var(--transition);
  flex-shrink: 0;
}
.app-bar-btn:active { background: rgba(0,0,0,.06); }
.app-bar-btn svg { width: 22px; height: 22px; }
.app-bar-btn.hidden { visibility: hidden; pointer-events: none; }

/* ── Screen Container ───────────────────────────────── */
.screen-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(30px);
  transition: opacity var(--transition), transform var(--transition);
  will-change: transform, opacity;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

.screen.slide-screen {
  transform: translateX(100%);
}
.screen.slide-screen.active {
  transform: translateX(0);
}

.screen-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 0;
}

/* Custom scrollbar */
.screen-scroll::-webkit-scrollbar { width: 3px; }
.screen-scroll::-webkit-scrollbar-track { background: transparent; }
.screen-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.bottom-spacer { height: 100px; }

/* ── Bottom Navigation ──────────────────────────────── */
.bottom-nav {
  height: var(--nav-h);
  background: var(--surface);
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-hint);
  transition: color var(--transition);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  padding: 8px 4px;
}

.nav-tab::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
  transition: width var(--transition);
}

.nav-tab.active { color: var(--primary); }
.nav-tab.active::before { width: 32px; }

.nav-tab-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}
.nav-tab.active .nav-tab-icon { transform: scale(1.1); }
.nav-tab-icon svg { width: 24px; height: 24px; }

.nav-tab-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .2px;
  line-height: 1;
}

/* Ripple on nav tap */
.nav-tab:active .nav-tab-icon { transform: scale(.92); }

/* ── FAB ────────────────────────────────────────────── */
.fab {
  position: absolute;
  bottom: calc(var(--nav-h) + 18px);
  right: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  z-index: 90;
  transition: transform 200ms cubic-bezier(.34,1.56,.64,1), box-shadow 200ms;
  -webkit-tap-highlight-color: transparent;
}
.fab svg { width: 24px; height: 24px; }
.fab:active { transform: scale(.9); box-shadow: 0 3px 10px rgba(255,111,97,.3); }
.fab.hide { transform: scale(0); pointer-events: none; }

/* ── Hero Card ──────────────────────────────────────── */
.hero-card {
  margin: 14px 14px 8px;
  background: linear-gradient(135deg, var(--primary) 0%, #ff8a80 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.hero-card-inner {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-greeting {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  margin-bottom: 4px;
}

.hero-heading {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 6px;
}

.hero-sub {
  font-size: 13px;
  color: rgba(255,255,255,.8);
  font-weight: 400;
}

.hero-jar {
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.15));
}

/* ── Stats Row ──────────────────────────────────────── */
.stats-row {
  display: flex;
  gap: 10px;
  padding: 0 14px;
  margin-bottom: 4px;
}

.stat-card {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 10px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon-primary { background: var(--primary-light); color: var(--primary); }
.stat-icon-accent  { background: var(--accent-light);  color: var(--accent); }
.stat-icon-secondary { background: var(--secondary-light); color: #b8860b; }

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 10.5px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: .2px;
}

/* ── Section Headers ────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 8px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.2px;
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background var(--transition);
}
.section-link:active { background: var(--primary-light); }

/* ── Chip Scroll Row (Upcoming Occasions) ───────────── */
.chip-scroll-row {
  display: flex;
  gap: 10px;
  padding: 0 16px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chip-scroll-row::-webkit-scrollbar { display: none; }

.occasion-chip {
  flex-shrink: 0;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  min-width: 130px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: transform 160ms, box-shadow 160ms;
  border: 1.5px solid transparent;
}
.occasion-chip:active { transform: scale(.97); }
.occasion-chip.has-reminder { border-color: var(--accent); }

.occasion-chip-icon { font-size: 24px; line-height: 1; }
.occasion-chip-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.occasion-chip-count { font-size: 11.5px; color: var(--text-secondary); }
.occasion-chip-reminder { font-size: 10.5px; color: var(--accent); font-weight: 600; margin-top: 2px; }

/* ── Category Distribution Chart ───────────────────── */
.category-chart-list {
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-bar-row {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.category-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.category-bar-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-bar-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.category-bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 600ms cubic-bezier(.4,0,.2,1);
}

/* ── Gift List Items ────────────────────────────────── */
.gift-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  margin: 0 14px 8px;
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 140ms, box-shadow 140ms;
  -webkit-tap-highlight-color: transparent;
}
.gift-list-item:active { transform: scale(.985); box-shadow: var(--shadow-sm); }

.gift-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  position: relative;
}

.gift-avatar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gift-avatar-badge svg { width: 8px; height: 8px; color: #fff; fill: #fff; }

.gift-info { flex: 1; min-width: 0; }

.gift-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.gift-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gift-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
}

.gift-badge-occasion {
  background: var(--secondary-light);
  color: #a07000;
}

.gift-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.gift-chevron {
  color: var(--border);
  flex-shrink: 0;
}
.gift-chevron svg { width: 18px; height: 18px; }

/* ── Search Bar ─────────────────────────────────────── */
.search-wrap {
  padding: 12px 14px 4px;
}

.search-bar {
  background: var(--surface);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 44px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  gap: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon { width: 18px; height: 18px; color: var(--text-hint); flex-shrink: 0; }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-size: 14px;
  color: var(--text-primary);
}
.search-input::placeholder { color: var(--text-hint); }

.search-clear {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text-hint);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.search-clear svg { width: 12px; height: 12px; }
.search-clear.visible { opacity: 1; pointer-events: all; }

/* ── Filter Chips ───────────────────────────────────── */
.chip-row {
  display: flex;
  gap: 8px;
  padding: 8px 14px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface);
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.chip:active { transform: scale(.95); }
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,111,97,.35);
}

/* ── Occasions Screen ───────────────────────────────── */
.occasion-section { margin-bottom: 4px; }

.occasion-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}

.occasion-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.occasion-section-emoji { font-size: 22px; }

.occasion-section-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.occasion-section-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--border);
  padding: 2px 8px;
  border-radius: 20px;
}

.occasion-reminder-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  transition: background var(--transition);
}
.occasion-reminder-btn:active { background: #ffd0cc; }
.occasion-reminder-btn svg { width: 14px; height: 14px; }
.occasion-reminder-btn.set { color: var(--accent); background: var(--accent-light); }

/* ── Wishlist Banner ────────────────────────────────── */
.wishlist-banner {
  margin: 14px 14px 4px;
  background: linear-gradient(135deg, #FF6F61 0%, #ff9a8b 50%, #FFD700 100%);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-md);
}

.wishlist-banner-icon { font-size: 42px; line-height: 1; }
.wishlist-banner-title { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.wishlist-banner-sub { font-size: 12.5px; color: rgba(255,255,255,.85); }

/* ── Detail Screen ──────────────────────────────────── */
.detail-cover {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  position: relative;
}

.detail-cover-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.detail-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms;
}
.detail-action-btn:active { transform: scale(.9); }
.detail-action-btn svg { width: 18px; height: 18px; }
.detail-action-btn.fav-active { background: var(--primary); color: #fff; }
.detail-action-btn.fav-active svg { fill: #fff; stroke: none; }

.detail-body { padding: 0 16px 24px; }

.detail-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
}

.detail-chip-cat { background: var(--primary-light); color: var(--primary); }
.detail-chip-occ { background: var(--secondary-light); color: #8a6800; }
.detail-chip-fav { background: var(--accent-light); color: var(--accent); }

.detail-price-card {
  background: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-price-icon {
  width: 42px;
  height: 42px;
  background: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}

.detail-price-label { font-size: 11px; color: var(--text-secondary); font-weight: 500; margin-bottom: 2px; }
.detail-price-value { font-size: 24px; font-weight: 700; color: var(--primary); }

.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin: 16px 0 8px;
}

.detail-description {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.detail-meta-row:last-child { border-bottom: none; }

.detail-meta-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.detail-meta-label { font-size: 11px; color: var(--text-hint); font-weight: 500; }
.detail-meta-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }

.detail-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
}

.btn-edit {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(255,111,97,.35);
  transition: transform 160ms, box-shadow 160ms;
}
.btn-edit:active { transform: scale(.97); box-shadow: 0 2px 8px rgba(255,111,97,.2); }
.btn-edit svg { width: 18px; height: 18px; }

.btn-delete {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: #fde8e8;
  color: #e53935;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.btn-delete:active { background: #fcc; }
.btn-delete svg { width: 20px; height: 20px; }

/* ── Bottom Sheet ───────────────────────────────────── */
.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  backdrop-filter: blur(2px);
}
.sheet-overlay.visible { opacity: 1; pointer-events: all; }

.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 210;
  transform: translateY(100%);
  transition: transform 340ms cubic-bezier(.4,0,.2,1);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.bottom-sheet.open { transform: translateY(0); }

.sheet-drag-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.sheet-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition);
}
.sheet-close-btn:active { background: var(--border); }
.sheet-close-btn svg { width: 16px; height: 16px; }

.sheet-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

/* ── Form Fields ────────────────────────────────────── */
.field-wrap {
  position: relative;
  margin-bottom: 16px;
}

.field-input {
  width: 100%;
  height: 52px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 12px 6px;
  font-size: 14.5px;
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

.field-textarea {
  height: auto;
  min-height: 80px;
  resize: none;
  padding: 20px 12px 8px;
  line-height: 1.5;
}

.field-select {
  cursor: pointer;
  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='%236b6360' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--surface);
}

.field-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14.5px;
  color: var(--text-hint);
  pointer-events: none;
  transition: all 200ms cubic-bezier(.4,0,.2,1);
  background: transparent;
}

.field-textarea ~ .field-label { top: 20px; transform: none; }

.field-input:focus ~ .field-label,
.field-input:not(:placeholder-shown) ~ .field-label {
  top: 8px;
  transform: none;
  font-size: 10.5px;
  color: var(--primary);
  font-weight: 600;
}

.field-textarea:focus ~ .field-label,
.field-textarea:not(:placeholder-shown) ~ .field-label {
  top: 6px;
  font-size: 10.5px;
  color: var(--primary);
  font-weight: 600;
}

.field-label-active {
  top: 8px !important;
  transform: none !important;
  font-size: 10.5px !important;
  color: var(--primary) !important;
  font-weight: 600 !important;
}

.select-wrap { position: relative; }
.select-wrap .field-label { top: 8px; transform: none; font-size: 10.5px; font-weight: 600; color: var(--primary); }

.field-row {
  display: flex;
  gap: 12px;
}
.flex-1 { flex: 1; min-width: 0; }

.field-error {
  font-size: 11px;
  color: #e53935;
  font-weight: 500;
  padding: 3px 0 0 12px;
  display: block;
  min-height: 16px;
}

.required { color: var(--primary); }

/* ── Toggle Switch ──────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  margin-bottom: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.toggle-label {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-switch { position: relative; }
.toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  display: block;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--border);
  position: relative;
  transition: background var(--transition);
  cursor: pointer;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: transform var(--transition);
}
.toggle-input:checked ~ .toggle-track { background: var(--primary); }
.toggle-input:checked ~ .toggle-track::after { transform: translateX(20px); }

/* ── Save Button ────────────────────────────────────── */
.btn-save {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(255,111,97,.35);
  transition: transform 160ms, box-shadow 160ms, background 160ms;
  margin-top: 4px;
}
.btn-save:active { transform: scale(.97); box-shadow: 0 2px 6px rgba(255,111,97,.2); }
.btn-save:disabled { background: var(--border); box-shadow: none; color: var(--text-hint); }

/* ── Dialog ─────────────────────────────────────────── */
.dialog-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  backdrop-filter: blur(3px);
}
.dialog-overlay.visible { opacity: 1; pointer-events: all; }

.dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%) scale(.92);
  width: calc(100% - 48px);
  max-width: 340px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 24px 20px;
  z-index: 310;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 260ms cubic-bezier(.34,1.3,.64,1);
  text-align: center;
}
.dialog.visible {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.dialog-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.dialog-icon-wrap svg { width: 28px; height: 28px; }
.dialog-icon-danger { background: #fde8e8; color: #e53935; }
.dialog-icon-primary { background: var(--primary-light); color: var(--primary); }

.dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.dialog-msg {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 24px;
}

.dialog-actions {
  display: flex;
  gap: 10px;
}

.dialog-btn {
  flex: 1;
  height: 44px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  transition: transform 140ms, background 140ms;
}
.dialog-btn:active { transform: scale(.97); }

.dialog-btn-cancel {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.dialog-btn-cancel:active { background: var(--border); }

.dialog-btn-danger { background: #e53935; color: #fff; }
.dialog-btn-danger:active { background: #c62828; }

.dialog-btn-primary { background: var(--primary); color: #fff; }
.dialog-btn-primary:active { background: var(--primary-dark); }

/* ── Snackbar ───────────────────────────────────────── */
.snackbar {
  position: absolute;
  bottom: calc(var(--nav-h) + 12px);
  left: 14px;
  right: 14px;
  background: #1a1a1a;
  color: #fff;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  z-index: 400;
  opacity: 0;
  transform: translateY(20px);
  transition: all 300ms cubic-bezier(.4,0,.2,1);
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
}
.snackbar.show {
  opacity: 1;
  transform: translateY(0);
}
.snackbar-icon { font-size: 16px; }

/* ── Empty State ────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 16px;
  opacity: .7;
}

.empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
  max-width: 260px;
}

.empty-btn {
  height: 44px;
  padding: 0 24px;
  border-radius: var(--radius-xl);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(255,111,97,.35);
  transition: transform 140ms;
}
.empty-btn:active { transform: scale(.96); }

/* ── Skeleton Loading ───────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -300px 0; }
  100% { background-position: 300px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #f0ebe9 50%, var(--border) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}

.skeleton-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  margin: 0 14px 8px;
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.skeleton-avatar { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line-1 { height: 14px; width: 60%; }
.skeleton-line-2 { height: 11px; width: 40%; }

/* ── Utilities ──────────────────────────────────────── */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-hint      { color: var(--text-hint); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ── Responsive (desktop preview) ──────────────────── */
@media (min-width: 500px) {
  #app { border-radius: 36px; height: 90vh; margin-top: 5vh; }
}
