/* ===================================================
   新家装修灵感本 - 主样式
   =================================================== */

:root {
  --primary: #FF6B35;
  --primary-light: #FFF3EE;
  --primary-dark: #E05520;
  --accent: #4ECDC4;
  --bg: #F7F8FA;
  --card-bg: #FFFFFF;
  --sidebar-bg: #FFFFFF;
  --text: #1A1A2E;
  --text-muted: #7B8494;
  --border: #E8EAF0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.16);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 220px;
  --topbar-h: 60px;
  --filter-h: 44px;
  --mobile-nav-h: 60px;

  /* Priority colors */
  --must: #F03E3E;
  --want: #F59F00;
  --optional: #37B24D;

  /* Status colors */
  --status-pending: #868E96;
  --status-confirmed: #228BE6;
  --status-in_progress: #F59F00;
  --status-done: #37B24D;
  --status-abandoned: #CED4DA;
}

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

html, body {
  height: 100%;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* ===== TOP BAR ===== */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.top-bar-left { display: flex; align-items: center; gap: 10px; }
.top-bar-right { display: flex; align-items: center; gap: 8px; }

.app-logo { font-size: 24px; }
.app-title-wrap { display: flex; flex-direction: column; gap: 1px; }
.app-title { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }

.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 20px;
}
.countdown-badge.delivered { color: #37B24D; background: #EBFBEE; }

.btn-add-main {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-add-main:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-add-main:active { transform: translateY(0); }

.btn-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all .2s;
}
.btn-icon:hover { background: var(--bg); color: var(--primary); }

/* ===== SEARCH BAR ===== */
.search-bar-wrap {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  height: 0;
  overflow: hidden;
  z-index: 99;
  background: white;
  border-bottom: 1px solid var(--border);
  transition: height .25s ease;
}
.search-bar-wrap.visible { height: 52px; }
.search-inner {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 10px;
}
.search-icon { color: var(--text-muted); }
.search-inner input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  background: transparent;
}
.btn-search-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
}

/* ===== FILTER STRIP ===== */
.filter-strip {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  z-index: 98;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: top .25s ease;
}
.search-bar-wrap.visible ~ .filter-strip { top: calc(var(--topbar-h) + 52px); }

.filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-pills::-webkit-scrollbar { display: none; }

.pill {
  white-space: nowrap;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .2s;
}
.pill.active, .pill:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.pill.must.active  { background: var(--must);     border-color: var(--must); }
.pill.want.active  { background: var(--want);     border-color: var(--want); }
.pill.optional.active { background: var(--optional); border-color: var(--optional); }

/* ===== APP LAYOUT ===== */
.app-layout {
  display: flex;
  margin-top: calc(var(--topbar-h) + 88px); /* topbar + 2 filter rows */
  min-height: calc(100vh - var(--topbar-h) - 88px);
  padding-bottom: var(--mobile-nav-h);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  position: fixed;
  top: calc(var(--topbar-h) + 88px);
  bottom: 0;
  left: 0;
  z-index: 50;
  padding-bottom: 20px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 14px 16px 6px;
}

.zone-list { list-style: none; }
.zone-group-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 16px 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.zone-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  cursor: pointer;
  border-radius: 0;
  transition: background .15s;
  position: relative;
}
.zone-item:hover { background: var(--bg); }
.zone-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.zone-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.zone-icon { font-size: 16px; }
.zone-name { flex: 1; font-size: 13px; }
.zone-count {
  font-size: 11px;
  background: var(--border);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
}
.zone-item.active .zone-count {
  background: var(--primary);
  color: white;
}
.dog-zone .zone-icon { filter: none; }
.dog-zone.active { color: #E67700; background: #FFF9DB; }
.dog-zone.active::before { background: #E67700; }
.dog-zone.active .zone-count { background: #E67700; }

/* Sidebar stats */
.sidebar-stats {
  margin: 12px 12px 0;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 3px 0;
  color: var(--text-muted);
}
.stat-row span:last-child {
  font-weight: 700;
  color: var(--text);
}

/* ===== CONTENT AREA ===== */
.content-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 16px;
  min-width: 0;
  overflow-y: auto;
}

/* Zone header */
.zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}
.zone-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.zone-header-left span { font-size: 22px; }
.zone-header-left h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.idea-total {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--border);
  border-radius: 12px;
  padding: 2px 10px;
}
.zone-header-right { display: flex; align-items: center; gap: 8px; }

.sort-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  background: white;
  cursor: pointer;
  outline: none;
}

/* ===== IDEA GRID ===== */
.ideas-grid.card-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.ideas-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.idea-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all .2s;
  overflow: hidden;
  border: 1.5px solid transparent;
  position: relative;
}
.idea-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.idea-card.priority-must { border-left: 3px solid var(--must); }
.idea-card.priority-want { border-left: 3px solid var(--want); }
.idea-card.priority-optional { border-left: 3px solid var(--optional); }

.card-cover {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: var(--bg);
}
.card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.idea-card:hover .card-cover img { transform: scale(1.03); }

.card-body { padding: 12px; }

.card-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.priority-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.priority-dot.must     { background: var(--must); }
.priority-dot.want     { background: var(--want); }
.priority-dot.optional { background: var(--optional); }

.zone-mini-badge {
  font-size: 11px;
  background: var(--bg);
  border-radius: 6px;
  padding: 2px 7px;
  color: var(--text-muted);
}

.card-status {
  font-size: 11px;
  border-radius: 6px;
  padding: 2px 7px;
  font-weight: 500;
  margin-left: auto;
}
.status-pending     { background: #F1F3F5; color: var(--status-pending); }
.status-confirmed   { background: #E7F5FF; color: var(--status-confirmed); }
.status-in_progress { background: #FFF9DB; color: var(--status-in_progress); }
.status-done        { background: #EBFBEE; color: var(--status-done); }
.status-abandoned   { background: #F1F3F5; color: #ADB5BD; text-decoration: line-through; }

.dog-badge {
  font-size: 13px;
  cursor: default;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-content {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag-badge {
  font-size: 11px;
  background: #EFF6FF;
  color: #1971C2;
  border-radius: 4px;
  padding: 1px 6px;
}

.card-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.card-budget { font-size: 11px; color: #868E96; }

.platform-mini {
  font-size: 11px;
  border-radius: 4px;
  padding: 1px 6px;
}
.platform-douyin   { background: #000; color: #fff; }
.platform-xhs      { background: #FF2442; color: #fff; }
.platform-bili     { background: #00AEEC; color: #fff; }
.platform-weibo    { background: #E6162D; color: #fff; }
.platform-other    { background: #868E96; color: #fff; }
.platform-manual   { background: #F1F3F5; color: #495057; }

.card-link {
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
}
.card-link:hover { color: var(--primary); }

.card-time {
  font-size: 11px;
  color: #CED4DA;
  margin-top: 8px;
}

/* List view override */
.ideas-grid.list-view .idea-card {
  display: flex;
  border-left: none;
  border-bottom: 2px solid transparent;
}
.ideas-grid.list-view .idea-card.priority-must { border-bottom-color: var(--must); }
.ideas-grid.list-view .idea-card.priority-want { border-bottom-color: var(--want); }
.ideas-grid.list-view .idea-card.priority-optional { border-bottom-color: var(--optional); }
.ideas-grid.list-view .card-cover { width: 120px; height: auto; flex-shrink: 0; }
.ideas-grid.list-view .card-body { flex: 1; }

/* ===== EMPTY / LOADING ===== */
.empty-state {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 10px;
}
.empty-icon { font-size: 60px; }
.empty-title { font-size: 18px; font-weight: 600; color: var(--text); }
.empty-sub { font-size: 14px; color: var(--text-muted); max-width: 280px; }
.empty-state .btn-add-main { margin-top: 10px; }

.loading-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: var(--text-muted);
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 0;
}
.page-btn {
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}
.page-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.page-info { font-size: 13px; color: var(--text-muted); }

/* ===== MOBILE NAV ===== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  flex: 1;
  padding: 8px 0;
  transition: color .2s;
}
.mobile-nav-btn i { font-size: 20px; }
.mobile-nav-btn.active { color: var(--primary); }

.fab-trigger { position: relative; }
.fab-circle {
  width: 48px; height: 48px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(255,107,53,.4);
  margin-bottom: 2px;
  transition: transform .2s;
}
.fab-trigger:active .fab-circle { transform: scale(.94); }

/* ===== DRAWER ===== */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 300;
  opacity: 0;
  transition: opacity .3s;
}
.drawer-overlay.show { display: block; opacity: 1; }

.zone-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-radius: 20px 20px 0 0;
  z-index: 310;
  padding: 0 0 20px;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
  max-height: 80vh;
  overflow-y: auto;
}
.zone-drawer.open { transform: translateY(0); }

.drawer-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 4px;
}
.drawer-title {
  font-size: 16px;
  font-weight: 700;
  padding: 10px 20px 6px;
  color: var(--text);
}
.drawer-zone-list .zone-item { padding: 12px 20px; }
.drawer-zone-list .zone-group-label { padding: 10px 20px 4px; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }

.modal {
  background: white;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp .3s cubic-bezier(.32,.72,0,1);
}
@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: white;
}

/* Form elements */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.label-sub { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.required { color: var(--primary); }

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,.12);
}
.form-group textarea { resize: vertical; min-height: 80px; }

.char-count {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: -4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group.half {}

/* URL input */
.url-input-row {
  display: flex;
  gap: 8px;
}
.url-input-row input { flex: 1; }
.btn-parse {
  width: 40px; height: 40px;
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  transition: all .2s;
}
.btn-parse:hover { background: var(--primary); color: white; }

.url-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  flex-wrap: wrap;
}
.preview-link {
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}
.preview-link:hover { text-decoration: underline; }
.preview-open-hint { color: var(--text-muted); font-size: 11px; }

/* Platform badge */
.platform-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.platform-badge.platform-douyin   { background: #000; color: #fff; }
.platform-badge.platform-xhs      { background: #FF2442; color: #fff; }
.platform-badge.platform-bili     { background: #00AEEC; color: #fff; }
.platform-badge.platform-weibo    { background: #E6162D; color: #fff; }
.platform-badge.platform-other    { background: #868E96; color: #fff; }
.platform-badge.platform-manual   { background: #F1F3F5; color: #495057; }

/* Zone select grid */
.zone-select-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.zone-select-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  transition: all .15s;
  text-align: center;
  line-height: 1.3;
}
.zone-select-btn span:first-child { font-size: 18px; }
.zone-select-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.zone-select-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* Dog toggle */
.dog-toggle-wrap { justify-content: flex-start; }
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.toggle-switch input { display: none; }
.toggle-track {
  width: 44px; height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: left .2s;
}
.toggle-switch input:checked ~ .toggle-track { background: #E67700; }
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { left: 22px; }
.toggle-label { font-size: 13px; color: var(--text-muted); }

/* Priority buttons */
.priority-btns { display: flex; gap: 6px; }
.priority-btn {
  flex: 1;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  white-space: nowrap;
}
.priority-btn.must.active   { background: #FFF5F5; border-color: var(--must);     color: var(--must); font-weight: 600; }
.priority-btn.want.active   { background: #FFF9DB; border-color: var(--want);     color: var(--want); font-weight: 600; }
.priority-btn.optional.active { background: #EBFBEE; border-color: var(--optional); color: var(--optional); font-weight: 600; }

/* Budget */
.budget-row { display: flex; align-items: center; gap: 8px; }
.budget-row input { flex: 1; }
.budget-sep { color: var(--text-muted); font-weight: 700; }

/* Tags */
.tag-quick-wrap { display: flex; flex-direction: column; gap: 8px; }
.tag-quick-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  font-size: 12px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 3px 10px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
  user-select: none;
}
.tag-chip.selected,
.tag-chip:hover {
  background: #EFF6FF;
  border-color: #1971C2;
  color: #1971C2;
}

.tag-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tag-selected-item {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #EFF6FF;
  color: #1971C2;
  border-radius: 14px;
  padding: 3px 8px 3px 10px;
  font-size: 12px;
}
.tag-selected-item button {
  background: none;
  border: none;
  cursor: pointer;
  color: #1971C2;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  opacity: .7;
}
.tag-selected-item button:hover { opacity: 1; }

/* Buttons */
.btn-primary {
  flex: 1;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .2s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}
.btn-secondary:hover { background: var(--border); color: var(--text); }

/* Detail modal */
.detail-modal {
  max-width: 640px;
}
.detail-header-left { display: flex; align-items: center; gap: 8px; flex: 1; }
.detail-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.detail-title { font-size: 20px; font-weight: 700; flex: 1; line-height: 1.4; }
.dog-badge-lg {
  background: #FFF9DB;
  color: #E67700;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 13px;
  white-space: nowrap;
}
.detail-badges { display: flex; gap: 8px; margin-bottom: 14px; }
.priority-badge, .status-badge {
  font-size: 12px;
  border-radius: 6px;
  padding: 3px 10px;
  font-weight: 500;
}
.priority-badge.must     { background: #FFF5F5; color: var(--must); }
.priority-badge.want     { background: #FFF9DB; color: var(--want); }
.priority-badge.optional { background: #EBFBEE; color: var(--optional); }

.zone-badge {
  background: var(--bg);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.detail-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.detail-cover img { width: 100%; max-height: 260px; object-fit: cover; }

.detail-section { margin-bottom: 14px; }
.section-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.detail-content { font-size: 14px; color: var(--text); line-height: 1.7; white-space: pre-wrap; }
.detail-notes { background: #FFFBF0; border-left: 3px solid var(--want); padding: 10px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.detail-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}
.field-label { font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.detail-link { color: var(--primary); text-decoration: none; word-break: break-all; }
.detail-link:hover { text-decoration: underline; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.small-text {
  font-size: 11px;
  color: #CED4DA;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* ===== IDEA STATS BANNER ===== */
.stats-banner {
  display: flex;
  gap: 10px;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stats-banner::-webkit-scrollbar { display: none; }
.stat-card {
  flex-shrink: 0;
  background: white;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-width: 100px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-n { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-card .stat-l { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== TOAST ===== */
.toast-wrap {
  position: fixed;
  bottom: calc(var(--mobile-nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(360px, 90vw);
}
.toast {
  background: #333;
  color: white;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: all .25s;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #2B8A3E; }
.toast-error   { background: #C92A2A; }
.toast-warn    { background: #E67700; }
.toast-info    { background: #1971C2; }

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .content-area { margin-left: 0; }
  .mobile-nav { display: flex; }

  .ideas-grid.card-view {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .app-layout {
    padding-bottom: calc(var(--mobile-nav-h) + 10px);
  }

  .toast-wrap {
    bottom: calc(var(--mobile-nav-h) + 12px);
  }
}

/* Mobile */
@media (max-width: 600px) {
  .app-title { font-size: 14px; }
  .btn-add-main span { display: none; }
  .btn-add-main { padding: 8px 12px; }

  .ideas-grid.card-view {
    grid-template-columns: 1fr;
  }

  .modal { border-radius: 16px 16px 0 0; max-height: 94vh; }
  .modal-overlay { align-items: flex-end; }

  .zone-select-grid { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr; }

  .zone-header-left h2 { font-size: 15px; }

  .content-area { padding: 12px; }
}

/* Desktop center modal */
@media (min-width: 768px) {
  .modal-overlay { align-items: center; justify-content: center; }
  .modal {
    border-radius: var(--radius);
    max-height: 90vh;
    max-width: 640px;
  }
}
