:root {
  --primary: #e85d2c;
  --primary-dark: #c94a1e;
  --primary-light: #fce8e0;
  --secondary: #1a5e2a;
  --secondary-light: #e0f5e5;
  --accent: #f5a623;
  --bg: #f7f4ef;
  --bg-card: #ffffff;
  --text: #2c2c2c;
  --text-light: #6b6b6b;
  --text-muted: #9e9e9e;
  --border: #e8e4dd;
  --danger: #dc3545;
  --danger-light: #fce8ea;
  --success: #28a745;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --font-heading: 'Nunito', sans-serif;
  --font-body: 'Quicksand', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-emoji {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.header-titles {
  display: flex;
  flex-direction: column;
}

.app-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.2;
}

.app-subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-badge {
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}

.notif-wrapper {
  position: relative;
}

.notif-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 50%;
  position: relative;
  color: white;
  transition: background 0.2s;
}

.notif-btn:hover {
  background: rgba(255,255,255,0.35);
}

.notif-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
}

/* Tab Nav */
.tab-nav {
  display: flex;
  max-width: 900px;
  margin: 0 auto;
  padding: 0.75rem 1rem 0;
  gap: 0.5rem;
}

.tab-btn {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 2px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-light);
}

.tab-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.tab-btn:hover:not(.active) {
  border-color: var(--text-muted);
}

/* Notification Panel */
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}

.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.notif-panel-header h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
}

.close-btn:hover {
  color: var(--text);
}

.notif-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5rem;
}

.notif-item {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.3rem;
}

.notif-item.unread {
  background: var(--primary-light);
}

.notif-item strong {
  font-family: var(--font-heading);
  font-size: 0.85rem;
}

.notif-item p {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.15rem;
}

.empty-state-small {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem;
  font-size: 0.9rem;
}

/* Tab Content */
.tab-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.section-hero {
  text-align: center;
  padding: 1.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.section-hero h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
}

.section-hero p {
  color: var(--text-light);
  font-size: 1rem;
}

.hero-text {
  text-align: center;
}

.hero-text h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
}

.hero-text p {
  color: var(--text-light);
}

.attendee-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--secondary-light);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
}

.count-num {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: var(--secondary);
  line-height: 1;
}

.count-label {
  font-size: 0.75rem;
  color: var(--secondary);
  font-weight: 600;
}

/* Items Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* Skeleton */
.skeleton-card {
  height: 200px;
  border-radius: var(--radius);
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Dish Card */
.dish-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}

.dish-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.dish-card.open {
  border-color: var(--accent);
}

.dish-card.claimed {
  border-color: var(--success);
}

.dish-card-photo {
  width: 100%;
  height: 150px;
  overflow: hidden;
}

.dish-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-card-body {
  padding: 1rem;
}

.dish-category-badge {
  display: inline-block;
  background: var(--bg);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

.dish-card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.dish-card-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.dish-servings {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dish-card-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.claimed-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--success);
}

.open-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

/* Lineup */
.lineup-stats {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.stat-pill {
  background: var(--bg-card);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  font-family: var(--font-heading);
}

.stat-pill span {
  color: var(--primary);
}

.lineup-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.lineup-category-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--border);
}

.lineup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  gap: 1rem;
  border-left: 4px solid transparent;
}

.lineup-item.claimed {
  border-left-color: var(--success);
}

.lineup-item.open {
  border-left-color: var(--accent);
}

.lineup-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.lineup-item-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
}

.lineup-item-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lineup-item-servings {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lineup-item-status {
  flex-shrink: 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-emoji {
  font-size: 4rem;
  margin-bottom: 0.75rem;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.empty-state p {
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-full {
  width: 100%;
}

/* Card */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* Form */
.dish-form {
  margin-top: 1rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: var(--bg-card);
  color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Photo upload */
.photo-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
}

.photo-drop-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.photo-icon {
  font-size: 2rem;
}

.photo-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}

.progress-fill.uploading-anim {
  width: 70%;
  animation: uploadPulse 1.5s infinite ease-in-out;
}

@keyframes uploadPulse {
  0%, 100% { width: 30%; }
  50% { width: 85%; }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 1rem;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255,255,255,0.9);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  color: var(--text-muted);
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
}

.modal-photo {
  margin: -1.5rem -1.5rem 1rem;
  height: 200px;
  overflow: hidden;
}

.modal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  margin: 0.5rem 0;
}

.modal-desc {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.modal-servings {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.modal-status {
  margin-top: 1rem;
}

.modal-claimed-by {
  text-align: center;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--success);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-family: var(--font-heading);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: toastIn 0.3s ease-out;
  font-size: 0.95rem;
}

@keyframes toastIn {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 600px) {
  .app-title { font-size: 1.2rem; }
  .app-subtitle { font-size: 0.75rem; }
  .header-emoji { font-size: 1.8rem; }
  .tab-btn { font-size: 0.8rem; padding: 0.6rem 0.5rem; }
  .section-hero h2 { font-size: 1.3rem; }
  .items-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .notif-panel { width: 280px; right: -1rem; }
}