/* Pištora brand identity — dark theme, Linear/Notion lite layout for food tracker.
   Fonts: Bebas Neue from Google Fonts (loaded via <link> in base.html),
   body/mono use system stacks for speed + zero external deps. */

:root {
  /* Pištora palette */
  --warboss-green: #3D5A2F;
  --greentide: #5A8F3A;
  --carbon-black: #0F0F0F;
  --warning-yellow: #FFB400;
  --bone-white: #F5F1E8;
  --steel-gray: #3A3A3A;

  /* Functional aliases (dark theme) */
  --bg: #0F0F0F;
  --surface: #181818;
  --surface-elev: #1F1F1F;
  --border: rgba(245, 241, 232, 0.08);
  --border-strong: rgba(245, 241, 232, 0.14);
  --text: #F5F1E8;
  --text-secondary: rgba(245, 241, 232, 0.65);
  --text-muted: rgba(245, 241, 232, 0.42);
  --accent: #5A8F3A;
  --accent-strong: #3D5A2F;
  --warn: #FFB400;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 8px 24px rgba(0,0,0,0.25);

  --font-display: "Bebas Neue", "Impact", "Oswald", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Mobile fix (2026-05-15): zabránit horizontálnímu scrollování / zoom out */
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}

.app {
  min-width: 0;
  max-width: 100vw;
}
.main { min-width: 0; }
.sidebar { min-width: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--warn); }

::selection { background: var(--warboss-green); color: var(--bone-white); }

/* ============================================================
   Layout — sidebar + main, Linear-style
   ============================================================ */

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

.sidebar {
  background: #0A0A0A;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.brand__mark {
  width: 36px;
  height: 24px;
  background: url("/static/mark-pistol.svg") center / contain no-repeat;
}
.brand__name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--text);
}
.brand__sub {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-left: auto;
  font-weight: 600;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: background 120ms ease, color 120ms ease;
}
.nav__link:hover { background: rgba(245, 241, 232, 0.04); color: var(--text); }
.nav__link--active {
  background: rgba(90, 143, 58, 0.12);
  color: var(--bone-white);
  border-left: 2px solid var(--greentide);
  padding-left: 8px;
}
.nav__icon { font-size: 14px; width: 16px; display: inline-flex; justify-content: center; }

/* Sidebar widgets — E2: streak + personal records */
.sidebar .sidebar__widget {
  margin-top: 24px;
  padding: 14px 12px;
  background: rgba(90, 143, 58, 0.05);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warboss-green);
  border-radius: 2px;
}
.sidebar .sidebar__widget-label {
  font-family: var(--font-display, 'Bebas Neue'), sans-serif;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}
.sidebar .sidebar__widget-value {
  font-family: var(--font-display, 'Bebas Neue'), sans-serif;
  font-size: 32px;
  color: var(--bone-white);
  line-height: 1;
  margin-bottom: 4px;
  display: block;
}
.sidebar .sidebar__widget-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}
.sidebar .sidebar__widget-row {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  padding: 6px 0;
  border-top: 1px solid rgba(245, 241, 232, 0.06);
  line-height: 1.4;
}
.sidebar .sidebar__widget-row:first-of-type { border-top: none; padding-top: 2px; }
.sidebar .sidebar__widget-row > span:first-child {
  color: var(--text-muted);
  flex: 1 1 auto;
}
.sidebar .sidebar__widget-row > span:last-child {
  color: var(--bone-white);
  font-family: var(--font-mono, 'JetBrains Mono'), monospace;
  font-size: 11px;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Chart range buttons (weight page) */
.chart-range {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.sidebar__footer {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.main { padding: 32px 40px 60px; max-width: 980px; }

/* ============================================================
   Headings
   ============================================================ */

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 8px 0 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head__title {
  font-family: var(--font-display);
  font-size: 38px;
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1;
  color: var(--text);
  text-transform: uppercase;
  font-weight: 400;
}
.page-head__sub {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.hl-green { color: var(--greentide); }
.hl-yellow { color: var(--warning-yellow); }

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.card + .card { margin-top: 16px; }

.card__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 14px;
  font-weight: 600;
}

/* ============================================================
   Stats grid
   ============================================================ */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
}
.stat__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}
.stat__value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 500;
  color: var(--text);
  margin: 12px 0 4px;
  line-height: 1;
  font-feature-settings: "tnum";
}
.stat__value--accent { color: var(--greentide); }
.stat__value--warn { color: var(--warning-yellow); }
.stat__suffix {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
}
.stat__unit {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}
.stat__progress {
  margin-top: 8px;
  height: 3px;
  background: rgba(245, 241, 232, 0.06);
  border-radius: 2px;
  overflow: hidden;
}
.stat__progress-fill {
  height: 100%;
  background: var(--greentide);
  transition: width 200ms ease;
}
.stat__progress-fill--over { background: var(--warning-yellow); }

/* ============================================================
   Meals
   ============================================================ */

.meals { display: flex; flex-direction: column; gap: 12px; }
.meal {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 120ms ease;
}
.meal:hover { border-color: var(--border-strong); }
.meal__thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: #222 center / cover no-repeat;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.meal__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-muted);
}
.meal__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meal__time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.meal__desc {
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meal__macros {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.meal__kcal {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--greentide);
  letter-spacing: 0.02em;
  text-align: right;
  white-space: nowrap;
  font-weight: 400;
}
.meal__kcal-unit {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-body);
  letter-spacing: 0.05em;
  margin-left: 4px;
}

/* ============================================================
   Data table
   ============================================================ */

.data-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.data-table th {
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
.data-table td.num, .data-table th.num { text-align: right; font-family: var(--font-mono); }
.data-table tr:last-child td { border-bottom: none; }

/* ============================================================
   Forms
   ============================================================ */

.form-row {
  display: grid;
  grid-template-columns: 160px 1fr 80px;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.form-row:last-child { border-bottom: none; }
.form-row__label { color: var(--text-secondary); font-size: 13px; }
.form-row__input {
  background: #0A0A0A;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  width: 100%;
  transition: border-color 120ms ease;
}
.form-row__input:focus { outline: none; border-color: var(--greentide); }
.form-row__unit { color: var(--text-muted); font-size: 12px; font-family: var(--font-mono); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
  font-family: var(--font-body);
}
.btn:hover { background: rgba(245, 241, 232, 0.04); }
.btn--primary {
  background: var(--warboss-green);
  border-color: var(--warboss-green);
  color: var(--bone-white);
}
.btn--primary:hover { background: var(--greentide); border-color: var(--greentide); }

/* ============================================================
   Chart card
   ============================================================ */

.chart-card { margin-top: 20px; padding: 24px 20px 16px; }
.chart-wrap { position: relative; width: 100%; height: 280px; }
.chart-wrap canvas { display: block; max-width: 100%; }

/* ============================================================
   Login page
   ============================================================ */

.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.login__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 480px;
  text-align: center;
}
.login__mark {
  width: 64px;
  height: 44px;
  margin: 0 auto 20px;
  background: url("/static/mark-pistol.svg") center / contain no-repeat;
}
.login__title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 12px;
  font-weight: 400;
}
.login__lead {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 16px;
}
code {
  background: rgba(245, 241, 232, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--text);
}

/* ============================================================
   Responsive
   ============================================================ */

/* ============================================================
   Mobile breakpoints (F task 2026-05-15)
   - tablet  ≤ 880 px
   - phone   ≤ 600 px (S24 Ultra portrait je ~412 dp)
   - small   ≤ 400 px
   ============================================================ */

@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-right: none;
    border-
/* ============================================================
   Hub Landing — top bar + rozcestník tiles (H3 2026-05-17)
   ============================================================ */

.hub-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: #0A0A0A;
  border-bottom: 1px solid var(--border);
}

.top-bar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
}

.top-bar__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex: 1;
}

.top-bar__link {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}

.top-bar__link:hover {
  background: rgba(245, 241, 232, 0.04);
  color: var(--text);
}

.top-bar__link--active {
  background: rgba(90, 143, 58, 0.12);
  color: var(--accent);
}

.top-bar__user .top-bar__logout {
  font-size: 13px;
}

.hub-main {
  flex: 1;
  padding: 32px 24px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.hub-footer {
  padding: 16px 24px;
  font-size: 12px;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* Rozcestník header */
.hub-home__header {
  margin-bottom: 32px;
}

.hub-home__title {
  font-family: var(--font-display);
  font-size: 48px;
  letter-spacing: 1px;
  margin: 0 0 4px 0;
}

.hub-home__sub {
  margin: 0;
  font-size: 14px;
}

/* Tiles grid */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--text);
  min-height: 180px;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.tile--active:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--surface-elev);
}

.tile--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tile__icon {
  font-size: 36px;
}

.tile__title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 1px;
}

.tile__desc {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
}

.tile__cta {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

