/* ══════════════════════════════════════════════════════════════════
   DISMYLO NUTRITION — SHARED STYLES
   Matches index.html design language (purple palette, Syne + DM Mono)
══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #2d1042;
  --bg-2: #220c34;
  --surface: #3e1a58;
  --surface-hi: #4c2268;
  --border: rgba(255,255,255,0.10);
  --border-hi: rgba(255,255,255,0.22);
  --text: #ffffff;
  --text-2: rgba(255,255,255,0.68);
  --muted: rgba(255,255,255,0.42);
  --muted-lo: rgba(255,255,255,0.22);
  --good: #5cc4a0;
  --warn: #f0b860;
  --bad: #f07878;
  --accent: #c49ef5;

  --nutri: #a8d860;

  --r: 12px;
  --r-sm: 8px;
  --page-px: clamp(14px, 4vw, 36px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Mono', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 30px 30px;
}
body::after {
  content: ''; position: fixed; top: -25vh; left: 50%;
  transform: translateX(-50%);
  width: 100vw; height: 65vh; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(168,216,96,0.18) 0%, transparent 68%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }

/* ══════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════ */
.nutrition-topbar {
  position: sticky; top: 0; z-index: 200;
  height: 52px;
  background: rgba(18,5,32,0.94);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--page-px);
  display: flex;
  align-items: center;
  gap: 16px;
}
.ntb-back {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: .18s;
  flex-shrink: 0;
}
.ntb-back:hover { color: #fff; border-color: var(--border-hi); background: rgba(255,255,255,0.05); }
.ntb-arrow { font-size: 0.9rem; line-height: 1; }

.ntb-title {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.ntb-logo { font-size: 1.1rem; }
.ntb-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  letter-spacing: -0.4px;
  color: #fff;
}

.ntb-tabs {
  display: flex; gap: 4px;
  flex: 1;
  justify-content: flex-end;
  overflow-x: auto;
  scrollbar-width: none;
}
.ntb-tabs::-webkit-scrollbar { display: none; }
.ntb-tab {
  font-size: clamp(0.5rem, 1.3vw, 0.6rem);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: clamp(5px,1vw,7px) clamp(9px,1.8vw,14px);
  border-radius: 7px;
  transition: .18s;
  white-space: nowrap;
}
.ntb-tab:hover {
  color: #fff;
  border-color: var(--border-hi);
  background: rgba(255,255,255,0.05);
}
.ntb-tab.active {
  color: var(--nutri);
  border-color: rgba(168,216,96,0.4);
  background: rgba(168,216,96,0.08);
}

/* ══════════════════════════════════════════════
   PAGE WRAPPER
══════════════════════════════════════════════ */
.n-page {
  position: relative; z-index: 1;
  width: 100%; max-width: 1120px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 50px) var(--page-px) 80px;
}

.n-hero {
  margin-bottom: clamp(26px, 5vw, 44px);
}
.n-hero-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  letter-spacing: clamp(-2px, -0.4vw, -3.5px);
  line-height: 0.95;
  background: linear-gradient(130deg, #fff 35%, rgba(168,216,96,0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.n-hero-sub {
  font-size: clamp(0.48rem, 1.2vw, 0.6rem);
  color: var(--muted);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 9px;
}

.n-section-label {
  font-size: clamp(0.42rem, 1vw, 0.52rem);
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--nutri);
  margin: clamp(24px, 5vw, 40px) 0 10px;
  display: flex; align-items: center; gap: 7px;
}
.n-section-label::before {
  content: '';
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--nutri);
}

/* ══════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════ */
.n-card {
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: clamp(14px,2.2vw,18px);
  transition: background .18s, border-color .18s;
}
.n-card:hover { background: rgba(255,255,255,0.07); border-color: var(--border-hi); }
.n-card-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(0.82rem, 2vw, 0.95rem);
  letter-spacing: -0.3px;
  color: #fff;
  margin-bottom: 4px;
}
.n-card-sub {
  font-size: clamp(0.52rem, 1.2vw, 0.6rem);
  color: var(--muted);
  line-height: 1.5;
}

.n-grid {
  display: grid;
  gap: clamp(8px, 1.5vw, 14px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

/* ══════════════════════════════════════════════
   BUTTONS + INPUTS
══════════════════════════════════════════════ */
.n-btn {
  font-family: 'DM Mono', monospace;
  font-size: clamp(0.48rem, 1.2vw, 0.56rem);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  padding: clamp(7px, 1.2vw, 9px) clamp(11px, 2vw, 15px);
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  transition: .18s;
  white-space: nowrap;
}
.n-btn:hover { color: #fff; border-color: var(--border-hi); background: rgba(255,255,255,0.05); }
.n-btn.primary {
  background: rgba(168,216,96,0.1);
  border-color: rgba(168,216,96,0.35);
  color: var(--nutri);
}
.n-btn.primary:hover { background: rgba(168,216,96,0.2); color: #fff; border-color: rgba(168,216,96,0.6); }
.n-btn.accent {
  background: rgba(196,158,245,0.1);
  border-color: rgba(196,158,245,0.32);
  color: var(--accent);
}
.n-btn.accent:hover { background: rgba(196,158,245,0.22); color: #fff; }
.n-btn.danger {
  background: rgba(240,120,120,0.08);
  border-color: rgba(240,120,120,0.3);
  color: var(--bad);
}
.n-btn.danger:hover { background: rgba(240,120,120,0.18); color: #fff; }
.n-btn.small {
  padding: 4px 10px;
  font-size: 0.48rem;
  letter-spacing: 1.5px;
}

.n-input, .n-select, .n-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: #fff;
  outline: none;
  transition: .18s;
}
.n-input:focus, .n-select:focus, .n-textarea:focus {
  border-color: rgba(168,216,96,0.45);
  background: rgba(255,255,255,0.08);
}
.n-input::placeholder { color: var(--muted); }
.n-select option { background: #1a0630; color: #fff; }

.n-label {
  font-size: clamp(0.4rem, 1vw, 0.46rem);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(168,216,96,0.7);
  margin-bottom: 5px;
  display: block;
}

.n-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 11px; }

/* ══════════════════════════════════════════════
   STATUS BADGES
══════════════════════════════════════════════ */
.n-status {
  display: inline-block;
  font-size: clamp(0.4rem, 1vw, 0.46rem);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════
   MACRO BAR
══════════════════════════════════════════════ */
.n-macro-row {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}
.n-macro-label {
  font-size: 0.52rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.n-macro-val {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: -0.3px;
  color: #fff;
  white-space: nowrap;
}
.n-macro-val .tgt { color: var(--muted); font-weight: 500; }
.n-macro-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}
.n-macro-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .35s;
}

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
.n-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,2,22,0.8);
  backdrop-filter: blur(12px);
  z-index: 600;
  align-items: center; justify-content: center;
  padding: 16px;
}
.n-modal-overlay.open { display: flex; }

.n-modal {
  background: #160828;
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  animation: nFade .2s ease both;
  box-shadow: 0 28px 80px rgba(0,0,0,.7);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.n-modal-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 13px;
  border-bottom: 1px solid var(--border);
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.3px;
  color: #fff;
}
.n-modal-close {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px;
  transition: color .18s;
}
.n-modal-close:hover { color: #fff; }
.n-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}
.n-modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 13px 20px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

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

/* ══════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════ */
.n-toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(18,5,32,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  padding: 10px 18px;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.5px;
  color: #fff;
  z-index: 900;
  opacity: 0;
  transition: transform .25s, opacity .25s;
  pointer-events: none;
  max-width: 90%;
}
.n-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════════════
   EMPTY STATES
══════════════════════════════════════════════ */
.n-empty {
  padding: clamp(24px, 4vw, 36px);
  border: 1px dashed var(--border);
  border-radius: var(--r);
  text-align: center;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.7;
}
.n-empty-icon { font-size: 1.6rem; opacity: .4; margin-bottom: 10px; display: block; }
