/* ============================================================
   Flexcon brand tokens + type system
   ------------------------------------------------------------
   Imported by ``mockups/_dash.css`` (mockup canvas) AND by
   ``static/css/sfqa.css`` (production app). The mockup files
   reference these custom properties without a fallback, so this
   file MUST be present for the design to render correctly.

   Anchored on the brand identity from
   docs/CC-HANDOFF-dashboard-attendance.md and the explicit
   hex literals in _dash.css:
     • #0098D8  — primary cyan (Flexcon blue)
     • #0F2A44  — navy chrome (top nav background)
     • #003E5C  — deep navy accent
     • #7DD3FC  — soft cyan highlight (logo, hover states)
     • #F4F5F7  — page canvas background

   Type system: Saira (display + body) — the brand face per the
   handoff brief. JetBrains Mono kept as the monospace for
   numeric tabular data + code chips.
   ============================================================ */

/* ---------- Font loading ----------------------------------------
   Self-hosted under /static/fonts/. Czech corporate / iPad networks
   block fonts.googleapis.com — the earlier external @import left
   the dashboard rendering in system-fallback face. base.html now
   links /static/fonts/fonts.css directly, but @import-ing here
   too means any standalone consumer of sfqa.css (mockup preview
   pages, ad-hoc utility scripts) also picks up the right faces. */
@import url('/static/fonts/fonts.css');

:root {
  /* Tokens canonicalised to match the Flexcon Design System v1.0
     (see /shopfloor/Flexcon Design System/colors_and_type.css).
     If these drift again, that file is the source of truth — sync
     these values to it, NOT the other way around. */

  /* --- Type families -------------------------------------------------- */
  --font-display: 'Saira', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body:    'Saira', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* --- Brand blue ramp (anchored on #0098D8 — exact logo color) ----- */
  --flx-blue:        #0098D8;
  --flx-blue-50:     #E6F4FB;
  --flx-blue-100:    #C7E6F5;
  --flx-blue-600:    #0085C0;   /* hover */
  --flx-blue-700:    #0070A3;   /* pressed / link */
  --flx-blue-800:    #005983;   /* dark accent */
  --flx-blue-900:    #003E5C;   /* deep headings */

  /* --- Neutral ramp (warm-cool industrial grays) --------------------- */
  --flx-ink:         #0F1722;   /* deepest text */
  --flx-graphite:    #1F2937;   /* headings */
  --flx-slate:       #3B4554;   /* sub-headings */
  --flx-steel:       #6B7280;   /* secondary text */
  --flx-silver:      #A8A8B0;   /* logo gray — captions / dividers */
  --flx-mist:        #D8DCE2;   /* borders, hairlines */
  --flx-cloud:       #EEF1F4;   /* subtle fills */
  --flx-fog:         #F6F8FA;   /* page bg alt */
  --flx-paper:       #FFFFFF;   /* surface */

  /* --- Semantic colours (with -50 tints) ----------------------------- */
  --flx-success:     #2E9E5C;
  --flx-success-50:  #E6F5EC;
  --flx-warning:     #E89B2A;
  --flx-warning-50:  #FCF1DD;
  --flx-danger:      #C8413A;
  --flx-danger-50:   #FAE7E5;

  /* --- Accent — copper, conductor highlight, USED SPARINGLY ---------- */
  --flx-copper:      #C86B3C;
  --flx-copper-tint: #F5E6DC;

  /* --- Foreground / background semantic aliases ---------------------- */
  --fg-1: var(--flx-graphite);
  --fg-2: var(--flx-slate);
  --fg-3: var(--flx-steel);
  --fg-4: var(--flx-silver);
  --fg-on-brand: #FFFFFF;
  --bg-1: var(--flx-paper);
  --bg-2: var(--flx-fog);
  --bg-3: var(--flx-cloud);
  --bg-brand: var(--flx-blue);
  --bg-brand-soft: var(--flx-blue-50);

  /* --- Borders -------------------------------------------------------- */
  --border-1:        var(--flx-mist);   /* hairline default */
  --border-2:        #C5CAD2;            /* slightly heavier — input outlines */
  --border-strong:   var(--flx-slate);

  /* --- Type scale + tracking ----------------------------------------- */
  --fs-12: 0.75rem; --fs-13: 0.8125rem; --fs-14: 0.875rem;
  --fs-16: 1rem; --fs-18: 1.125rem; --fs-20: 1.25rem;
  --fs-24: 1.5rem; --fs-30: 1.875rem; --fs-38: 2.375rem;
  --fs-48: 3rem; --fs-64: 4rem;
  --lh-tight: 1.1; --lh-snug: 1.25; --lh-normal: 1.5; --lh-loose: 1.7;
  --tracking-display: -0.035em;
  --tracking-tight:   -0.02em;
  --tracking-normal:  -0.011em;
  --tracking-wide:    0.02em;
  --tracking-wider:   0.08em;

  /* --- Spacing scale (4px base) -------------------------------------- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px;

  /* --- Radii ---------------------------------------------------------- */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;   /* default — buttons, inputs */
  --radius-lg: 18px;   /* cards */
  --radius-xl: 24px;   /* hero surfaces */
  --radius-2xl: 32px;
  --radius-pill: 999px;

  /* --- Borders + shadow (restrained — borders carry the language) ---- */
  --border-w: 1px;
  --border-w-strong: 2px;
  --shadow-1: 0 1px 2px rgba(15,23,34,0.04);
  --shadow-2: 0 4px 14px rgba(15,23,34,0.06), 0 1px 3px rgba(15,23,34,0.03);
  --shadow-3: 0 18px 48px rgba(15,23,34,0.10), 0 4px 12px rgba(15,23,34,0.05);
  --shadow-focus: 0 0 0 4px rgba(0,152,216,0.22);

  /* --- Motion --------------------------------------------------------- */
  --ease-standard: cubic-bezier(0.2, 0.0, 0.2, 1);
  --ease-emphasis: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --dur-slow: 280ms;
}/* ============================================================
   Shared SFQA dashboard mockup styles
   Referenced by dashboard-a.html and dashboard-b.html
   ============================================================ */

/* tokens inlined above — no import needed in production */

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--flx-fog);
  color: var(--flx-graphite);
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Wire-trace pattern (very low opacity, on navy chrome) ---------- */
.wire-bg {
  background-color: #0F2A44;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><g fill='none' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1.2' stroke-linecap='round'><path d='M-10 90 L40 60 L80 90'/><path d='M20 110 L70 70 L120 100'/></g><g fill='%23ffffff' fill-opacity='0.10'><circle cx='40' cy='60' r='1.8'/><circle cx='80' cy='90' r='1.8'/><circle cx='70' cy='70' r='1.8'/></g></svg>");
  background-repeat: repeat;
}

/* ---------- Top nav (shared across both variants) ---------- */
.nav {
  position: sticky; top: 0; z-index: 5;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 18px;
  height: 52px;
  display: flex; align-items: center; gap: 12px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand .mark {
  width: 28px; height: 28px; border-radius: 7px; background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.nav-brand .mark img { width: 22px; height: 22px; display: block; }
.nav-brand .name { font-family: var(--font-display); font-weight: 500; font-size: 14px; letter-spacing: -0.005em; }
.nav-brand .name b { font-weight: 600; color: #7DD3FC; }

.nav-search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}
.nav-search svg { width: 14px; height: 14px; opacity: 0.7; }

.nav-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: #fff; cursor: pointer;
}
.nav-icon-btn:hover { background: rgba(255,255,255,0.08); }
.nav-icon-btn svg { width: 18px; height: 18px; }
.nav-role {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; padding: 4px 10px 4px 6px;
  background: rgba(255,255,255,0.06); border-radius: 999px;
}
.nav-role .avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #0098D8, #003E5C);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
}

/* On phone, nav collapses */
@media (max-width: 640px) {
  .nav-search { display: none; }
  .nav-role .label { display: none; }
}

/* ---------- Main canvas ---------- */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}
@media (max-width: 640px) {
  .main { padding: 18px 14px 90px; }
}

/* ---------- Greeting block ---------- */
.greet { margin-bottom: 22px; }
.greet h1 {
  font-size: 28px; font-weight: 500; letter-spacing: -0.02em;
  margin: 0 0 4px;
  color: var(--flx-graphite);
}
.greet .meta {
  font-size: 13px; color: var(--flx-steel);
}
.greet .meta b { color: var(--flx-graphite); font-weight: 500; }

/* ---------- Section label (uppercase eyebrow with rule) ---------- */
.section-rule {
  display: flex; align-items: center; gap: 12px;
  margin: 28px 0 14px;
}
.section-rule .lbl {
  font-family: var(--font-display); font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--flx-steel);
}
.section-rule .line {
  flex: 1; height: 1px; background: var(--border-1);
}

/* ---------- Generic tile shared between variants ---------- */
.tile {
  display: flex; align-items: center; gap: 14px;
  background: #fff;
  border: 1px solid var(--border-1);
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, background .15s, transform .15s;
  position: relative;
  min-height: 76px;
}
.tile:hover { border-color: var(--flx-blue-100); background: #FCFDFE; }
.tile:active { transform: translateY(1px); }

.tile-ico {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--flx-blue-50); color: var(--flx-blue-700);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.tile-ico svg { width: 20px; height: 20px; }
.tile-body { flex: 1; min-width: 0; }
.tile-title {
  font-family: var(--font-display); font-size: 15px; font-weight: 500;
  color: var(--flx-graphite); letter-spacing: -0.008em;
}
.tile-meta {
  font-size: 12px; color: var(--flx-steel); margin-top: 2px;
  letter-spacing: -0.005em;
}
.tile-count {
  font-family: var(--font-display); font-size: 22px; font-weight: 500;
  color: var(--flx-graphite); letter-spacing: -0.02em;
  line-height: 1;
}
.tile-arrow {
  color: var(--flx-mist); margin-left: 4px;
  transition: color .15s, transform .15s;
}
.tile:hover .tile-arrow { color: var(--flx-blue); transform: translateX(2px); }

/* Urgency rail (left edge color) for high-count tiles */
.tile.is-critical::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--flx-danger);
}
.tile.is-warning::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--flx-warning);
}
.tile.is-critical .tile-count { color: var(--flx-danger); }
.tile.is-warning .tile-count { color: var(--flx-warning); }

/* ---------- Variant A grid ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Variant B hero ---------- */
.hero {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  border: 1px solid var(--border-1);
  border-radius: 18px;
  padding: 20px 22px 22px;
  margin-bottom: 20px;
}
.hero-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.hero-head .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--flx-danger);
  box-shadow: 0 0 0 4px rgba(200,65,58,0.15);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(200,65,58,0.15); }
  50%     { box-shadow: 0 0 0 7px rgba(200,65,58,0.04); }
}
.hero-head .ttl {
  font-family: var(--font-display); font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--flx-graphite);
}
.hero-head .sub {
  margin-left: auto; font-size: 12px; color: var(--flx-steel);
}
.hero-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
@media (max-width: 640px) { .hero-grid { grid-template-columns: 1fr; gap: 10px; } }

.attn {
  display: flex; align-items: stretch; gap: 14px;
  padding: 14px 16px; border-radius: 12px;
  background: #fff; border: 1px solid var(--border-1);
  text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.attn:hover { border-color: var(--flx-blue-100); }
.attn:active { transform: translateY(1px); }
.attn.crit { border-color: rgba(200,65,58,0.25); background: #FFFAF9; }
.attn.warn { border-color: rgba(232,155,42,0.25); background: #FFFDF7; }

.attn-num {
  font-family: var(--font-display); font-size: 38px; font-weight: 500;
  letter-spacing: -0.03em; line-height: 1;
  color: var(--flx-graphite);
}
.attn.crit .attn-num { color: var(--flx-danger); }
.attn.warn .attn-num { color: #C97A18; }

.attn-body { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.attn-lbl { font-family: var(--font-display); font-size: 13px; font-weight: 500; color: var(--flx-graphite); letter-spacing: -0.005em; }
.attn-meta { font-size: 11px; color: var(--flx-steel); margin-top: 3px; }
.attn-meta .delta-up { color: var(--flx-danger); }
.attn-meta .delta-flat { color: var(--flx-steel); }
.attn-arrow { margin-left: auto; align-self: center; color: var(--flx-mist); }
.attn:hover .attn-arrow { color: var(--flx-blue); }

/* KPI strip (Variant B) */
.kpi-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 640px) { .kpi-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.kpi {
  background: #fff; border: 1px solid var(--border-1); border-radius: 12px;
  padding: 14px 16px;
}
.kpi .v { font-family: var(--font-display); font-size: 24px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; color: var(--flx-graphite); }
.kpi .l { font-size: 11px; color: var(--flx-steel); margin-top: 4px; letter-spacing: -0.005em; }
.kpi .spark { margin-top: 8px; height: 18px; }

/* Variant B inspection mini-cards */
.minicard {
  background: #fff; border: 1px solid var(--border-1); border-radius: 14px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
  text-decoration: none; color: inherit;
}
.minicard:hover { border-color: var(--flx-blue-100); }
.minicard .h { display: flex; align-items: center; gap: 10px; }
.minicard .h .ico { width: 32px; height: 32px; border-radius: 8px; background: var(--flx-blue-50); color: var(--flx-blue-700); display: flex; align-items: center; justify-content: center; }
.minicard .h .ico svg { width: 16px; height: 16px; }
.minicard .h .ttl { font-family: var(--font-display); font-size: 14px; font-weight: 500; }
.minicard .v { font-family: var(--font-display); font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; color: var(--flx-graphite); }
.minicard .v small { font-size: 13px; color: var(--flx-steel); font-weight: 400; }
.minicard .progress { height: 4px; border-radius: 4px; background: var(--flx-cloud); overflow: hidden; }
.minicard .progress > i { display: block; height: 100%; background: var(--flx-blue); }

/* Admin row */
.admin-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .admin-row { grid-template-columns: 1fr; } }
.admin-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: #fff; border: 1px solid var(--border-1); border-radius: 12px;
  text-decoration: none; color: inherit;
}
.admin-tile:hover { border-color: var(--flx-blue-100); background: #FCFDFE; }
.admin-tile .ico { width: 32px; height: 32px; border-radius: 8px; background: var(--flx-cloud); color: var(--flx-slate); display: flex; align-items: center; justify-content: center; }
.admin-tile .ico svg { width: 16px; height: 16px; }
.admin-tile .l { font-family: var(--font-display); font-size: 14px; font-weight: 500; }
.admin-tile .arrow { margin-left: auto; color: var(--flx-mist); }

/* ---------- Bottom area pattern ----------
   The generic 5-tab bottom bar was removed (v2). Navigation lives in
   the top-right hamburger drawer. Primary actions live INLINE on rows /
   in detail panels / next to the content that owns them. See queue.html
   for the canonical list pattern.
   ------------------------------------------- */

/* ============================================================
   /me employee dashboard styles
   ------------------------------------------------------------
   Extracted from mockups/employee-dashboard.html. Loaded after
   _dash.css so the dashboard-specific components (my-kpi-strip,
   ann-pin, day-card, att-card, ob-card, side-card.feed, etc.)
   are available on every page that uses base.html.
   ============================================================ */
  /* =========================================================
     /me — Employee personal dashboard (desktop)
     Same shell as admin dashboard, different content + tone.
     Tile data model maps 1:1 to shopfloor/modules/me/tiles/*.
     ========================================================= */

  /* --- Greeting variant ------------------------------------- */
  .greet h1 .hi { color:var(--flx-graphite); }
  .greet h1 .name { color:var(--flx-blue); }
  .greet .meta .status {
    display:inline-flex; align-items:center; gap:6px;
    margin-left:6px; padding:2px 10px 2px 8px;
    border-radius:999px; font-size:12px;
    background:var(--flx-success-50); color:#1F6B3D;
  }
  .greet .meta .status .dot {
    width:7px; height:7px; border-radius:50%;
    background:var(--flx-success); box-shadow:0 0 0 3px rgba(46,158,92,0.18);
  }

  /* --- "Teď potřebuje tvou pozornost" hero ------------------- */
  /* (reuses .hero / .hero-grid / .attn from _dash.css)
     The card pairs differ — they're personal, not aggregate. */

  /* --- Top "Today" row ------------------------------------- */
  /* Můj den (úkoly) + Docházka live at the SAME hierarchy level.
     Both are "today" surfaces — what I'm doing + when I'm working. */
  .today-row {
    display:grid; grid-template-columns: 1.45fr 1fr;
    gap:22px; align-items:start;
  }
  .bottom-row {
    display:grid; grid-template-columns: 1fr 1fr;
    gap:22px; align-items:start;
    margin-top:0;
  }
  @media (max-width: 980px) {
    .today-row, .bottom-row { grid-template-columns: 1fr; }
  }

  /* --- "Můj den" composite card ----------------------------- */
  .day-card {
    background:#fff; border:1px solid var(--border-1); border-radius:14px;
    overflow:hidden;
  }
  .day-head {
    display:flex; align-items:center; gap:14px;
    padding:16px 18px; border-bottom:1px solid var(--border-1);
    background:linear-gradient(180deg, #FCFDFE 0%, #fff 100%);
  }
  .day-head .ico {
    width:38px; height:38px; border-radius:10px;
    background:var(--flx-blue-50); color:var(--flx-blue-700);
    display:flex; align-items:center; justify-content:center; flex:none;
  }
  .day-head .ico svg { width:18px; height:18px; }
  .day-head .work { flex:1; min-width:0; }
  .day-head .work .t { font-family:var(--font-display); font-size:14px; font-weight:500; color:var(--flx-graphite); letter-spacing:-0.005em; }
  .day-head .work .m { font-size:12px; color:var(--flx-steel); margin-top:1px; }
  .day-head .clock {
    text-align:right; flex:none;
  }
  .day-head .clock .v {
    font-family:var(--font-display); font-size:18px; font-weight:500;
    letter-spacing:-0.01em; color:var(--flx-graphite); font-variant-numeric:tabular-nums;
  }
  .day-head .clock .l { font-size:11px; color:var(--flx-steel); margin-top:1px; }

  .day-list { list-style:none; margin:0; padding:0; }
  .day-list li {
    display:grid; grid-template-columns: 22px 1fr 88px 32px;
    align-items:center; gap:14px;
    padding:12px 18px; border-top:1px solid var(--border-1);
  }
  .day-list li:first-child { border-top:0; }
  .day-list .mark {
    width:22px; height:22px; border-radius:50%;
    border:1.5px solid var(--border-2); background:#fff;
    display:flex; align-items:center; justify-content:center;
  }
  .day-list .mark svg { width:12px; height:12px; opacity:0; color:#fff; }
  .day-list li.done .mark { background:var(--flx-success); border-color:var(--flx-success); }
  .day-list li.done .mark svg { opacity:1; }
  .day-list li.done .ttl { color:var(--flx-steel); text-decoration:line-through; text-decoration-color:var(--flx-mist); }
  .day-list li.overdue .mark { border-color:var(--flx-danger); }
  .day-list li.overdue .mark::after {
    content:""; width:7px; height:7px; border-radius:50%; background:var(--flx-danger);
  }
  .day-list li.overdue .mark svg { display:none; }
  .day-list .body { min-width:0; }
  .day-list .ttl {
    font-family:var(--font-body); font-size:14px;
    color:var(--flx-graphite); letter-spacing:-0.005em;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  .day-list .meta { font-size:11px; color:var(--flx-steel); margin-top:2px; }
  .day-list .when {
    text-align:right; font-family:var(--font-display); font-weight:500;
    font-size:13px; color:var(--flx-graphite); letter-spacing:-0.005em;
    font-variant-numeric:tabular-nums;
  }
  .day-list li.overdue .when { color:var(--flx-danger); }
  .day-list .prio { width:8px; height:8px; border-radius:50%; background:transparent; justify-self:center; }
  .day-list li.pri .prio { background:var(--flx-warning); }
  .day-foot {
    display:flex; align-items:center; justify-content:space-between; gap:14px;
    padding:12px 18px; border-top:1px solid var(--border-1);
    font-size:12px; color:var(--flx-steel);
  }
  .day-foot a { color:var(--flx-blue-700); text-decoration:none; font-family:var(--font-display); font-weight:500; }

  /* --- Agendy grid ------------------------------------------ */
  .agenda-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:12px; }
  @media (max-width: 700px) { .agenda-grid { grid-template-columns: repeat(2, 1fr); } }
  .agtile {
    background:#fff; border:1px solid var(--border-1); border-radius:12px;
    padding:14px 16px; text-decoration:none; color:inherit;
    display:flex; flex-direction:column; gap:6px;
    position:relative; transition: border-color .15s, transform .15s;
  }
  .agtile:hover { border-color:var(--flx-blue-100); }
  .agtile .h {
    display:flex; align-items:center; gap:10px;
  }
  .agtile .ico {
    width:30px; height:30px; border-radius:8px;
    background:var(--flx-blue-50); color:var(--flx-blue-700);
    display:flex; align-items:center; justify-content:center; flex:none;
  }
  .agtile .ico svg { width:15px; height:15px; }
  .agtile .ttl {
    font-family:var(--font-display); font-size:13px; font-weight:500;
    color:var(--flx-graphite); letter-spacing:-0.005em;
  }
  .agtile .v {
    font-family:var(--font-display); font-size:24px; font-weight:500;
    letter-spacing:-0.02em; line-height:1.05; color:var(--flx-graphite);
    font-variant-numeric:tabular-nums;
  }
  .agtile .v small { font-size:13px; color:var(--flx-steel); font-weight:400; }
  .agtile .m { font-size:11px; color:var(--flx-steel); line-height:1.4; }

  .agtile.attn::after {
    content:""; position:absolute; right:14px; top:14px;
    width:7px; height:7px; border-radius:50%; background:var(--flx-warning);
  }
  .agtile.attn .v { color:#C97A18; }
  .agtile.crit::after {
    content:""; position:absolute; right:14px; top:14px;
    width:7px; height:7px; border-radius:50%; background:var(--flx-danger);
  }
  .agtile.crit .v { color:var(--flx-danger); }

  /* --- Right column cards ----------------------------------- */
  .side-card {
    background:#fff; border:1px solid var(--border-1); border-radius:14px;
    padding:16px 18px;
  }

  /* Docházka (attendance) card — sized to match the day card */
  .att-card { display:flex; flex-direction:column; }
  .att-head {
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    margin-bottom:14px;
  }
  .att-head .h { font-family:var(--font-display); font-size:11px; font-weight:500; letter-spacing:0.12em; text-transform:uppercase; color:var(--flx-steel); }
  .att-head .more { font-family:var(--font-display); font-size:12px; color:var(--flx-blue-700); text-decoration:none; }
  .att-stats { display:grid; grid-template-columns: 1fr 1fr; gap:12px; margin-bottom:12px; }
  .att-stat .v { font-family:var(--font-display); font-size:22px; font-weight:500; letter-spacing:-0.02em; color:var(--flx-graphite); line-height:1; font-variant-numeric:tabular-nums; }
  .att-stat .v small { font-size:13px; color:var(--flx-steel); font-weight:400; }
  .att-stat .l { font-size:11px; color:var(--flx-steel); margin-top:4px; letter-spacing:-0.005em; }
  .att-norm { padding-top:12px; border-top:1px solid var(--border-1); }
  .att-norm .row { display:flex; align-items:center; justify-content:space-between; font-size:12px; margin-bottom:6px; }
  .att-norm .row .k { color:var(--flx-steel); }
  .att-norm .row .v { font-family:var(--font-display); font-weight:500; color:var(--flx-graphite); font-variant-numeric:tabular-nums; }
  .att-norm .bar { height:6px; border-radius:4px; background:var(--flx-cloud); overflow:hidden; }
  .att-norm .bar > i { display:block; height:100%; background:linear-gradient(90deg, var(--flx-blue) 0%, var(--flx-blue-700) 100%); }
  .att-actions { display:flex; gap:8px; margin-top:14px; }
  .att-actions button, .att-actions a {
    flex:1; height:40px; border:0; border-radius:10px;
    background:var(--flx-blue); color:#fff;
    font-family:var(--font-display); font-size:13px; font-weight:500; letter-spacing:-0.005em;
    cursor:pointer; display:flex; align-items:center; justify-content:center; gap:7px;
    text-decoration:none;
  }
  .att-actions .alt { background:#fff; color:var(--flx-graphite); border:1px solid var(--border-2); }
  .att-actions svg { width:14px; height:14px; }

  /* Onboarding card */
  .ob-card {
    background:linear-gradient(180deg, #F0F7FB 0%, #FFFFFF 70%);
    border:1px solid var(--flx-blue-100); border-radius:14px;
    padding:16px 18px; position:relative;
  }
  .ob-card .h { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
  .ob-card .h .ttl { font-family:var(--font-display); font-size:11px; font-weight:500; letter-spacing:0.12em; text-transform:uppercase; color:var(--flx-blue-800); }
  .ob-card .h .day { margin-left:auto; font-family:var(--font-mono); font-size:11px; color:var(--flx-blue-700); background:#fff; padding:2px 8px; border-radius:6px; border:1px solid var(--flx-blue-100); }
  .ob-card .lead {
    font-family:var(--font-display); font-size:18px; font-weight:500;
    letter-spacing:-0.015em; color:var(--flx-graphite); line-height:1.25;
    margin-bottom:6px;
  }
  .ob-card .lead b { color:var(--flx-blue); font-weight:600; font-variant-numeric:tabular-nums; }
  .ob-card .sub { font-size:13px; color:var(--flx-slate); margin-bottom:14px; }
  .ob-card .bar { height:8px; border-radius:6px; background:#D7EBF7; overflow:hidden; margin-bottom:12px; }
  .ob-card .bar > i { display:block; height:100%; background:var(--flx-blue); }
  .ob-steps { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
  .ob-steps li {
    display:flex; align-items:center; gap:10px;
    font-size:13px; color:var(--flx-slate);
  }
  .ob-steps .ch {
    width:18px; height:18px; border-radius:50%;
    border:1.5px solid var(--border-2); flex:none;
    display:flex; align-items:center; justify-content:center;
    background:#fff;
  }
  .ob-steps .ch svg { width:10px; height:10px; color:#fff; opacity:0; }
  .ob-steps li.done .ch { background:var(--flx-success); border-color:var(--flx-success); }
  .ob-steps li.done .ch svg { opacity:1; }
  .ob-steps li.now .ch { border-color:var(--flx-blue); background:var(--flx-blue); }
  .ob-steps li.now .ch::after { content:""; width:6px; height:6px; border-radius:50%; background:#fff; }
  .ob-steps li.now { color:var(--flx-graphite); font-family:var(--font-display); font-weight:500; }
  .ob-steps li.done { color:var(--flx-steel); }
  .ob-card .cta { display:inline-flex; align-items:center; gap:6px; margin-top:14px; padding:10px 14px; border-radius:10px; background:var(--flx-blue); color:#fff; font-family:var(--font-display); font-size:13px; font-weight:500; text-decoration:none; }
  .ob-card .cta svg { width:14px; height:14px; }

  /* Announcements + activity (slim) */
  .feed { list-style:none; margin:0; padding:0; }
  .feed li {
    display:flex; gap:10px; padding:10px 0; border-top:1px solid var(--border-1);
    font-size:13px; color:var(--flx-slate);
  }
  .feed li:first-child { border-top:0; }
  .feed .when { color:var(--flx-steel); font-family:var(--font-mono); font-size:11px; flex:none; width:46px; }
  .feed .who  { font-weight:500; color:var(--flx-graphite); }
  .feed .what { flex:1; min-width:0; }
  .feed .b { align-self:center; flex:none; font-size:10px; padding:2px 7px; border-radius:999px; letter-spacing:.02em; }
  .feed .b.crit { background:#FAE7E5; color:var(--flx-danger); }
  .feed .b.ok   { background:#E6F5EC; color:#1F6B3D; }
  .feed .b.info { background:var(--flx-blue-50); color:var(--flx-blue-800); }

  /* --- Moje KPI strip ---------------------------------------- */
  .my-kpi-strip {
    display:grid; grid-template-columns: repeat(4, 1fr); gap:14px;
    margin: 0 0 22px;
  }
  @media (max-width: 700px) { .my-kpi-strip { grid-template-columns: 1fr 1fr; gap:10px; } }
  .my-kpi {
    background:#fff; border:1px solid var(--border-1); border-radius:12px;
    padding:14px 16px; position:relative;
    display:flex; flex-direction:column; gap:6px;
    text-decoration:none; color:inherit;
  }
  .my-kpi .top { display:flex; align-items:center; gap:8px; }
  .my-kpi .top .l {
    font-family:var(--font-display); font-size:11px; font-weight:500;
    letter-spacing:0.04em; color:var(--flx-steel);
  }
  .my-kpi .top .trend {
    margin-left:auto; font-family:var(--font-mono); font-size:11px;
    color:var(--flx-success);
  }
  .my-kpi .top .trend.down { color:var(--flx-danger); }
  .my-kpi .top .trend.flat { color:var(--flx-steel); }
  .my-kpi .v {
    font-family:var(--font-display); font-size:26px; font-weight:500;
    letter-spacing:-0.02em; line-height:1; color:var(--flx-graphite);
    font-variant-numeric:tabular-nums;
  }
  .my-kpi .v small {
    font-size:13px; color:var(--flx-steel); font-weight:400;
    margin-left:2px;
  }
  .my-kpi .v .target {
    font-family:var(--font-mono); font-size:12px; color:var(--flx-steel);
    font-weight:400; margin-left:6px;
  }
  .my-kpi .m {
    font-size:11px; color:var(--flx-steel); margin-top:2px;
  }
  .my-kpi .bar {
    height:5px; border-radius:4px; background:var(--flx-cloud);
    overflow:hidden; margin-top:6px;
  }
  .my-kpi .bar > i {
    display:block; height:100%;
    background: linear-gradient(90deg, var(--flx-blue), var(--flx-blue-700));
  }
  .my-kpi .bar > i.warn { background: linear-gradient(90deg, #F0B240, #C97A18); }
  .my-kpi .bar > i.ok   { background: linear-gradient(90deg, #4AB874, var(--flx-success)); }
  .my-kpi .spark { margin-top:4px; height:22px; width:100%; display:block; }

  /* Weekly hours strip — visualises Po–Ne so Docházka has the same
     visual weight as the task list on the left. */
  .week-strip {
    display:grid; grid-template-columns: repeat(7, 1fr); gap:6px;
    padding:14px 0 0;
    margin-top:14px;
    border-top:1px solid var(--border-1);
  }
  .week-strip .d {
    display:flex; flex-direction:column; align-items:center; gap:6px;
    text-decoration:none; color:inherit;
  }
  .week-strip .d .lbl {
    font-family:var(--font-display); font-size:10px; font-weight:500;
    letter-spacing:0.04em; color:var(--flx-steel); text-transform:uppercase;
  }
  .week-strip .d .col {
    width:100%; height:60px; border-radius:6px;
    background:var(--flx-cloud);
    position:relative; overflow:hidden;
    display:flex; align-items:flex-end;
  }
  .week-strip .d .col > i {
    display:block; width:100%; background:var(--flx-blue);
  }
  .week-strip .d .h {
    font-family:var(--font-mono); font-size:10px; color:var(--flx-steel);
    font-variant-numeric:tabular-nums;
  }
  .week-strip .d.today .col > i { background:var(--flx-blue-700); }
  .week-strip .d.today .lbl { color:var(--flx-blue-700); }
  .week-strip .d.today .h { color:var(--flx-graphite); font-family:var(--font-display); font-weight:500; }
  .week-strip .d.off .col > i { background:var(--flx-mist); }
  .week-strip .d.off .h { color:var(--flx-mist); }

  /* Pinned announcement banner */
  .ann-pin {
    display:flex; align-items:flex-start; gap:12px;
    background:#FFFBEC; border:1px solid #F2D58F; border-radius:12px;
    padding:12px 14px; margin-bottom:16px;
  }
  .ann-pin .ico {
    width:30px; height:30px; border-radius:8px; background:#F8E2A0; color:#7A5210;
    display:flex; align-items:center; justify-content:center; flex:none;
  }
  .ann-pin .ico svg { width:15px; height:15px; }
  .ann-pin .body { flex:1; min-width:0; }
  .ann-pin .t { font-family:var(--font-display); font-size:13px; font-weight:500; color:#5B3D08; }
  .ann-pin .m { font-size:12px; color:#7A5210; margin-top:2px; }
  .ann-pin .close { background:transparent; border:0; color:#7A5210; cursor:pointer; padding:4px; line-height:0; }
  .ann-pin .close svg { width:14px; height:14px; }

/* ============================================================
   Responsive data list — table on wide containers, <details>
   disclosure cards on narrow ones. Adapts to its OWN container
   width (@container), so it is correct full-page and inside the
   builder canvas. Used via templates/components/responsive_list.html.
   ============================================================ */
.flx-rlist {
  container-type: inline-size;
  border: 1px solid var(--flx-mist);
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  background: var(--flx-paper);
}
.flx-rlist__head { display: none; }                 /* narrow: no header row */
.flx-rlist__row { border-top: 1px solid var(--flx-cloud); }
.flx-rlist__row:first-of-type { border-top: 0; }
.flx-rlist__sum {
  list-style: none;
  display: flex; align-items: center; gap: 8px;
  min-height: 44px;                                 /* touch target */
  padding: 8px 12px;
  cursor: pointer;
  font-size: var(--fs-14, .875rem);
}
.flx-rlist__sum::-webkit-details-marker { display: none; }
.flx-rlist__cell { flex: 0 0 auto; }
.flx-rlist__cell:first-child { flex: 1 1 auto; font-weight: 500; color: var(--flx-graphite); min-width: 0; }
.flx-rlist__cell--sec { display: none; }            /* narrow: secondary cells live in the body */
.flx-rlist__cell--right { text-align: right; }
.flx-rlist__cell--center { text-align: center; }
.flx-rlist__chev {
  margin-left: auto; width: 18px; height: 18px; flex: 0 0 18px;
  color: var(--flx-blue); transition: transform var(--dur-base, 180ms) var(--ease-standard, ease);
}
.flx-rlist__chev svg { width: 100%; height: 100%; }
.flx-rlist__row[open] .flx-rlist__chev { transform: rotate(90deg); }
.flx-rlist__body {
  padding: 2px 12px 12px; background: var(--flx-fog);
  font-size: var(--fs-13, .8125rem); color: var(--flx-steel);
}
.flx-rlist__kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px dashed var(--flx-mist); }
.flx-rlist__k { color: var(--flx-steel); }
.flx-rlist__v { color: var(--flx-slate); text-align: right; }
.flx-rlist__act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.flx-rlist__empty { padding: 40px 12px; text-align: center; color: var(--flx-silver); }

/* Wide container: behave like a table — all cells inline, no disclosure */
@container (min-width: 640px) {
  .flx-rlist__head {
    display: flex; gap: 8px; padding: 8px 12px; background: var(--flx-cloud);
    font-size: var(--fs-12, .75rem); text-transform: uppercase;
    letter-spacing: .04em; color: var(--flx-steel);
  }
  .flx-rlist__hc { flex: 0 0 auto; }
  .flx-rlist__hc:first-child { flex: 1 1 auto; }
  .flx-rlist__hc--right { text-align: right; }
  .flx-rlist__cell--sec { display: block; }         /* show every column inline */
  .flx-rlist__chev, .flx-rlist__body { display: none; }
  .flx-rlist__sum { cursor: default; }
}

/* ============================================================
   Touch tokens — 44px minimum targets + coarse-pointer spacing.
   .flx-tap: makes any control meet 44px without changing its
   visual size (centred content, expanded hit area).
   ============================================================ */
.flx-tap {
  min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.flx-tap--inline { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }

@media (pointer: coarse) {
  /* Roomier rows + bigger icon-button hit areas on touch devices */
  .flx-rlist__sum { padding-top: 11px; padding-bottom: 11px; }
  .flx-icon-btn { min-height: 44px; min-width: 44px; }
}

/* ============================================================
   Builder shell — palette · canvas · detail responsive layout.
   ≥1280px: today's 3-pane flex row (Tailwind classes untouched).
   768–1279px: the detail column wraps BELOW the canvas full-width
     (the bom search panel / ops preset picker stay reachable); the
     selected-item drawer content is mounted into the bottom sheet
     by _drawerTarget()/_bomDrawerTarget() instead, so the in-place
     slots are forced hidden here.
   <768px: the palette becomes a fixed off-canvas drawer summoned
     by the .flx-builder__palette-tab; scrim click dismisses.
   Used by builder/operations.html + builder/bom.html.
   ============================================================ */
.flx-builder__palette-tab,
.flx-builder__scrim { display: none; }

@media (max-width: 1279px) {
  .flx-builder { flex-wrap: wrap; }
  .flx-builder__detail { width: 100%; position: static; }
  /* Drawer content lives in the bottom sheet at this width — hide the
     in-place slots even when Alpine x-show removes inline display. */
  .flx-builder__detail #drawer-slot,
  .flx-builder__detail #bom-drawer-slot { display: none !important; }
}

@media (max-width: 767px) {
  .flx-builder__palette {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 240px; z-index: 70;
    border-radius: 0 12px 12px 0;
    transform: translateX(-105%);
    transition: transform 280ms cubic-bezier(.2, 0, .2, 1);
    overflow-y: auto;
    box-shadow: 0 18px 48px rgba(15,23,34,.10), 0 4px 12px rgba(15,23,34,.05);
  }
  .flx-builder.palette-open .flx-builder__palette { transform: none; }
  .flx-builder__scrim {
    position: fixed; inset: 0; z-index: 65;
    background: rgba(15, 23, 34, .4);
  }
  .flx-builder.palette-open .flx-builder__scrim { display: block; }
  .flx-builder__palette-tab {
    display: flex; position: fixed; left: 0; top: 38%; z-index: 60;
    writing-mode: vertical-rl; align-items: center; gap: 6px;
    background: var(--flx-blue); color: #fff; border: 0;
    padding: 12px 7px; border-radius: 0 8px 8px 0;
    font-size: 12px; font-weight: 500; min-height: 44px;
    box-shadow: 0 4px 14px rgba(15,23,34,.06), 0 1px 3px rgba(15,23,34,.03);
  }
  .flx-builder__palette-tab svg { transform: rotate(90deg); }

  /* Canvas content must shrink to the phone/portrait pane: the op/BOM
     card rows are dense flex lines of inline controls that never wrapped
     (built desktop-first) — without this the page scrolls sideways ~450px.
     min-width:0 lets flex children shrink below their content size so
     long names truncate instead of propagating min-content width. */
  .flx-builder__canvas .flex { flex-wrap: wrap; }
  .flx-builder__canvas .flex > * { min-width: 0; }
  /* The canvas is a flex item (flex-1): min-width:auto blocks it from
     shrinking to the pane even when its children fit — classic flexbox. */
  .flx-builder__canvas { min-width: 0; }
}

@media (pointer: coarse) {
  /* Drag handles big enough for fingers (visual size unchanged —
     the padding expands the hit area). */
  .op-drag-handle, .ukon-drag-handle, .drag-handle {
    min-width: 32px; min-height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
  }
}

/* Narrow screens: header/banner rows built as `flex items-center
   justify-between` lines (page titles + action buttons, status banners)
   wrap instead of forcing horizontal page scroll. flex-wrap only engages
   when the content genuinely doesn't fit, so wide screens are untouched.
   Surfaced by the builder page header + library banner overflowing @360. */
@media (max-width: 767px) {
  main .flex.items-center.justify-between { flex-wrap: wrap; row-gap: 8px; }
  main .flex.items-center.justify-between > * { min-width: 0; }
  /* …and the button clusters inside them — one long flex group of
     actions (Náhled/Export/…) is itself unwrappable otherwise. */
  main .flex.items-center.justify-between > .flex { flex-wrap: wrap; row-gap: 8px; }
}

/* ============================================================
   Wiki article prose (modules/wiki) — design-system tokens only.
   Rendered markdown bodies get `.wiki-prose`; wikilinks are
   `.wiki-link`, unresolved targets add `.wiki-broken` (red link →
   create-page affordance). Search snippets highlight with <mark>.
   ============================================================ */
.wiki-prose { color: var(--flx-ink); font-weight: 400; line-height: 1.65; }
.wiki-prose h1, .wiki-prose h2, .wiki-prose h3,
.wiki-prose h4, .wiki-prose h5, .wiki-prose h6 {
  color: var(--flx-graphite); font-weight: 500; line-height: 1.3;
  margin: 1.5em 0 0.5em;
}
.wiki-prose h1 { font-size: 30px; }
.wiki-prose h2 { font-size: 24px; border-bottom: 1px solid var(--flx-mist); padding-bottom: 6px; }
.wiki-prose h3 { font-size: 20px; }
.wiki-prose h4 { font-size: 18px; }
.wiki-prose > :first-child { margin-top: 0; }
.wiki-prose p { margin: 0.75em 0; }
.wiki-prose a { color: var(--flx-blue); text-decoration: none; }
.wiki-prose a:hover { color: var(--flx-blue-600, #0085C0); text-decoration: underline; }
.wiki-prose a.wiki-broken {
  color: var(--flx-danger);
  text-decoration: underline dashed;
  text-underline-offset: 3px;
}
.wiki-prose ul, .wiki-prose ol { margin: 0.75em 0; padding-left: 1.5em; }
.wiki-prose li { margin: 0.25em 0; }
.wiki-prose blockquote {
  margin: 1em 0; padding: 8px 16px;
  border-left: 3px solid var(--flx-mist);
  color: var(--flx-slate); background: var(--flx-fog, #F6F8FA);
  border-radius: 0 8px 8px 0;
}
.wiki-prose code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.875em; background: var(--flx-cloud);
  padding: 1px 5px; border-radius: 6px;
}
.wiki-prose pre {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px; line-height: 1.55;
  background: var(--flx-cloud); border: 1px solid var(--flx-mist);
  border-radius: 12px; padding: 12px 16px;
  overflow-x: auto; margin: 1em 0;
}
.wiki-prose pre code { background: transparent; padding: 0; border-radius: 0; }
.wiki-prose table { border-collapse: collapse; margin: 1em 0; width: 100%; font-size: 14px; }
.wiki-prose th {
  text-align: left; font-weight: 500; color: var(--flx-graphite);
  background: var(--flx-fog, #F6F8FA);
}
.wiki-prose th, .wiki-prose td {
  border: 1px solid var(--flx-mist); padding: 6px 10px; vertical-align: top;
}
.wiki-prose hr { border: 0; border-top: 1px solid var(--flx-mist); margin: 1.5em 0; }
.wiki-prose img { max-width: 100%; border-radius: 12px; }
.wiki-prose mark,
.wiki-search-snippet mark {
  background: var(--flx-warning-50, #FBF1DF); color: inherit;
  padding: 0 2px; border-radius: 4px;
}
/* Unified diff view (revision.html) */
.wiki-diff {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px; line-height: 1.5;
}
.wiki-diff .diff-add { background: #ECFDF5; color: #047857; }
.wiki-diff .diff-del { background: #FEF2F2; color: #B91C1C; }
.wiki-diff .diff-meta { color: var(--flx-steel); }
