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

:root {
  --green-dark:   #27500A;
  --green-mid:    #3B6D11;
  --green-btn:    #639922;
  --green-light:  #EAF3DE;
  --green-pale:   #C0DD97;
  --orange-dark:  #633806;
  --orange-mid:   #BA7517;
  --orange-light: #FAEEDA;
  --blue-dark:    #0C447C;
  --blue-mid:     #185FA5;
  --blue-light:   #E6F1FB;
  --red:          #A32D2D;
  --red-light:    #FCEBEB;
  --text:         #1C1C1E;
  --text-muted:   #636366;
  --text-faint:   #AEAEB2;
  --border:       rgba(0,0,0,0.09);
  --border-md:    rgba(0,0,0,0.15);
  --bg:           #F5F5F0;
  --white:        #ffffff;
  --radius:       10px;
  --radius-lg:    16px;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15.5px; line-height: 1.65; -webkit-font-smoothing: antialiased; }

/* ── Navbar ── */
.navbar { background: var(--green-dark); padding: 0 2.5rem; height: 68px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 200; box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.navbar-logo { color: var(--green-pale); font-size: 1.25rem; font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.navbar-logo span { color: #fff; }
.navbar-links { display: flex; gap: 2px; list-style: none; }
.nav-link { color: rgba(255,255,255,.72); text-decoration: none; font-size: .93rem; font-weight: 500; padding: 7px 14px; border-radius: 8px; transition: background .15s, color .15s; }
.nav-link:hover, .nav-link--active { background: rgba(255,255,255,.14); color: #fff; }
.navbar-right { display: flex; align-items: center; gap: 10px; }
.lang-switcher { display: flex; gap: 2px; background: rgba(255,255,255,.08); border-radius: 8px; padding: 3px; }
.lang-btn { background: transparent; color: rgba(255,255,255,.6); border: none; border-radius: 6px; font-size: .75rem; font-weight: 600; padding: 4px 8px; cursor: pointer; font-family: var(--font); letter-spacing: .03em; transition: background .15s, color .15s; }
.lang-btn:hover { color: #fff; }
.lang-btn.active { background: var(--green-pale); color: var(--green-dark); }
.nav-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--green-btn); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; text-decoration: none; flex-shrink: 0; cursor: pointer; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: var(--radius); padding: 9px 20px; font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: opacity .15s, transform .1s, box-shadow .15s; font-family: var(--font); white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--green-btn);  color: #fff; box-shadow: 0 2px 8px rgba(99,153,34,.28); }
.btn-primary:hover { opacity: .9; }
.btn-secondary { background: transparent; color: var(--green-mid); border: 1.5px solid var(--green-btn); }
.btn-secondary:hover { background: var(--green-light); }
.btn-blue      { background: var(--blue-mid);   color: #fff; box-shadow: 0 2px 8px rgba(24,95,165,.25); }
.btn-blue:hover { opacity: .9; }
.btn-orange    { background: var(--orange-mid);  color: #fff; }
.btn-orange:hover { opacity: .9; }
.btn-danger    { background: var(--red);         color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-sm  { padding: 6px 14px; font-size: .8rem; }
.btn-lg  { padding: 13px 30px; font-size: .98rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.page-section { padding: 3rem 0; }
.section-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: .35rem; }
.section-sub   { color: var(--text-muted); margin-bottom: 1.6rem; font-size: .93rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 1rem; }

/* ── Cards ── */
.card { background: var(--white); border: .5px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.card-hover { transition: transform .18s, box-shadow .18s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }

/* ── Hero ── */
.hero { background: var(--green-light); padding: 4.5rem 0 3.5rem; text-align: center; border-bottom: 1px solid rgba(0,0,0,.07); }
.hero h1 { font-size: 2.7rem; font-weight: 700; color: var(--green-dark); margin-bottom: .7rem; line-height: 1.15; }
.hero p  { color: var(--green-mid); font-size: 1.1rem; max-width: 540px; margin: 0 auto 2rem; line-height: 1.65; }
.hero-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-stats { display: flex; gap: 2.5rem; justify-content: center; flex-wrap: wrap; }
.hero-stat-val { font-size: 1.7rem; font-weight: 700; color: var(--green-dark); }
.hero-stat-lbl { font-size: .78rem; color: var(--green-mid); }

/* ── Food cards ── */
.food-card { background: var(--white); border: .5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: transform .18s, box-shadow .18s; }
.food-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.food-card-img { height: 140px; background: var(--green-light); display: flex; align-items: center; justify-content: center; font-size: 3rem; position: relative; }
.food-card-body { padding: .9rem; }
.food-card-name { font-weight: 600; font-size: .95rem; margin-bottom: 3px; }
.food-card-meta { font-size: .78rem; color: var(--text-muted); margin-bottom: 8px; }
.food-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.food-save-btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.85); border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.food-save-btn:hover { background: #fff; }

/* ── Tags ── */
.tag { display: inline-block; font-size: .7rem; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.tag-green  { background: var(--green-light);  color: var(--green-dark); }
.tag-orange { background: var(--orange-light); color: var(--orange-dark); }
.tag-blue   { background: var(--blue-light);   color: var(--blue-dark); }
.tag-red    { background: var(--red-light);     color: var(--red); }
.tag-gray   { background: #f0eeea; color: #555; }

/* ── Filter pills ── */
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-pill { background: var(--white); border: 1px solid var(--border); border-radius: 20px; padding: 5px 14px; font-size: .82rem; cursor: pointer; color: var(--text-muted); transition: all .15s; font-family: var(--font); }
.filter-pill:hover { border-color: var(--green-btn); color: var(--green-mid); }
.filter-pill.active { background: var(--green-light); border-color: var(--green-pale); color: var(--green-dark); font-weight: 500; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-muted); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .04em; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border-md); border-radius: var(--radius);
  font-size: .92rem; background: var(--white); color: var(--text); font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--green-btn); box-shadow: 0 0 0 3px rgba(99,153,34,.15);
}
.form-textarea { min-height: 90px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-error { color: var(--red); font-size: .82rem; margin-top: .3rem; }
.form-hint  { color: var(--text-muted); font-size: .82rem; margin-top: .3rem; }

/* ── Auth pages ── */
.auth-page { min-height: calc(100vh - 68px); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { background: var(--white); border: .5px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem; width: 100%; max-width: 420px; }
.auth-title { font-size: 1.5rem; font-weight: 700; margin-bottom: .4rem; }
.auth-sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 2rem; }

/* ── Plan cards ── */
.plan-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.plan-card.featured { border: 2px solid var(--green-btn); }
.plan-header { padding: 1.3rem; }
.plan-badge { display: inline-block; background: var(--green-light); color: var(--green-dark); font-size: .72rem; font-weight: 600; padding: 2px 10px; border-radius: 10px; margin-bottom: 8px; }
.plan-name  { font-size: 1.1rem; font-weight: 700; }
.plan-price { font-size: 2.1rem; font-weight: 700; color: var(--green-mid); margin: 4px 0 2px; }
.plan-price span { font-size: .85rem; font-weight: 400; color: var(--text-muted); }
.plan-divider { height: 1px; background: var(--border); }
.plan-features { padding: 1rem 1.3rem; flex: 1; }
.feature-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; font-size: .875rem; color: var(--text-muted); }
.feature-row .ck { color: var(--green-btn); flex-shrink: 0; font-weight: 700; }
.feature-row .cx { color: var(--text-faint); flex-shrink: 0; }
.plan-footer { padding: 0 1.3rem 1.3rem; }

/* ── Meal preview ── */
.meal-preview { background: #f4f7ed; border-radius: var(--radius-lg); padding: 1rem 1.2rem; }
.meal-day-title { font-size: .8rem; font-weight: 700; color: var(--green-mid); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.meal-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,.06); font-size: .85rem; }
.meal-row:last-child { border: none; padding-bottom: 0; }
.meal-type { color: var(--text-faint); min-width: 70px; font-size: .76rem; }
.meal-name { flex: 1; color: var(--text); }
.meal-kcal { color: var(--green-mid); font-weight: 600; font-size: .78rem; min-width: 60px; text-align: right; }
.meal-total { text-align: right; font-size: .82rem; font-weight: 700; color: var(--green-mid); margin-top: 8px; }

/* ── Exercise cards ── */
.exercise-card { background: var(--white); border: .5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.exercise-card.featured-ex { border: 2px solid var(--blue-mid); }
.exercise-header { display: flex; gap: 1rem; padding: 1rem; align-items: flex-start; }
.exercise-thumb { width: 68px; height: 68px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; flex-shrink: 0; }
.exercise-thumb.blue   { background: var(--blue-light); }
.exercise-thumb.green  { background: var(--green-light); }
.exercise-thumb.orange { background: var(--orange-light); }
.exercise-title { font-weight: 700; font-size: .98rem; margin-bottom: 3px; }
.exercise-meta  { font-size: .78rem; color: var(--text-muted); margin-bottom: 6px; }
.exercise-desc  { font-size: .84rem; color: var(--text-muted); line-height: 1.5; }
.exercise-footer { border-top: 1px solid var(--border); padding: .75rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-chip { background: var(--bg); border-radius: 4px; padding: 3px 8px; font-size: .73rem; color: var(--text-muted); }

/* ── BMI ── */
.bmi-widget { background: var(--blue-light); border-radius: var(--radius-lg); padding: 1.5rem; }
.bmi-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1rem; }
.bmi-form label { font-size: .8rem; color: var(--blue-dark); font-weight: 600; display: block; margin-bottom: 4px; }
.bmi-form input, .bmi-form select { width: 100%; padding: 9px 10px; border: 1px solid rgba(24,95,165,.25); border-radius: 7px; font-size: .9rem; background: var(--white); color: var(--text); font-family: var(--font); }
.bmi-result { border-radius: 8px; padding: .9rem 1.2rem; text-align: center; font-weight: 700; font-size: 1rem; margin-top: .5rem; }

/* ── Profile ── */
.profile-hero { background: var(--green-light); padding: 2rem; display: flex; gap: 1.5rem; align-items: center; border-radius: var(--radius-lg); margin-bottom: 1.5rem; }
.avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--green-btn); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; flex-shrink: 0; }
.profile-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 1.5rem; }
.stat-card { background: var(--white); border-radius: var(--radius-lg); padding: 1.2rem; text-align: center; border: .5px solid var(--border); }
.stat-card-val { font-size: 1.8rem; font-weight: 700; color: var(--text); }
.stat-card-lbl { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* ── Admin ── */
.admin-layout { display: flex; min-height: calc(100vh - 68px); }
.admin-sidebar { background: var(--green-dark); width: 220px; flex-shrink: 0; padding: 1rem 0; }
.admin-sidebar a { display: flex; align-items: center; gap: 8px; padding: 10px 1.5rem; color: rgba(255,255,255,.7); text-decoration: none; font-size: .875rem; transition: background .15s, color .15s; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--green-mid); color: #fff; }
.admin-main { flex: 1; padding: 2rem; background: var(--bg); overflow-y: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th { text-align: left; padding: 10px 12px; background: var(--bg); font-size: .76rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border: none; }
.admin-table tr:hover td { background: rgba(0,0,0,.015); }

/* ── Schedule ── */
.schedule-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.schedule-row:last-child { border: none; }
.day-badge { background: var(--blue-light); color: var(--blue-dark); font-weight: 700; font-size: .76rem; padding: 3px 10px; border-radius: 4px; min-width: 32px; text-align: center; flex-shrink: 0; }

/* ── Modal ── */
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 500; align-items: center; justify-content: center; padding: 1rem; }
.modal-bg.open { display: flex; }
.modal-box { background: var(--white); border-radius: var(--radius-lg); padding: 2rem; max-width: 460px; width: 100%; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); }
.modal-close:hover { color: var(--text); }

/* ── Alert / badge ── */
.alert { padding: .9rem 1.2rem; border-radius: var(--radius); font-size: .875rem; margin-bottom: 1rem; }
.alert-success { background: var(--green-light); color: var(--green-dark); }
.alert-error   { background: var(--red-light);   color: var(--red); }
.alert-info    { background: var(--blue-light);   color: var(--blue-dark); }
.status-badge  { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.badge-pub     { background: var(--green-light);  color: var(--green-dark); }
.badge-draft   { background: var(--orange-light); color: var(--orange-dark); }
.badge-paid    { background: var(--blue-light);   color: var(--blue-dark); }

/* ── Upload area ── */
.upload-area { border: 2px dashed var(--border-md); border-radius: var(--radius-lg); padding: 2rem; text-align: center; cursor: pointer; transition: border-color .15s; }
.upload-area:hover { border-color: var(--green-btn); background: var(--green-light); }

/* ── Search bar ── */
.search-wrap { position: relative; margin-bottom: 1.2rem; }
.search-wrap::before { content: '🔍'; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: .85rem; pointer-events: none; }
.search-input { width: 100%; padding: 10px 16px 10px 40px; border: 1.5px solid var(--border-md); border-radius: var(--radius); font-size: .92rem; font-family: var(--font); background: var(--white); transition: border-color .15s; }
.search-input:focus { outline: none; border-color: var(--green-btn); }

/* ── Footer ── */
.footer { background: var(--green-dark); color: rgba(255,255,255,.7); padding: 2rem; margin-top: 3rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-logo  { color: var(--green-pale); font-weight: 700; font-size: 1rem; }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,.65); text-decoration: none; font-size: .82rem; }
.footer-links a:hover { color: #fff; }
.footer-copy  { font-size: .78rem; opacity: .6; }

/* ── Utils ── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.w-full { width: 100%; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar { padding: 0 1.2rem; height: 60px; }
  .navbar-links, .lang-switcher { display: none; }
  .hero h1 { font-size: 1.9rem; }
  .bmi-form, .form-row { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .profile-stats { grid-template-columns: 1fr 1fr; }
}
