/* eletmod.kosinet.top — privát életmód-tudástár
   A kosinet-brand kék alapja (repair/panel/nyelvek appokkal egy család), de az
   akcent zöld: itt az "egészséges/bevált" a fő visszajelzés. Tokenizált téma,
   világos/sötét + rendszer-alapértelmezés. */

:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --border: #dde5ee;
  --text: #16202e;
  --muted: #5a6a80;
  --primary: #2563eb;
  --primary-ink: #1d4ed8;
  --primary-soft: #e5edff;
  --accent: #059669;            /* zöld: bevált / egészség */
  --accent-soft: #d9f5e9;
  --warn: #ea580c;
  --warn-soft: #ffe9dc;
  --bad: #dc2626;
  --shadow: 0 1px 2px rgba(16,32,55,.06), 0 8px 24px rgba(16,32,55,.06);
  --radius: 14px;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1119; --surface: #131b27; --surface-2: #1a2536; --border: #26344a;
    --text: #e8eef7; --muted: #93a3ba; --primary: #5b8cff; --primary-ink: #79a1ff;
    --primary-soft: #17233c; --accent: #34d17f; --accent-soft: #10301f;
    --warn: #ff7a3c; --warn-soft: #33210f; --bad: #f87171;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #0c1119; --surface: #131b27; --surface-2: #1a2536; --border: #26344a;
  --text: #e8eef7; --muted: #93a3ba; --primary: #5b8cff; --primary-ink: #79a1ff;
  --primary-soft: #17233c; --accent: #34d17f; --accent-soft: #10301f;
  --warn: #ff7a3c; --warn-soft: #33210f; --bad: #f87171;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans);
  line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; }
img { max-width: 100%; }

/* ---- layout ---- */
.shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800;
  font-size: 1.15rem; letter-spacing: -.02em; padding: 6px 8px 16px; }
.brand .logo { width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; background: linear-gradient(135deg, var(--primary), #10b981);
  color: #fff; font-size: 1.1rem; box-shadow: var(--shadow); }
.brand small { display: block; font-weight: 500; font-size: .68rem; color: var(--muted);
  letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px;
  color: var(--text); font-weight: 500; font-size: .93rem; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.on { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.nav .sep { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); padding: 14px 11px 4px; font-weight: 700; }

.main { padding: 22px 30px 60px; max-width: 1140px; width: 100%; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.searchbar { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); }
.searchbar input { flex: 1; border: 0; background: transparent; color: var(--text);
  font-size: .98rem; outline: none; font-family: var(--sans); }
.iconbtn { border: 1px solid var(--border); background: var(--surface); color: var(--text);
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center; box-shadow: var(--shadow); }
.iconbtn:hover { background: var(--surface-2); }

/* ---- headings ---- */
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
.page-h h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.02em; }
.page-h .sub { color: var(--muted); font-size: .9rem; }

/* ---- stat cards ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); color: var(--text); }
.stat:hover { text-decoration: none; border-color: var(--primary); }
.stat .n { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }

/* ---- grids / cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: block; color: var(--text); }
.card:hover { text-decoration: none; border-color: var(--primary); }
.card .ct { font-weight: 600; font-size: 1rem; }
.card .cc { color: var(--muted); font-size: .84rem; margin-top: 2px; }

/* képes kártya (tipp/recept listák) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.tile .thumb { display: block; aspect-ratio: 16/10; background: var(--surface-2); overflow: hidden; }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .thumb.ph { display: grid; place-items: center; font-size: 2.2rem; opacity: .5; }
.tile .body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.tile .tt { font-weight: 650; color: var(--text); }
.tile .tt:hover { text-decoration: none; color: var(--primary-ink); }
.tile .tm { color: var(--muted); font-size: .82rem; }
.tile .foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }

/* ---- section ---- */
.section { margin-top: 30px; }
.section > h2 { font-size: 1.05rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }

/* ---- list rows ---- */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row .rt { font-weight: 600; }
.row .rm { color: var(--muted); font-size: .84rem; }
.row .grow { flex: 1; min-width: 0; }

/* ---- pills / tags / csillag ---- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.cat { background: var(--primary-soft); color: var(--primary-ink); }
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.mid { background: var(--warn-soft); color: var(--warn); }
.pill.no { background: #fde8e8; color: var(--bad); }
:root[data-theme="dark"] .pill.no { background: #3b1a1a; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .74rem; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; }
a.tag:hover { background: var(--primary-soft); color: var(--primary-ink); text-decoration: none; }
.stars { color: #f59e0b; letter-spacing: 1px; font-size: .9rem; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); padding: 9px 15px; border-radius: 10px;
  font-weight: 600; font-size: .9rem; cursor: pointer; font-family: var(--sans); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-ink); }
.btn.good { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f0c4c4; }
.btn.sm { padding: 6px 11px; font-size: .82rem; }
.btn.icon { padding: 6px 9px; }
.btnbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- szűrő-sáv ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filters a { border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 6px 12px; border-radius: 999px; font-size: .84rem; font-weight: 500; }
.filters a:hover { background: var(--surface-2); text-decoration: none; }
.filters a.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- forms ---- */
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; max-width: 860px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font-size: .95rem; font-family: var(--sans); }
.field textarea { min-height: 220px; resize: vertical; line-height: 1.6; }
.field textarea.short { min-height: 90px; }
.field .hint { color: var(--muted); font-size: .8rem; margin-top: 5px; }
.field .inline { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .9rem; }
.field .inline input[type=checkbox] { width: auto; accent-color: var(--primary); }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.frow3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.frow4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.formactions { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }

/* ---- prose ---- */
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 30px; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.4em; }
.prose h1:first-child, .prose h2:first-child { margin-top: 0; }
.prose code { font-family: var(--mono); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .88em; }
.prose pre { background: var(--surface-2); padding: 14px 16px; border-radius: 10px; overflow-x: auto; border: 1px solid var(--border); }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface-2); }
.prose blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding: 4px 16px; color: var(--muted); }

/* ---- tapasztalat-doboz (a tudástár lelke) ---- */
.exp { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius);
  padding: 16px 18px; margin: 18px 0; }
.exp.mid { border-color: var(--warn); background: var(--warn-soft); }
.exp.no { border-color: var(--bad); background: #fde8e8; }
:root[data-theme="dark"] .exp.no { background: #3b1a1a; }
.exp .eh { font-weight: 700; font-size: .95rem; margin-bottom: 4px; }

/* ---- média ---- */
.mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.mitem { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; box-shadow: var(--shadow); }
.mitem .mthumb { display: block; aspect-ratio: 1/1; background: var(--surface-2); }
.mitem .mthumb img, .mitem video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mitem .mmeta { padding: 8px 10px; font-size: .78rem; color: var(--muted);
  display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.mediastrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.mediastrip video { width: 100%; border-radius: 10px; background: #000; }
.mediastrip img { width: 100%; border-radius: 10px; cursor: zoom-in; display: block; }

/* képnagyító (lightbox) — a nyelvek app vocabcard mintája */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none;
  place-items: center; z-index: 50; padding: 20px; }
.lightbox.on { display: grid; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 10px; }

/* ---- napló-grafikon (saját SVG, nincs külső chart-lib) ---- */
.chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; }
.chart h3 { margin: 0 0 10px; font-size: .95rem; }
.chart svg { width: 100%; height: 130px; display: block; overflow: visible; }
.chart .empty-c { color: var(--muted); font-size: .85rem; padding: 24px 0; text-align: center; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.bars .b { flex: 1; background: var(--primary-soft); border-radius: 3px 3px 0 0; min-height: 2px; }
.bars .b.hi { background: var(--primary); }

/* ---- táblázat (napló) ---- */
.tbl { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-top: 1px solid var(--border); font-size: .9rem; }
.tbl th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); border-top: 0; }
.tbl td.num { font-variant-numeric: tabular-nums; }
.tblwrap { overflow-x: auto; }

/* ---- flash / empty / meta ---- */
.meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted);
  font-size: .84rem; margin-bottom: 16px; }
.flash { padding: 11px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: var(--accent-soft); color: var(--accent); }
.flash.error { background: #fde8e8; color: var(--bad); }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty .big { font-size: 2.4rem; margin-bottom: 8px; }

/* ---- login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--primary-soft), var(--bg)); }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 34px; width: 100%; max-width: 380px; text-align: center; }
.login-box .logo { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 14px;
  display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #10b981);
  color: #fff; font-size: 1.6rem; }
.login-box h1 { font-size: 1.3rem; margin: 0 0 4px; }
.login-box p { color: var(--muted); margin: 0 0 22px; font-size: .9rem; }
.login-box input[type=password] { width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 11px; background: var(--bg); color: var(--text); font-size: 1rem; margin-bottom: 12px; }
.login-box .btn { width: 100%; justify-content: center; padding: 12px; }
.login-box .rem { display: flex; align-items: center; gap: 8px; justify-content: center;
  font-size: .85rem; color: var(--muted); margin-bottom: 14px; }

/* ---- eszközök (kalkulátorok) ---- */
.calc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.calc h2 { margin: 0 0 12px; font-size: 1.05rem; }
.calc .out { margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px;
  font-weight: 600; }
.disclaimer { color: var(--muted); font-size: .82rem; margin-top: 18px; }

/* ---- nyomtatás: recept/tipp kártya tisztán ---- */
@media print {
  .side, .topbar, .btnbar, .formactions, .flash, .filters { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .main { padding: 0; max-width: none; }
  .prose, .card, .tile, .tbl { box-shadow: none; border-color: #ccc; }
  body { background: #fff; color: #000; }
}

/* ---- mobil ---- */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border);
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .side .brand { padding: 4px 8px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav .sep { display: none; }
  .frow, .frow3, .frow4 { grid-template-columns: 1fr 1fr; }
  .main { padding: 18px 16px 50px; }
}
