
/* ============ 다크 모던 테마 ============ */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --bg-card: #1a1a1c;
  --bg-card-2: #222224;
  --bg-elevated: #2a2a2d;
  --border: rgba(255,255,255,0.06);
  --text: #ffffff;
  --text-2: #a0a0a5;
  --text-3: #6a6a70;

  --orange: #ff9f43;
  --orange-2: #ff6b35;
  --red: #ff4757;
  --purple: #8e7dff;
  --green: #2ed573;
  --blue: #5ba7ff;
  --yellow: #ffd93d;
  --pink: #ff5e8a;

  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 8px 24px rgba(0,0,0,0.4);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

input, select {
  font-family: inherit;
  outline: none;
}

a { color: var(--orange); text-decoration: none; }
.hidden { display: none !important; }

/* ============ 앱 컨테이너 ============ */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
}

/* ============ 탭 컨텐츠 ============ */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}
.tab-content.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ 페이지 헤더 ============ */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 20px 4px 20px;
}
.page-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}
.page-header .subtitle {
  color: var(--text-2);
  font-size: 13px;
  margin: 6px 0 0;
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-3);
  display: inline-block;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.offline { background: var(--red); }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.icon-btn:active { transform: scale(0.92); }

/* ============ 카드 ============ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.card-sub {
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 14px;
}

/* ============ 날씨 히어로 ============ */
.weather-hero {
  background: linear-gradient(135deg, #1a1a1c 0%, #262628 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  min-height: 110px;
}
.weather-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,159,67,0.25), transparent 70%);
  pointer-events: none;
}
.weather-left {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}
.weather-icon {
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(255,159,67,0.4));
}
.weather-temp {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.weather-desc {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 4px;
}
.weather-right {
  text-align: right;
  position: relative;
}
.weather-city {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.weather-feel {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ============ 점심 카드 ============ */
.lunch-card {
  background: linear-gradient(135deg, #1a1a1c 0%, #1f1f22 100%);
}
.lunch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.lunch-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.stat { text-align: center; }
.stat-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--orange);
}
.stat-label {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}
.lunch-members {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
}
.member-row.join { border-left: 3px solid var(--green); }
.member-row.skip { border-left: 3px solid var(--red); opacity: 0.6; }
.member-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.member-name { font-size: 14px; font-weight: 500; }
.me-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--orange);
  color: white;
  font-size: 10px;
  border-radius: 8px;
  margin-left: 6px;
  font-weight: 700;
}
.member-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 10px;
  font-weight: 600;
}
.status-join { background: rgba(46,213,115,0.15); color: var(--green); }
.status-skip { background: rgba(255,71,87,0.15); color: var(--red); }
.status-none { background: rgba(160,160,165,0.15); color: var(--text-2); }
.empty-mini {
  text-align: center;
  padding: 20px;
  color: var(--text-3);
  font-size: 13px;
}

/* ============ 토글 스위치 ============ */
.toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #3a3a3d;
  border-radius: 30px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 24px; height: 24px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--green), #26ae60);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* ============ 액션 카드 그리드 ============ */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.action-card {
  margin: 0;
  cursor: pointer;
  transition: transform 0.15s ease;
  padding: 16px;
}
.action-card:active { transform: scale(0.97); }
.icon-badge {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 10px;
}
.bg-orange { background: rgba(255,159,67,0.15); }
.bg-purple { background: rgba(142,125,255,0.15); }
.bg-red { background: rgba(255,71,87,0.15); }
.bg-green { background: rgba(46,213,115,0.15); }
.bg-blue { background: rgba(91,167,255,0.15); }
.bg-pink { background: rgba(255,94,138,0.15); }

.action-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}
.action-sub {
  font-size: 12px;
  color: var(--text-2);
}

/* ============ 추천 결과 카드 ============ */
.recommend-result {
  background: linear-gradient(135deg, #2a1a1c 0%, #1f1a22 100%);
  border: 1px solid rgba(255,159,67,0.2);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.rec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.rec-label {
  font-size: 12px;
  color: var(--orange);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.btn-ghost {
  background: none;
  color: var(--text-2);
  font-size: 18px;
  padding: 4px 8px;
}
.rec-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.rec-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 10px;
}
.rec-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.rec-tag {
  padding: 4px 10px;
  background: rgba(255,159,67,0.12);
  color: var(--orange);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.rec-reason {
  padding: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 14px;
  line-height: 1.5;
}
.rec-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ============ 버튼 ============ */
.btn-primary, .btn-secondary, .btn-danger {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: white;
  box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}
.btn-primary:active { transform: scale(0.97); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
}
.btn-secondary:active { transform: scale(0.97); }
.btn-secondary.sm { padding: 8px 14px; font-size: 13px; }
.btn-danger {
  background: rgba(255,71,87,0.15);
  color: var(--red);
}
.btn-primary.full, .btn-danger.full { width: 100%; }

/* ============ 검색/칩/리스트 ============ */
.search-row {
  margin-bottom: 12px;
}
.search-row input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 14px;
}
.search-row input::placeholder { color: var(--text-3); }

.chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 10px;
  scrollbar-width: none;
}
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.chip.active {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}

.action-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.action-row button { flex: 1; }

.list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.list-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.list-left {
  flex: 1;
  min-width: 0;
}
.list-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
.list-meta {
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.list-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.mini-tag {
  padding: 2px 8px;
  background: rgba(255,255,255,0.05);
  color: var(--text-2);
  border-radius: 8px;
  font-size: 11px;
}
.list-right {
  display: flex;
  gap: 6px;
}
.mini-btn {
  padding: 6px 10px;
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 8px;
  font-size: 12px;
}
.mini-btn.danger { color: var(--red); }

/* ============ 폼 ============ */
.form-row {
  margin-bottom: 12px;
}
.form-row label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 600;
}
.form-row input,
.form-row select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
}
.form-row input::placeholder { color: var(--text-3); }
.form-row input + button { margin-top: 8px; width: 100%; }

.chips-select {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chips-select label {
  display: inline-block;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.chips-select input { display: none; }
.chips-select span {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bg-elevated);
  border-radius: 14px;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
  border: 1px solid var(--border);
}
.chips-select input:checked + span {
  background: rgba(255,159,67,0.15);
  color: var(--orange);
  border-color: var(--orange);
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border: none; }
.info-row span:first-child { color: var(--text-2); }
.info-row span:last-child { color: var(--text); font-weight: 600; }

.hint {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 8px;
}
.hint.success { color: var(--green); }
.hint.error { color: var(--red); }

.danger-card { background: transparent; border: 1px dashed rgba(255,71,87,0.3); }

/* ============ 하단 탭바 ============ */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}
.tab-btn {
  flex: 1;
  background: transparent;
  color: var(--text-3);
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: color 0.2s;
}
.tab-btn.active { color: var(--orange); }
.tab-ic { font-size: 20px; }
.tab-lb { font-size: 10px; font-weight: 600; }

/* ============ 바텀 시트 ============ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: fadeBg 0.2s ease;
}
.sheet-backdrop.open { display: flex; }
@keyframes fadeBg { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  background: var(--bg-card);
  width: 100%;
  max-width: 480px;
  border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 85vh;
  overflow-y: auto;
  animation: slideSheet 0.25s ease;
}
@keyframes slideSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  margin: 4px auto 16px;
}
.sheet-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 18px;
}
.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin-top: 14px;
}

/* ============ 투표 ============ */
.vote-card .vote-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  margin-bottom: 8px;
}
.vote-progress {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin: 0 12px;
}
.vote-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-2));
  border-radius: 3px;
  transition: width 0.3s;
}

/* ============ 엑셀 미리보기 ============ */
.excel-preview {
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-elevated);
  padding: 12px;
  border-radius: 12px;
  font-size: 12px;
}
.excel-preview table {
  width: 100%;
  border-collapse: collapse;
}
.excel-preview th, .excel-preview td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.excel-preview th { color: var(--orange); font-weight: 700; }
.excel-preview td { color: var(--text); }

/* ============ 토스트 ============ */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,30,33,0.95);
  backdrop-filter: blur(10px);
  color: white;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  max-width: 90%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

/* ============ 기록 ============ */
.history-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--border);
}
.history-date {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 4px;
}
.history-restaurant {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}
