/* ============================================
   CƠM NHÀ MIỀN TÂY - Main Stylesheet
   ============================================ */

:root {
  --primary: #e67e22;
  --primary-dark: #d35400;
  --primary-light: #f39c12;
  --secondary: #27ae60;
  --secondary-light: #2ecc71;
  --accent: #e74c3c;
  --bg: #fdfaf6;
  --bg-card: #ffffff;
  --bg-muted: #f8f4ef;
  --text: #2c3e50;
  --text-muted: #7f8c8d;
  --text-light: #95a5a6;
  --border: #e8ddd0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --font: 'Be Vietnam Pro', -apple-system, sans-serif;
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ============ NAVBAR ============ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; gap: 2rem;
  height: 64px;
}

.nav-brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; flex-shrink: 0;
}
.brand-icon { font-size: 1.6rem; }
.brand-text { font-size: 1.15rem; color: var(--primary-dark); }
.brand-sub {
  font-size: 0.7rem; background: var(--primary); color: white;
  padding: 2px 6px; border-radius: 20px; font-weight: 500;
}

.nav-links {
  display: flex; list-style: none; gap: 0.25rem; flex: 1;
}
.nav-links a {
  padding: 0.5rem 0.9rem; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: var(--bg-muted); color: var(--primary);
}

.nav-toggle {
  display: none; background: none; border: none;
  font-size: 1.4rem; cursor: pointer; padding: 0.5rem;
}

.mobile-menu {
  display: none; flex-direction: column;
  background: white; border-bottom: 1px solid var(--border);
  padding: 0.5rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 500;
}
.mobile-menu a:hover { background: var(--bg-muted); color: var(--primary); }

/* ============ MAIN CONTENT ============ */
.main-content { min-height: calc(100vh - 64px); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.2rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem; cursor: pointer;
  border: none; transition: var(--transition); font-family: var(--font);
  white-space: nowrap;
}
.btn-lg { padding: 0.8rem 1.8rem; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(230,126,34,0.35); }

.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

.btn-ghost { background: var(--bg-muted); color: var(--text-muted); }
.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-white { background: white; color: var(--primary); font-weight: 700; }
.btn-white:hover { background: var(--bg-muted); }

.btn-danger-ghost { background: transparent; color: #e74c3c; border: 1.5px solid #e74c3c; }
.btn-danger-ghost:hover { background: #fdecea; }

/* ============ HERO ============ */
.hero {
  background: linear-gradient(135deg, #fff8f0 0%, #fef3e2 50%, #fff0dc 100%);
  padding: 4rem 1.5rem 3rem;
  border-bottom: 1px solid var(--border);
}

.hero-content { max-width: 700px; margin: 0 auto; text-align: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(230,126,34,0.12); color: var(--primary-dark);
  padding: 0.4rem 1rem; border-radius: 20px;
  font-size: 0.85rem; font-weight: 600; margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800; color: var(--text);
  line-height: 1.15; margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.05rem; color: var(--text-muted);
  margin-bottom: 2rem; line-height: 1.7;
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  display: flex; justify-content: center; gap: 1.5rem;
  margin-top: 3rem; flex-wrap: wrap;
}

.stat-card {
  background: white; border-radius: var(--radius);
  padding: 1.2rem 2rem; text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.stat-number { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-top: 0.2rem; }

/* ============ SECTIONS ============ */
.section { padding: 3rem 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.section-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.section-badge { background: var(--primary); color: white; padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.8rem; }
.today-badge { background: var(--secondary); }
.see-all { color: var(--primary); font-weight: 600; font-size: 0.9rem; }
.see-all:hover { text-decoration: underline; }

/* ============ PAGE HEADER ============ */
.page-header {
  background: linear-gradient(135deg, #fff8f0, #fef3e2);
  padding: 2.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.page-header .container { display: flex; flex-direction: column; gap: 0.5rem; }
.page-title { font-size: 1.8rem; font-weight: 800; }
.page-subtitle { color: var(--text-muted); }
.page-header .btn { align-self: flex-start; margin-top: 0.5rem; }
.page-header-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }

/* ============ QUICK SUGGEST BANNER ============ */
.quick-suggest-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; padding: 1.5rem;
}
.quick-suggest-banner .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.budget-info { display: flex; align-items: center; gap: 1rem; }
.budget-icon { font-size: 2rem; }
.budget-text { display: flex; flex-direction: column; }
.budget-text strong { font-size: 1.05rem; }
.budget-text span { font-size: 0.85rem; opacity: 0.9; }
.budget-breakdown { display: flex; gap: 1rem; }
.budget-breakdown span {
  background: rgba(255,255,255,0.2); padding: 0.25rem 0.7rem;
  border-radius: 20px; font-size: 0.8rem; font-weight: 600;
}

/* ============ DISH CARDS ============ */
.dishes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.dishes-grid-large {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.dish-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  transition: var(--transition); cursor: pointer;
  display: flex; flex-direction: column;
}
.dish-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: var(--primary);
}

.dish-emoji {
  font-size: 3rem; padding: 1.5rem;
  background: var(--bg-muted);
  display: flex; justify-content: center; align-items: center;
  min-height: 110px;
}

.dish-card-top { position: relative; }
.dish-card-top .dish-emoji { font-size: 3.5rem; min-height: 130px; }
.dish-region-badge {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: var(--primary); color: white;
  font-size: 0.7rem; font-weight: 600;
  padding: 0.2rem 0.6rem; border-radius: 20px;
}

.dish-info { padding: 1rem 1.2rem 1.2rem; flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.dish-region-tag { font-size: 0.7rem; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.dish-category-tag { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }
.dish-name { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.dish-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.dish-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.3rem; }
.dish-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }

.dish-cost-badge, .dish-time-badge, .dish-diff-badge {
  font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.dish-cost-badge { background: #fef3e2; color: var(--primary-dark); }
.dish-time-badge { background: #e8f8f5; color: var(--secondary); }
.dish-diff-badge { background: var(--bg-muted); color: var(--text-muted); }
.diff-de { background: #e8f8f5; color: #27ae60; }
.diff-trung_binh { background: #fef9e7; color: #f39c12; }
.diff-kho { background: #fdecea; color: #e74c3c; }

/* ============ FILTER BAR ============ */
.filter-bar { background: white; border-bottom: 1px solid var(--border); padding: 1rem 0; }
.sticky-filter { position: sticky; top: 64px; z-index: 90; box-shadow: var(--shadow-sm); }
.filter-form { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 0.25rem; }
.filter-group label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.filter-input, .filter-select {
  padding: 0.55rem 0.9rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font);
  font-size: 0.9rem; background: white; color: var(--text);
  transition: var(--transition); outline: none;
}
.filter-input:focus, .filter-select:focus { border-color: var(--primary); }
.filter-search { min-width: 220px; }
.search-group { flex: 1; min-width: 200px; }

.cook-times-toggle { display: flex; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ct-btn { padding: 0.5rem 0.9rem; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); transition: var(--transition); white-space: nowrap; }
.ct-btn:hover { background: var(--bg-muted); color: var(--text); }
.ct-btn.ct-active { background: var(--primary); color: white; }
.ct-btn + .ct-btn { border-left: 1.5px solid var(--border); }

.cook-once-tag { font-size: 0.7rem; font-weight: 600; background: var(--primary); color: white; padding: 0.15rem 0.55rem; border-radius: 20px; margin-left: 0.5rem; vertical-align: middle; }

.results-info { margin: 1rem 0; color: var(--text-muted); font-size: 0.9rem; }

/* ============ SUGGEST PAGE ============ */
.budget-overview { margin: 1.5rem 0; }
.budget-bar-header { margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cook-times-badge { background: var(--bg-muted); border: 1px solid var(--border); color: var(--text-muted); padding: 0.2rem 0.7rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.budget-bar { display: flex; border-radius: var(--radius-sm); overflow: hidden; height: 48px; }
.budget-segment {
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 0.75rem; font-size: 0.75rem;
}
.budget-segment span { font-weight: 500; opacity: 0.85; }
.budget-segment strong { font-weight: 700; font-size: 0.85rem; }
.seg-lunch { background: var(--primary); color: white; }
.seg-dinner { background: var(--primary-dark); color: white; }
.seg-veg { background: var(--secondary); color: white; }

.suggest-layout { display: flex; flex-direction: column; gap: 2rem; margin: 1.5rem 0; }

.meal-section {
  background: white; border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.meal-section-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.2rem 1.5rem;
  background: var(--bg-muted); border-bottom: 1px solid var(--border);
}
.meal-icon-wrap { font-size: 2rem; }
.meal-section-title { font-size: 1.2rem; font-weight: 700; }
.meal-section-budget { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.1rem; }

.suggest-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.suggest-columns-3 { grid-template-columns: 1fr 1fr 1fr; }
.suggest-col { padding: 1.25rem; border-right: 1px solid var(--border); }
.suggest-col:last-child { border-right: none; }
.col-title {
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.suggest-dish-card {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.85rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); margin-bottom: 0.75rem;
  background: white; transition: var(--transition);
}
.suggest-dish-card:hover { border-color: var(--primary); background: var(--bg-muted); }

.sdc-emoji { font-size: 2rem; flex-shrink: 0; }
.sdc-info { flex: 1; min-width: 0; }
.sdc-name { font-weight: 700; font-size: 0.92rem; margin-bottom: 0.3rem; }
.sdc-meta { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.sdc-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.sdc-actions { display: flex; flex-direction: column; gap: 0.4rem; flex-shrink: 0; }

.btn-pick {
  background: var(--primary); color: white; border: none;
  padding: 0.35rem 0.9rem; border-radius: 6px; font-size: 0.8rem;
  font-weight: 600; cursor: pointer; font-family: var(--font);
  transition: var(--transition);
}
.btn-pick:hover { background: var(--primary-dark); }
.btn-detail {
  font-size: 0.75rem; color: var(--text-muted); text-align: center;
  padding: 0.25rem; text-decoration: underline;
}

.badge { font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 20px; }
.badge-cost { background: #fef3e2; color: var(--primary-dark); }
.badge-time { background: #e8f8f5; color: var(--secondary); }
.badge-region { background: rgba(230,126,34,0.15); color: var(--primary-dark); }

/* Floating Cart */
.floating-cart {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  width: 360px; background: white;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); overflow: hidden;
  z-index: 200; max-height: 70vh; display: flex; flex-direction: column;
}
.cart-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.2rem;
  background: var(--primary); color: white;
}
.cart-header h3 { font-size: 0.95rem; font-weight: 700; }
.cart-count { font-size: 0.8rem; opacity: 0.9; }
.cart-items { flex: 1; overflow-y: auto; padding: 0.75rem; }
.cart-empty { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 1rem; }
.cart-group { margin-bottom: 0.75rem; }
.cart-group-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.4rem; }
.cart-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.6rem; background: var(--bg-muted);
  border-radius: var(--radius-sm); margin-bottom: 0.3rem;
  font-size: 0.84rem;
}
.cart-item span:first-child { flex: 1; }
.cart-item-cost { color: var(--primary); font-weight: 600; font-size: 0.8rem; }
.cart-remove {
  background: none; border: none; color: var(--text-light);
  cursor: pointer; font-size: 0.8rem; padding: 0.1rem 0.3rem;
  border-radius: 50%;
}
.cart-remove:hover { background: var(--border); color: var(--accent); }
.cart-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--border); }
.cart-total { font-size: 0.85rem; margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.5rem; }
.cart-total strong { font-size: 1rem; color: var(--primary); }
.budget-ok { color: var(--secondary); font-size: 0.75rem; font-weight: 600; }
.budget-over { color: var(--accent); font-size: 0.75rem; font-weight: 600; }
.cart-actions { display: flex; gap: 0.5rem; }

/* ============ DISH DETAIL ============ */
.breadcrumb { padding: 1rem 0; font-size: 0.85rem; color: var(--text-muted); }
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }

.dish-detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; padding: 1rem 0 2rem; }
.dish-detail-hero { display: flex; gap: 1.5rem; margin-bottom: 2rem; align-items: flex-start; }
.dish-detail-emoji {
  font-size: 5rem; background: var(--bg-muted);
  border-radius: var(--radius-lg); padding: 1.5rem 2rem;
  flex-shrink: 0;
}
.dish-detail-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.tag { padding: 0.3rem 0.75rem; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.tag-category { background: var(--bg-muted); color: var(--text-muted); }
.tag-region { background: rgba(230,126,34,0.15); color: var(--primary-dark); }
.tag-diff { }
.tag-item { background: var(--bg-muted); color: var(--text-muted); margin: 0.2rem 0; }
.tags-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.dish-detail-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.5rem; }
.dish-detail-desc { color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
.dish-detail-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.dstat { }
.dstat-value { font-size: 1rem; font-weight: 700; color: var(--text); }
.dstat-label { font-size: 0.75rem; color: var(--text-muted); }

.dish-section { margin-bottom: 2rem; }
.dish-section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--bg-muted); }
.ingredients-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.ingredient-item { display: flex; gap: 0.5rem; align-items: center; padding: 0.5rem 0.75rem; background: var(--bg-muted); border-radius: var(--radius-sm); font-size: 0.88rem; }
.ingredient-dot { color: var(--primary); font-weight: 700; }
.instructions-text { line-height: 1.8; color: var(--text-muted); white-space: pre-line; }

.dish-detail-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.dish-detail-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.sidebar-card { background: var(--bg-muted); border-radius: var(--radius); padding: 1.2rem; }
.sidebar-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.75rem; }
.tips-list { list-style: none; }
.tips-list li { padding: 0.35rem 0; font-size: 0.85rem; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.tips-list li:last-child { border: none; }
.cost-per-person { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin-bottom: 0.3rem; }
.cost-note { font-size: 0.8rem; color: var(--text-muted); }
.sidebar-cta {
  display: block; text-align: center; padding: 0.9rem;
  background: var(--primary); color: white;
  border-radius: var(--radius); font-weight: 600;
  transition: var(--transition);
}
.sidebar-cta:hover { background: var(--primary-dark); }

.related-section { margin: 3rem 0; }

/* ============ FORM STYLES ============ */
.dish-form { padding: 2rem 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-span-2 { grid-column: span 2; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.form-hint { font-size: 0.75rem; color: var(--text-muted); }
.form-input, .form-select, .form-textarea {
  padding: 0.7rem 1rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font);
  font-size: 0.9rem; background: white; color: var(--text);
  transition: var(--transition); outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); }
.form-input-lg { font-size: 1.1rem; padding: 0.85rem 1rem; }
.form-textarea { resize: vertical; min-height: 80px; }
.emoji-input { font-size: 1.5rem; text-align: center; max-width: 100px; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 2rem; }

/* ============ PLANNER ============ */
.planner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; padding: 1.5rem 0; }
.planner-card {
  background: white; border-radius: var(--radius); border: 1px solid var(--border);
  padding: 1.2rem; transition: var(--transition);
}
.planner-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.planner-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.planner-day { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: capitalize; }
.planner-date-num { font-size: 0.95rem; font-weight: 700; }
.planner-budget-chip {
  background: var(--bg-muted); color: var(--primary); font-size: 0.78rem;
  font-weight: 700; padding: 0.3rem 0.7rem; border-radius: 20px;
}
.planner-stats { display: flex; gap: 0.75rem; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.planner-notes { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.75rem; background: var(--bg-muted); padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); }
.planner-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Planner New */
.planner-form-header { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; padding: 1.5rem; background: white; border-radius: var(--radius); border: 1px solid var(--border); }
.planner-meal-section { background: white; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 1.5rem; overflow: hidden; }
.planner-meal-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.25rem; background: var(--bg-muted); border-bottom: 1px solid var(--border);
}
.planner-meal-icon { font-size: 1.5rem; }
.planner-meal-header h3 { font-size: 1rem; font-weight: 700; }
.selected-dishes-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-left: auto; }
.no-selection { font-size: 0.8rem; color: var(--text-light); }
.selected-tag { background: var(--primary); color: white; font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 20px; }

.dishes-select-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.6rem; padding: 1rem; }
.dish-select-card {
  display: flex; gap: 0.6rem; align-items: center;
  padding: 0.65rem 0.85rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); cursor: pointer; transition: var(--transition);
  background: white;
}
.dish-select-card:hover { border-color: var(--primary); background: var(--bg-muted); }
.dish-select-card.selected { border-color: var(--primary); background: rgba(230,126,34,0.08); }
.dsc-emoji { font-size: 1.4rem; flex-shrink: 0; }
.dsc-info { flex: 1; min-width: 0; }
.dsc-name { font-size: 0.82rem; font-weight: 600; line-height: 1.3; }
.dsc-meta { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.2rem; font-size: 0.72rem; color: var(--text-muted); }
.mt-badge { background: rgba(230,126,34,0.15); color: var(--primary-dark); padding: 1px 5px; border-radius: 20px; font-weight: 600; font-size: 0.65rem; }
.dsc-check {
  font-size: 0.9rem; color: var(--primary); opacity: 0;
  font-weight: 700; flex-shrink: 0;
}
.dish-select-card.selected .dsc-check { opacity: 1; }

.plan-budget-summary {
  background: white; border-radius: var(--radius); border: 1px solid var(--border);
  padding: 1.5rem; margin: 1.5rem 0; display: flex; align-items: center; justify-content: space-between;
}
.pbs-title { font-weight: 600; font-size: 0.9rem; }
.pbs-amounts { text-align: right; }
.pbs-total { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.pbs-budget { font-size: 0.82rem; color: var(--text-muted); }
.pbs-status { font-size: 0.85rem; font-weight: 600; margin-top: 0.25rem; }
.status-ok { color: var(--secondary); }
.status-over { color: var(--accent); }

/* Planner Detail */
.plan-detail-summary { display: flex; gap: 1.5rem; background: white; border-radius: var(--radius); border: 1px solid var(--border); padding: 1.5rem; margin: 1.5rem 0; flex-wrap: wrap; }
.pds-item { display: flex; gap: 0.75rem; align-items: center; flex: 1; min-width: 150px; }
.pds-icon { font-size: 1.8rem; }
.pds-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.pds-value { font-size: 0.95rem; font-weight: 700; }

.plan-detail-meal { background: white; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 1.5rem; overflow: hidden; }
.pdm-header { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem; background: var(--bg-muted); border-bottom: 1px solid var(--border); }
.pdm-icon { font-size: 1.5rem; }
.pdm-header h3 { font-size: 1rem; font-weight: 700; flex: 1; }
.pdm-cost { font-size: 0.9rem; font-weight: 700; color: var(--primary); }
.pdm-dishes { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.pdm-dish { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: var(--radius-sm); background: var(--bg-muted); transition: var(--transition); }
.pdm-dish:hover { background: var(--border); }
.pdm-emoji { font-size: 1.5rem; }
.pdm-info { flex: 1; }
.pdm-name { font-weight: 600; font-size: 0.9rem; }
.pdm-meta { display: flex; gap: 0.4rem; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }
.pdm-price { font-weight: 700; color: var(--primary); font-size: 0.9rem; }

.shopping-section { background: white; border-radius: var(--radius); border: 1px solid var(--border); padding: 1.5rem; margin: 1.5rem 0; }
.shopping-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; margin: 1rem 0; }
.shopping-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.75rem; background: var(--bg-muted); border-radius: var(--radius-sm); font-size: 0.85rem; }
.shopping-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

.plan-notes-card { background: var(--bg-muted); border-radius: var(--radius); padding: 1.25rem; margin: 1rem 0; }
.plan-notes-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; }

/* ============ SETTINGS ============ */
.settings-layout { max-width: 680px; margin: 2rem auto; }
.settings-form { display: flex; flex-direction: column; gap: 1.5rem; }
.settings-card { background: white; border-radius: var(--radius); border: 1px solid var(--border); padding: 1.5rem; }
.settings-group-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.6rem; border-bottom: 2px solid var(--bg-muted); }

.budget-presets { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.preset-label { font-size: 0.8rem; color: var(--text-muted); }
.preset-btn { background: var(--bg-muted); border: 1.5px solid var(--border); padding: 0.35rem 0.85rem; border-radius: 20px; font-size: 0.82rem; font-weight: 600; cursor: pointer; font-family: var(--font); transition: var(--transition); }
.preset-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(230,126,34,0.06); }

.serving-selector { display: flex; align-items: center; gap: 0.5rem; }
.serving-btn { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--bg-muted); font-size: 1.2rem; cursor: pointer; font-family: var(--font); transition: var(--transition); }
.serving-btn:hover { border-color: var(--primary); color: var(--primary); }
.serving-input { width: 70px; text-align: center; font-size: 1.1rem; font-weight: 700; }

.region-options { display: flex; flex-direction: column; gap: 0.75rem; }
.region-option {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: var(--transition);
}
.region-option:hover { border-color: var(--primary); background: rgba(230,126,34,0.04); }
.region-option.selected { border-color: var(--primary); background: rgba(230,126,34,0.07); }
.region-option input { display: none; }
.region-option > span { font-size: 1.8rem; }
.region-option strong { font-size: 0.9rem; display: block; }
.region-option small { color: var(--text-muted); font-size: 0.8rem; }

.settings-summary { background: rgba(230,126,34,0.06); border: 1.5px solid rgba(230,126,34,0.2); border-radius: var(--radius); padding: 1.25rem; }
.settings-preview { }
.sp-title { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.sp-item { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid rgba(230,126,34,0.15); font-size: 0.88rem; }
.sp-item:last-child { border: none; }
.sp-item span { color: var(--text-muted); }
.sp-item strong { color: var(--primary-dark); font-weight: 700; }

/* ============ TODAY PLAN ============ */
.today-plan { background: white; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.meal-time-block { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
.meal-time-block:last-of-type { border: none; }
.meal-time-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.meal-time-icon { font-size: 1.2rem; }
.meal-time-label { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }
.meal-dishes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.meal-dish-tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--bg-muted); padding: 0.4rem 0.8rem;
  border-radius: 20px; font-size: 0.83rem; font-weight: 600;
  border: 1px solid var(--border); transition: var(--transition);
}
.meal-dish-tag:hover { border-color: var(--primary); background: rgba(230,126,34,0.06); }
.dish-cost { color: var(--primary); font-size: 0.75rem; font-weight: 700; }
.plan-total { padding: 0.75rem 1.5rem; background: var(--bg-muted); font-size: 0.9rem; color: var(--text-muted); }
.plan-total strong { color: var(--primary-dark); }

/* ============ TIPS ============ */
.tips-section { background: var(--bg-muted); padding: 3rem 1.5rem; border-top: 1px solid var(--border); }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.tip-card { background: white; border-radius: var(--radius); padding: 1.5rem; border: 1px solid var(--border); text-align: center; }
.tip-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.tip-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.tip-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

/* ============ COST STATUS ============ */
.cost-ok { color: var(--secondary) !important; }
.cost-over { color: var(--accent) !important; }

/* ============ EMPTY STATE ============ */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }
.empty-suggest { color: var(--text-light); font-size: 0.85rem; text-align: center; padding: 1rem; }

/* ============ TOAST ============ */
.toast {
  position: fixed; top: 80px; right: 1.5rem; z-index: 500;
  padding: 0.85rem 1.5rem; border-radius: var(--radius);
  font-weight: 600; font-size: 0.9rem; box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease, fadeOut 0.4s 3s forwards;
}
.toast-success { background: var(--secondary); color: white; }
.toast-error { background: var(--accent); color: white; }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(120%); }
}

/* ============ FOOTER ============ */
.footer { background: var(--text); color: white; padding: 2rem 1.5rem 1.5rem; margin-top: 3rem; }
.footer-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.footer-brand span { font-size: 1.1rem; font-weight: 700; }
.footer-brand p { font-size: 0.82rem; opacity: 0.6; margin-top: 0.3rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-links a { font-size: 0.85rem; opacity: 0.7; transition: var(--transition); }
.footer-links a:hover { opacity: 1; color: var(--primary-light); }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.1); }
.footer-bottom p { font-size: 0.8rem; opacity: 0.5; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .suggest-columns, .suggest-columns-3 { grid-template-columns: 1fr; }
  .suggest-col { border-right: none; border-bottom: 1px solid var(--border); }
  .floating-cart { width: calc(100% - 2rem); right: 1rem; }
  .dish-detail-layout { grid-template-columns: 1fr; }
  .dish-detail-hero { flex-direction: column; }
  .dish-detail-emoji { font-size: 3.5rem; padding: 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: span 1; }
  .planner-form-header { grid-template-columns: 1fr 1fr; }
  .hero-stats { gap: 0.75rem; }
  .stat-card { padding: 0.85rem 1.25rem; }
  .dishes-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .plan-detail-summary { gap: 0.75rem; }
  .budget-breakdown { display: none; }
  .filter-form { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero-title { font-size: 1.8rem; }
  .section { padding: 2rem 0; }
  .container { padding: 0 1rem; }
  .planner-form-header { grid-template-columns: 1fr; }
}

/* ============ NAV USER ============ */
.nav-user {
  display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0;
}
.user-chip {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-muted); border-radius: 20px;
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.btn-logout {
  background: none; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; color: var(--text-muted); font-family: var(--font);
  transition: var(--transition);
}
.btn-logout:hover { border-color: #e74c3c; color: #e74c3c; background: #fdecea; }

.mobile-user-info {
  padding: 0.75rem 1rem; font-size: 0.9rem; color: var(--text-muted);
  border-top: 1px solid var(--border); margin-top: 0.25rem;
}
.mobile-logout-btn {
  width: 100%; text-align: left; padding: 0.75rem 1rem;
  background: none; border: none; font-family: var(--font);
  font-size: 0.9rem; font-weight: 500; color: #e74c3c; cursor: pointer;
}
.mobile-auth-link {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 500;
}

/* ============ AUTH PAGES ============ */
.auth-page {
  min-height: calc(100vh - 64px - 80px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse at top, #fff8f0 0%, var(--bg) 60%);
}
.auth-card {
  background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 2.5rem 2rem;
  width: 100%; max-width: 420px;
}
.auth-logo {
  text-align: center; margin-bottom: 1.75rem;
}
.auth-logo .brand-icon { font-size: 2.8rem; display: block; margin-bottom: 0.5rem; }
.auth-title { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.auth-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.25rem; }
.auth-error {
  background: #fdecea; border: 1px solid #f5b7b1; border-radius: var(--radius-sm);
  color: #c0392b; padding: 0.75rem 1rem; font-size: 0.88rem;
  margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem;
}
.auth-form { display: flex; flex-direction: column; gap: 1.1rem; }
.password-wrap { position: relative; }
.password-wrap .form-input { width: 100%; padding-right: 2.8rem; }
.btn-eye {
  position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0.25rem;
  color: var(--text-muted);
}
.btn-full { width: 100%; justify-content: center; padding: 0.75rem; font-size: 1rem; margin-top: 0.5rem; }
.auth-footer {
  text-align: center; color: var(--text-muted); font-size: 0.88rem; margin-top: 1.5rem;
}
.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ============ SHARE BANNER ============ */
.share-banner {
  padding: 0.75rem 1.5rem; margin-bottom: 0;
}
.share-banner-inner {
  background: #f0fdf4; border: 1.5px solid #86efac; border-radius: var(--radius-sm);
  padding: 0.75rem 1rem; display: flex; align-items: center; gap: 0.75rem;
  flex-wrap: wrap; font-size: 0.88rem; font-weight: 600; color: #166534;
}
.share-url-input {
  flex: 1; min-width: 200px; border: 1px solid #bbf7d0; border-radius: 6px;
  padding: 0.4rem 0.65rem; font-size: 0.82rem; background: white;
  color: var(--text); font-family: monospace; outline: none;
}
.btn-share-active { border-color: var(--secondary) !important; color: var(--secondary) !important; }

/* ============ SHARE CTA ============ */
.share-cta { margin-top: 2rem; }
.share-cta-inner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius); padding: 2rem; text-align: center; color: white;
}
.share-cta-inner p { font-size: 1rem; margin-bottom: 1rem; opacity: 0.95; }

/* ============ PRINT STYLES ============ */
.print-header { display: none; }

@media print {
  .navbar, .mobile-menu, .filter-bar, .footer, .no-print,
  .shopping-check, .page-header-actions, .share-banner,
  .shopping-actions, .floating-cart { display: none !important; }

  .page-header { padding: 1rem 0 0.5rem; box-shadow: none; background: none; }
  .page-header .btn { display: none; }
  .print-header { display: block; text-align: center; padding: 1rem 0; border-bottom: 2px solid #333; margin-bottom: 1rem; }
  .print-brand { font-size: 1.4rem; font-weight: 700; }
  .print-date { font-size: 0.9rem; color: #555; margin-top: 0.25rem; }

  body { font-size: 12pt; background: white; }
  .container { max-width: 100%; padding: 0 1rem; }
  .plan-detail-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
  .pds-item { border: 1px solid #ddd; border-radius: 6px; padding: 0.5rem; }
  .plan-detail-meal { break-inside: avoid; margin-bottom: 0.75rem; }
  .shopping-section { border-top: 2px solid #333; margin-top: 1rem; break-inside: avoid; }
  .shopping-list { columns: 2; }
  .shopping-item { break-inside: avoid; padding: 0.2rem 0; }
  .pdm-dish { border-bottom: 1px solid #eee; }
  a { color: inherit; text-decoration: none; }
}

/* ============ PROFILE PAGE ============ */
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.75rem;
  padding-top: 1.75rem;
  padding-bottom: 3rem;
  align-items: start;
}

/* Sidebar */
.profile-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.profile-avatar-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem 1.25rem; text-align: center; box-shadow: var(--shadow-sm);
}
.profile-avatar-lg {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; font-size: 2rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 14px rgba(230,126,34,0.35);
}
.profile-display-name { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.profile-display-email { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.2rem; }
.profile-since {
  font-size: 0.75rem; color: var(--text-light); margin-top: 0.75rem;
  padding-top: 0.75rem; border-top: 1px solid var(--border);
}

.profile-stats-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm);
}
.psc-title { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.85rem; }
.psc-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--border);
}
.psc-row:last-child { border-bottom: none; padding-bottom: 0; }
.psc-icon { font-size: 1.2rem; }
.psc-num { font-size: 1.2rem; font-weight: 700; color: var(--primary); line-height: 1; }
.psc-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }

.profile-nav-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.profile-nav-link {
  display: block; padding: 0.75rem 1.25rem; font-size: 0.88rem; font-weight: 500;
  color: var(--text); border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.profile-nav-link:last-child { border-bottom: none; }
.profile-nav-link:hover { background: var(--bg-muted); color: var(--primary); }

/* Main panel */
.profile-main { min-width: 0; }

.profile-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 0;
}
.ptab {
  padding: 0.7rem 1.25rem; font-size: 0.88rem; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: var(--transition); white-space: nowrap;
}
.ptab:hover { color: var(--primary); }
.ptab-active { color: var(--primary); border-bottom-color: var(--primary); }
.ptab-danger { color: #e74c3c; }
.ptab-danger:hover { color: #c0392b; }
.ptab-danger-active { border-bottom-color: #e74c3c !important; }

.profile-panel {
  background: white; border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow-sm);
}
.panel-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.5rem; }

.profile-form { display: flex; flex-direction: column; gap: 1.1rem; max-width: 480px; }
.form-actions { display: flex; gap: 0.75rem; padding-top: 0.5rem; }

.input-error { border-color: #e74c3c !important; }
.field-error { font-size: 0.8rem; color: #e74c3c; margin-top: 0.3rem; }

/* Password strength */
.pw-strength-bar {
  height: 4px; background: var(--border); border-radius: 2px;
  margin-top: 0.5rem; overflow: hidden;
}
.pw-strength-fill {
  height: 100%; width: 0; border-radius: 2px; transition: width 0.3s ease, background 0.3s ease;
}
.pw-strength-fill.str-weak   { background: #e74c3c; }
.pw-strength-fill.str-fair   { background: #e67e22; }
.pw-strength-fill.str-good   { background: #f39c12; }
.pw-strength-fill.str-strong { background: #27ae60; }
.pw-strength-label { font-size: 0.75rem; margin-top: 0.25rem; font-weight: 600; }
.pw-strength-label.str-weak   { color: #e74c3c; }
.pw-strength-label.str-fair   { color: #e67e22; }
.pw-strength-label.str-good   { color: #f39c12; }
.pw-strength-label.str-strong { color: #27ae60; }

/* Danger zone */
.panel-danger { border-color: #fecaca; }
.danger-title { color: #dc2626; }
.danger-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem;
  padding: 1rem; background: #fff5f5; border: 1px solid #fecaca; border-radius: var(--radius-sm);
}
.danger-info p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.3rem; }
.btn-danger {
  background: #dc2626; color: white; border: none; white-space: nowrap;
  padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-size: 0.85rem;
  font-weight: 600; cursor: pointer; font-family: var(--font); flex-shrink: 0;
  transition: var(--transition);
}
.btn-danger:hover { background: #b91c1c; }

/* Modal */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.5); align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.modal-open { display: flex; }
.modal-card {
  background: white; border-radius: var(--radius-lg); padding: 2rem;
  max-width: 440px; width: 100%; box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.75rem; }
.modal-body { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.5rem; }

@media (max-width: 768px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-sidebar { order: 2; }
  .profile-main { order: 1; }
  .danger-item { flex-direction: column; }
}

/* ============ PRICE MANAGER ============ */
.price-toolbar {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0.65rem 0;
  position: sticky; top: 64px; z-index: 90;
}
.price-toolbar-inner {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.price-global-adjust {
  display: flex; align-items: center; gap: 0.4rem;
}
.ptool-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.btn-xs { padding: 0.25rem 0.55rem; font-size: 0.75rem; border-radius: 6px; }

.price-legend {
  display: flex; align-items: center; gap: 0.75rem; flex: 1;
  justify-content: center; flex-wrap: wrap;
}
.pl-item { font-size: 0.78rem; font-weight: 500; }
.pl-cheap { color: #16a34a; }
.pl-mid   { color: #d97706; }
.pl-exp   { color: #dc2626; }

.price-page { padding-top: 1.5rem; padding-bottom: 6rem; display: flex; flex-direction: column; gap: 1.5rem; }

.price-group {
  background: white; border-radius: var(--radius); border: 1px solid var(--border);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.price-group-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.9rem 1.25rem; background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
}
.price-group-title { font-size: 1rem; font-weight: 700; flex: 1; }
.price-group-count { font-size: 0.78rem; color: var(--text-muted); background: white; padding: 2px 8px; border-radius: 20px; }
.price-cat-adjust { display: flex; gap: 0.35rem; }

.price-table { display: flex; flex-direction: column; }
.price-table-head {
  display: grid; grid-template-columns: 1fr 90px 160px 80px;
  padding: 0.5rem 1.25rem; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border); background: #fafafa;
}
.price-row {
  display: grid; grid-template-columns: 1fr 90px 160px 80px;
  align-items: center; padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--border); transition: background var(--transition);
}
.price-row:last-child { border-bottom: none; }
.price-row:hover { background: var(--bg-muted); }

.price-dish-name {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.88rem; font-weight: 500;
}
.price-emoji { font-size: 1.1rem; flex-shrink: 0; }

.price-region { display: flex; align-items: center; }
.badge-mini {
  font-size: 0.68rem; padding: 2px 7px; border-radius: 20px; font-weight: 600;
}
.badge-mt   { background: #fef3c7; color: #92400e; }
.badge-chung { background: #e0e7ff; color: #3730a3; }

.price-input-wrap {
  display: flex; align-items: center; gap: 0.35rem;
}
.price-input {
  width: 110px; padding: 0.4rem 0.6rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.88rem; font-family: var(--font);
  font-weight: 600; text-align: right; transition: border-color var(--transition);
  background: white;
}
.price-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(230,126,34,0.12); }
.price-unit { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }

.price-level-wrap { display: flex; align-items: center; }
.price-level {
  font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 20px;
}
.price-level-cheap { background: #dcfce7; color: #16a34a; }
.price-level-mid   { background: #fef3c7; color: #d97706; }
.price-level-exp   { background: #fee2e2; color: #dc2626; }

.price-float-save {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
  display: none;
}

@media (max-width: 768px) {
  .price-table-head { display: none; }
  .price-row { grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 0.35rem; padding: 0.75rem 1rem; }
  .price-dish-name { grid-column: 1; }
  .price-region { grid-column: 2; grid-row: 1; }
  .price-input-wrap { grid-column: 1; }
  .price-level-wrap { grid-column: 2; grid-row: 2; justify-content: flex-end; }
  .price-input { width: 100px; }
  .price-float-save { display: block; }
  .price-toolbar-inner { gap: 0.5rem; }
  .price-legend { display: none; }
}

/* ============ INGREDIENT PRICES ============ */
.ing-search-wrap { flex: 1; min-width: 180px; max-width: 260px; }
.ing-search {
  width: 100%; padding: 0.45rem 0.85rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.88rem; font-family: var(--font);
  background: white; outline: none; transition: border-color var(--transition);
}
.ing-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(230,126,34,0.12); }

.ing-cat-nav {
  background: var(--bg-muted); border-bottom: 1px solid var(--border);
  padding: 0.5rem 0; overflow-x: auto;
}
.ing-cat-pills { display: flex; gap: 0.5rem; flex-wrap: nowrap; white-space: nowrap; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.85rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
  background: white; border: 1.5px solid var(--border); color: var(--text-muted);
  transition: var(--transition); flex-shrink: 0;
}
.cat-pill:hover { border-color: var(--primary); color: var(--primary); background: #fff8f0; }
.cat-pill-count {
  background: var(--bg-muted); border-radius: 20px; padding: 0 6px;
  font-size: 0.72rem; color: var(--text-light);
}

/* Ingredient table */
.ing-table { display: flex; flex-direction: column; }
.ing-table-head {
  display: grid; grid-template-columns: 1fr 70px 140px 160px 40px;
  padding: 0.5rem 1.25rem; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border); background: #fafafa;
}
.ing-row {
  display: grid; grid-template-columns: 1fr 70px 140px 160px 40px;
  align-items: center; padding: 0.55rem 1.25rem;
  border-bottom: 1px solid var(--border); transition: background var(--transition);
}
.ing-row:last-child { border-bottom: none; }
.ing-row:hover { background: var(--bg-muted); }

.ing-name {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.88rem; font-weight: 500;
}
.ing-icon { font-size: 1.1rem; flex-shrink: 0; }
.ing-unit .unit-badge {
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  background: var(--bg-muted); padding: 2px 7px; border-radius: 20px;
}
.ing-notes { font-size: 0.75rem; color: var(--text-light); }

.btn-del-ing {
  background: none; border: none; cursor: pointer; color: var(--text-light);
  font-size: 0.8rem; padding: 4px 6px; border-radius: 4px;
  transition: var(--transition);
}
.btn-del-ing:hover { background: #fee2e2; color: #dc2626; }

/* Add modal form */
.add-ing-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .ing-table-head { display: none; }
  .ing-row { grid-template-columns: 1fr auto; row-gap: 0.3rem; padding: 0.75rem 1rem; }
  .ing-name { grid-column: 1; }
  .ing-unit { grid-column: 2; grid-row: 1; }
  .ing-notes { grid-column: 1 / -1; font-size: 0.72rem; }
  .price-input-wrap { grid-column: 1; }
  .ing-actions { grid-column: 2; justify-self: end; }
  .ing-cat-pills { padding: 0 1rem; }
  .add-ing-grid { grid-template-columns: 1fr; }
  .ing-search-wrap { max-width: 100%; }
}

/* ============ ADMIN BADGE (in main nav) ============ */
.admin-badge-link {
  font-size: 0.78rem; font-weight: 700; padding: 0.3rem 0.7rem;
  background: #1e293b; color: #f8fafc; border-radius: 6px;
  transition: var(--transition);
}
.admin-badge-link:hover { background: #0f172a; }

/* ============ ADMIN PANEL ============ */
.admin-body { background: #f1f5f9; }

.admin-shell {
  display: grid; grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  background: #1e293b; color: #cbd5e1;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.admin-brand {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 1.25rem 1.1rem; font-size: 1rem; font-weight: 700;
  color: white; border-bottom: 1px solid #334155;
  text-decoration: none;
}
.admin-nav { flex: 1; padding: 0.75rem 0.5rem; display: flex; flex-direction: column; gap: 2px; }
.admin-nav-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.85rem; border-radius: 8px;
  font-size: 0.88rem; font-weight: 500; color: #94a3b8;
  transition: background 0.15s, color 0.15s;
}
.admin-nav-item:hover { background: #334155; color: #f1f5f9; }
.admin-nav-item.active { background: var(--primary); color: white; }
.admin-nav-divider { height: 1px; background: #334155; margin: 0.5rem 0.85rem; }

.admin-sidebar-footer {
  padding: 1rem; border-top: 1px solid #334155;
}
.admin-user-info {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; color: #94a3b8; margin-bottom: 0.6rem;
}
.admin-user-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex-shrink: 0;
}
.admin-logout-btn {
  background: #334155; border: none; color: #94a3b8;
  padding: 0.4rem 0.75rem; border-radius: 6px; font-size: 0.8rem;
  cursor: pointer; font-family: var(--font); width: 100%;
  transition: background 0.15s;
}
.admin-logout-btn:hover { background: #475569; color: white; }

/* Main area */
.admin-main { display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
  background: white; border-bottom: 1px solid #e2e8f0;
  padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.admin-page-title { font-size: 1.15rem; font-weight: 700; color: #1e293b; }
.admin-date { font-size: 0.8rem; color: #94a3b8; }
.admin-content { padding: 1.5rem; flex: 1; }

/* Stat grid */
.admin-stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-bottom: 1.5rem;
}
.astat-card {
  background: white; border-radius: var(--radius); padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm); border: 1px solid #e2e8f0;
  display: grid; grid-template-columns: 2.5rem 1fr; grid-template-rows: auto auto;
  column-gap: 0.75rem; row-gap: 0;
}
.astat-icon { font-size: 1.6rem; grid-row: 1 / 3; align-self: center; }
.astat-body {}
.astat-num { font-size: 1.75rem; font-weight: 800; color: #1e293b; line-height: 1.1; }
.astat-label { font-size: 0.75rem; color: #64748b; margin-top: 2px; }
.astat-sub {
  grid-column: 2; font-size: 0.72rem; color: #94a3b8; margin-top: 4px;
}
.astat-ok  { border-left: 3px solid #22c55e; }
.astat-warn { border-left: 3px solid #f59e0b; }

/* Two-col layout */
.admin-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }

/* Admin card */
.admin-card {
  background: white; border-radius: var(--radius); border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm); margin-bottom: 1rem; overflow: hidden;
}
.admin-card-header {
  padding: 0.85rem 1.25rem; font-size: 0.88rem; font-weight: 700;
  border-bottom: 1px solid #e2e8f0; background: #f8fafc; color: #1e293b;
}
.admin-card-footer {
  padding: 0.65rem 1.25rem; font-size: 0.82rem; border-top: 1px solid #e2e8f0;
}
.admin-card-footer a { color: var(--primary); font-weight: 600; }
.admin-empty { padding: 1.5rem; text-align: center; color: #94a3b8; font-size: 0.88rem; }

/* Sparkbar chart */
.sparkbar-wrap {
  display: flex; align-items: flex-end; gap: 6px; padding: 1rem 1.25rem;
  height: 120px;
}
.sparkbar-col { display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; justify-content: flex-end; }
.sparkbar-bar {
  width: 100%; background: var(--primary); border-radius: 4px 4px 0 0;
  min-height: 4px; position: relative; transition: opacity 0.2s;
}
.sparkbar-bar:hover { opacity: 0.8; }
.sparkbar-tip {
  display: none; position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: white; font-size: 0.65rem; padding: 2px 5px; border-radius: 4px; white-space: nowrap;
}
.sparkbar-bar:hover .sparkbar-tip { display: block; }
.sparkbar-label { font-size: 0.65rem; color: #94a3b8; margin-top: 4px; }

/* Top pages */
.top-page-row {
  display: grid; grid-template-columns: 140px 1fr 40px;
  align-items: center; gap: 0.75rem; padding: 0.45rem 1.25rem;
  border-bottom: 1px solid #f1f5f9; font-size: 0.82rem;
}
.top-page-row:last-child { border-bottom: none; }
.top-page-path { font-family: monospace; font-size: 0.78rem; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-page-bar-wrap { background: #f1f5f9; border-radius: 4px; height: 8px; overflow: hidden; }
.top-page-bar { background: var(--primary); height: 100%; border-radius: 4px; }
.top-page-hits { font-weight: 700; font-size: 0.8rem; color: #1e293b; text-align: right; }

/* Tables */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.admin-table-sm { font-size: 0.78rem; }
.admin-table th {
  background: #f8fafc; padding: 0.6rem 1rem; text-align: left;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: #64748b; font-weight: 700; border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.admin-table td { padding: 0.65rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f8fafc; }
.td-mono { font-family: monospace; font-size: 0.75rem; color: #475569; }
.td-muted { color: #94a3b8; }
.td-center { text-align: center; }
.td-nowrap { white-space: nowrap; }
.td-ua { color: #94a3b8; font-size: 0.72rem; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-disabled td { opacity: 0.5; }
.row-fail td { background: #fff5f5; }

/* Badges */
.login-badge {
  font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}
.login-success { background: #dcfce7; color: #16a34a; }
.login-fail    { background: #fee2e2; color: #dc2626; }

.status-badge { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.status-active   { background: #dcfce7; color: #16a34a; }
.status-disabled { background: #fee2e2; color: #dc2626; }

.method-badge { font-size: 0.68rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.method-get  { background: #dbeafe; color: #1d4ed8; }
.method-post { background: #dcfce7; color: #15803d; }
.method-put  { background: #fef3c7; color: #92400e; }
.method-delete { background: #fee2e2; color: #991b1b; }

.http-badge { font-size: 0.68rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.http-2xx { background: #dcfce7; color: #15803d; }
.http-3xx { background: #dbeafe; color: #1d4ed8; }
.http-4xx { background: #fef3c7; color: #92400e; }
.http-5xx { background: #fee2e2; color: #991b1b; }

/* User row */
.user-row-name { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.user-row-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--primary);
  color: white; font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.admin-row-actions { display: flex; gap: 0.3rem; }

/* Filter bar */
.admin-filter-bar {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.admin-filter-form { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; flex: 1; }
.admin-search-input {
  padding: 0.45rem 0.85rem; border: 1.5px solid #e2e8f0; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-family: var(--font); outline: none; min-width: 220px;
}
.admin-search-input:focus { border-color: var(--primary); }
.admin-select {
  padding: 0.45rem 0.75rem; border: 1.5px solid #e2e8f0; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-family: var(--font); background: white; outline: none;
}
.admin-count { font-size: 0.82rem; color: #64748b; margin-left: auto; font-weight: 600; }

/* Tracking tabs */
.admin-tab-bar { display: flex; gap: 0; border-bottom: 2px solid #e2e8f0; margin-bottom: 1rem; }
.admin-tab {
  padding: 0.7rem 1.25rem; font-size: 0.88rem; font-weight: 600;
  color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.15s; display: flex; align-items: center; gap: 0.4rem;
}
.admin-tab:hover { color: var(--primary); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.atab-count {
  background: #f1f5f9; border-radius: 20px; padding: 1px 7px;
  font-size: 0.72rem; color: #64748b;
}
.admin-tracking-meta {
  display: flex; gap: 1.5rem; font-size: 0.82rem; color: #64748b;
  margin-bottom: 0.75rem;
}

@media (max-width: 1024px) {
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-two-col   { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
}
