/* NetKalori paneli.
 *
 * Tanıtım sitesinin token'ları burada da geçerli — panel ile site ve
 * mobil uygulamanın farklı görünmesi, aynı ürün olduklarını gizlerdi.
 * Fark yalnızca yoğunluk: panel bir çalışma aracı, tanıtım sayfası değil.
 */

:root {
  --brand: #0a8a53;
  --brand-bright: #12a362;
  --brand-deep: #005935;
  --brand-darkest: #04492d;
  --mint: #cdf5e6;
  --mint-pale: #e9faf2;
  --on-mint: #2a4a3b;

  --flame: #ff721e;
  --water: #3e9eff;
  --violet: #c78cf4;
  --amber: #f5a524;
  --danger: #c0392b;

  --page: #f6f6f6;
  --surface: #ffffff;
  --surface-alt: #f7f9f8;
  --ink: #14201a;
  --ink-soft: #46564e;
  --ink-muted: #8a9691;
  --line: #eaefec;
  --line-strong: #dce4e0;

  --radius: 14px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-deep); }

.hidden { display: none !important; }

/* ── Giriş ekranı ───────────────────────────────────────────────────── */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border-radius: 22px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 60px -30px rgba(4, 73, 45, 0.3);
}

.auth-card h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -0.5px; }
.auth-card .sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 26px; }

/* ── Form ───────────────────────────────────────────────────────────── */

label.field { display: block; margin-bottom: 16px; }

label.field span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand-bright);
  box-shadow: 0 0 0 3px rgba(18, 163, 98, 0.14);
}

textarea { resize: vertical; min-height: 90px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 18px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--brand-bright); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand); }

.btn-ghost {
  background: transparent;
  color: var(--brand-deep);
  border-color: var(--line-strong);
}
.btn-ghost:hover:not(:disabled) { background: var(--mint-pale); }

.btn-danger { background: transparent; color: var(--danger); border-color: #f0c9c4; }
.btn-danger:hover:not(:disabled) { background: #ffecec; }

.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

/* ── Uygulama kabuğu ────────────────────────────────────────────────── */

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

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  aside.side { position: static !important; height: auto !important; }
  aside.side nav { display: flex; overflow-x: auto; gap: 6px; }
  aside.side nav a { white-space: nowrap; }
  aside.side .side-foot { display: none; }
}

aside.side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 17px;
  color: var(--brand-deep);
  text-decoration: none;
  margin-bottom: 22px;
  padding: 0 8px;
}

.brand .mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-bright), var(--brand-deep));
  display: grid; place-items: center; color: #fff; font-size: 14px;
}

aside.side nav { display: flex; flex-direction: column; gap: 2px; }

aside.side nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

aside.side nav a:hover { background: var(--surface-alt); }
aside.side nav a.active { background: var(--mint-pale); color: var(--brand-deep); }

aside.side nav a .badge {
  margin-left: auto;
  background: var(--flame);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
}

.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.side-foot .who { font-size: 12px; color: var(--ink-muted); margin-bottom: 8px; word-break: break-all; }

main.content { padding: 28px 32px 60px; max-width: 1100px; }

@media (max-width: 600px) { main.content { padding: 20px 16px 48px; } }

/* ── Başlıklar ──────────────────────────────────────────────────────── */

.page-title {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-title h1 { font-size: 25px; margin: 0; letter-spacing: -0.5px; }
.page-title p { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }
.page-title .spacer { margin-left: auto; }

h2.section { font-size: 17px; margin: 28px 0 12px; letter-spacing: -0.2px; }

/* ── Kartlar ────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--line);
}

.card + .card { margin-top: 10px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.stat b { display: block; font-size: 24px; letter-spacing: -0.5px; }
.stat span { font-size: 12px; color: var(--ink-muted); }

/* ── Tablo ──────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }

thead th {
  background: var(--surface-alt);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-muted);
  font-weight: 700;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-alt); }

td.right, th.right { text-align: right; }

/* ── Rozet ──────────────────────────────────────────────────────────── */

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.pill.ok { background: var(--mint-pale); color: var(--brand-deep); border-color: #bfe9d5; }
.pill.warn { background: #fff9ec; color: #6b4e14; border-color: #f2e0b8; }
.pill.bad { background: #ffecec; color: #a5301f; border-color: #f3cdc7; }

/* ── Bilgi kutusu ───────────────────────────────────────────────────── */

.note {
  background: var(--mint-pale);
  color: var(--on-mint);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
}

.note.warn { background: #fff9ec; color: #6b4e14; }
.note.bad { background: #ffecec; color: #a5301f; }

/* ── Ölçüm çubuğu ───────────────────────────────────────────────────── */

.meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; }

/* ── Boş durum ──────────────────────────────────────────────────────── */

.empty { text-align: center; padding: 48px 24px; color: var(--ink-soft); }
.empty b { display: block; font-size: 17px; color: var(--ink); margin-bottom: 6px; }

/* ── Yükleniyor ─────────────────────────────────────────────────────── */

.spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--brand-bright);
  animation: spin 0.7s linear infinite; display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading { display: flex; align-items: center; gap: 10px; color: var(--ink-muted);
  padding: 32px; justify-content: center; }

/* ── Yan panel (detay) ──────────────────────────────────────────────── */

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(20, 32, 26, 0.4);
  display: grid; place-items: end center; z-index: 40;
}

.drawer {
  background: var(--surface);
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 24px;
}

@media (min-width: 700px) {
  .drawer-backdrop { place-items: center; }
  .drawer { border-radius: 20px; }
}

.drawer h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.4px; }
.drawer .sub { color: var(--ink-soft); font-size: 13px; margin: 0 0 20px; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Sekmeler ───────────────────────────────────────────────────────── */

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }

.tabs button {
  background: none; border: none; font: inherit; font-weight: 700;
  color: var(--ink-muted); padding: 9px 14px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}

.tabs button.active { color: var(--brand-deep); border-bottom-color: var(--brand-deep); }

/* ── Sohbet ─────────────────────────────────────────────────────────── */

.chat { display: flex; flex-direction: column; gap: 8px; max-height: 380px;
  overflow-y: auto; padding: 4px; }

.msg { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 14px; }
.msg.them { background: var(--surface-alt); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.me { background: var(--brand-deep); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg time { display: block; font-size: 10px; opacity: 0.65; margin-top: 3px; }

.chat-send { display: flex; gap: 8px; margin-top: 12px; }
.chat-send input { flex: 1; }
