/* =========================================================
   ST Bílovice – web2.css (2026-11)
   Jednotné komponenty, ikony, mobilní hlavička a spodní menu.
   Nahrazuje opravy_mobil.css.
   ========================================================= */

/* ---------- Ikony ---------- */
.ico { width: 1.05em; height: 1.05em; display: inline-block; vertical-align: -0.16em; flex-shrink: 0; stroke-width: 2; }
.ico-ok   { color: var(--green); }
.ico-bad  { color: var(--red); }
.ico-warn { color: #d97706; }
.ico-star { color: #e8a000; fill: #e8a000; }
.feat-icon .ico { width: 1em; height: 1em; color: var(--blue); }
.page-hero h1 .ico { vertical-align: -0.12em; opacity: .9; }
.widget-title .ico { color: var(--blue-light); }
.btn .ico { width: 1.1em; height: 1.1em; }
.card-img .ico { width: 56px; height: 56px; color: var(--blue-light); opacity: .5; }

/* ---------- Horní lišta + navigace ---------- */
.topbar { position: sticky; top: 0; z-index: 210; padding-top: env(safe-area-inset-top); }
.topbar-inner { min-height: 42px; }
.topbar-bell { position: relative; background: rgba(255,255,255,.15); border-radius: 8px; padding: 5px 10px; color: #fff !important; }
.topbar-bell .ico { width: 17px; height: 17px; }
.bell-count { background: var(--red); color: #fff; border-radius: 20px; font-size: 10.5px; font-weight: 800; padding: 1px 6px; line-height: 1.4; }
.navbar { position: sticky; top: calc(42px + env(safe-area-inset-top)); z-index: 200; }
.nav-mobile-actions { display: none; align-items: center; gap: 6px; }
.nav-m-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; color: var(--blue); }
.nav-m-btn .ico { width: 22px; height: 22px; }
.nav-m-btn .bell-count { position: absolute; top: 3px; right: 1px; }
.nav-m-only { display: none !important; }
.dropdown-menu a { display: flex; align-items: center; gap: 8px; }
.dropdown-menu a .ico { color: var(--blue-light); }
.dd-caret { font-size: .8em; opacity: .7; }

/* ---------- Spodní menu (mobil) ---------- */
.bnav { display: none; }

@media (max-width: 768px) {
  .topbar { display: none; }
  .navbar { top: 0; padding-top: env(safe-area-inset-top); }
  .navbar-inner { height: 58px; }
  .navbar-logo img { height: 34px; }
  .navbar-logo span { font-size: 16px; }
  .nav-mobile-actions { display: flex; }
  .nav-menu { top: calc(58px + env(safe-area-inset-top)); max-height: calc(100vh - 58px - 64px - env(safe-area-inset-top)); }
  .nav-menu > li > a { padding: 12px 14px; font-size: 15px; }
  .nav-m-only { display: block !important; }
  .nav-m-only a { display: flex !important; align-items: center; gap: 10px; }
  .nav-m-contact { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
  .nav-m-contact a { color: var(--muted) !important; font-size: 14px !important; }

  body.has-bnav { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .bnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
    background: rgba(255,255,255,.97); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
    color: #64748b; font-size: 10.5px; font-weight: 600; text-decoration: none; border-radius: 10px;
  }
  .bnav a .ico { width: 22px; height: 22px; }
  .bnav a.on { color: var(--blue); }
  .bnav a.on .ico { stroke-width: 2.4; }
  .bnav-ic { position: relative; display: inline-flex; }
  .bnav-ic .bell-count { position: absolute; top: -5px; right: -12px; }
}

/* ---------- Obecné tabulky na mobilu (dříve opravy_mobil.css) ---------- */
@media (max-width: 900px) {
  .widget > table, .widget table:not(.att-table):not(.att-book) {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%;
  }
}
.rozpocet-tabulka, .budget-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.rozpocet-tabulka table, .budget-table table { min-width: 500px; }
@media (max-width: 768px) {
  .dochazka-main-grid.cols-2 { grid-template-columns: 1fr !important; }
}

/* ---------- Společné komponenty ---------- */
.av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--blue); color: #fff;
      display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.av-sm { width: 26px; height: 26px; font-size: 11px; }
.av-lg { width: 56px; height: 56px; font-size: 22px; }
.seg { display: inline-flex; background: var(--blue-pale); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; text-decoration: none; }
.seg a.on, .seg button.on { background: #fff; box-shadow: var(--shadow-sm); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 20px; font-size: 13px; font-weight: 600;
        background: #fff; border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat-tile { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat-tile b { display: block; font-size: 1.6rem; font-weight: 800; color: var(--blue); line-height: 1.1; }
.stat-tile span { font-size: 12px; color: var(--muted); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.pill-ok { background: #e6f6ec; color: #217a45; }
.pill-bad { background: #fdecec; color: #b42323; }
.pill-exc { background: #fff4d6; color: #92600a; }
.pill-late { background: #e9effd; color: #2952b3; }
.pill-none { background: #eef0f4; color: #64748b; }

/* ---------- Docházka ---------- */
.att-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.att-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.att-head h2 { font-size: 1.15rem; font-weight: 800; color: var(--blue); margin: 0; }
.att-counter { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.att-ev-pick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.att-ev-pick a { flex-shrink: 0; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--text); text-decoration: none; line-height: 1.3; }
.att-ev-pick a.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.att-ev-pick a small { display: block; font-weight: 500; opacity: .75; }
.att-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.att-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); min-height: 58px; }
.att-row:last-child { border-bottom: 0; }
.att-row .att-name { flex: 1; min-width: 0; }
.att-row .att-name b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-row .att-name small { color: var(--muted); font-size: 12px; }
.att-btns { display: flex; gap: 4px; flex-shrink: 0; }
.att-btn { width: 44px; height: 40px; border-radius: 10px; border: 1.5px solid var(--border); background: #fff; cursor: pointer;
           display: inline-flex; align-items: center; justify-content: center; color: #94a3b8; transition: background .12s, border-color .12s, color .12s; }
.att-btn .ico { width: 20px; height: 20px; }
.att-btn[data-s="present"].on { background: #e6f6ec; border-color: #48bb78; color: #217a45; }
.att-btn[data-s="excused"].on { background: #fff4d6; border-color: #e8a000; color: #92600a; }
.att-btn[data-s="absent"].on  { background: #fdecec; border-color: #e53e3e; color: #b42323; }
.att-row.saving { opacity: .6; }
.att-row.st-present { background: #f6fcf8; }
.att-row.st-excused { background: #fffbf0; }
.att-row.st-absent  { background: #fff7f7; }
.att-rsvp { font-size: 11.5px; font-weight: 700; }
.att-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.att-add { display: flex; gap: 8px; margin-top: 12px; }
.att-add select { flex: 1; }
.att-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.att-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.att-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.att-table td.num, .att-table th.num { text-align: right; white-space: nowrap; }
.att-bar { height: 8px; border-radius: 6px; background: #eef0f4; overflow: hidden; min-width: 60px; }
.att-bar i { display: block; height: 100%; background: var(--green); border-radius: 6px; }
.att-book-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; }
.att-book { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.att-book th, .att-book td { border-bottom: 1px solid var(--border); padding: 6px 6px; text-align: center; white-space: nowrap; }
.att-book th:first-child, .att-book td:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; padding-left: 10px; min-width: 130px; }
.att-book th { font-size: 11px; color: var(--muted); font-weight: 700; background: #fafbff; }
.att-book .m { display: inline-flex; width: 22px; height: 22px; border-radius: 6px; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.att-book .m-p { background: #e6f6ec; color: #217a45; }
.att-book .m-e { background: #fff4d6; color: #92600a; }
.att-book .m-a { background: #fdecec; color: #b42323; }
.att-book .m-n { color: #cbd5e1; }
.att-warn { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 10px; background: #fff7ed; border: 1px solid #fed7aa; font-size: 13px; margin-bottom: 6px; }
.next-tr { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: #fff; margin-bottom: 10px; }
.next-tr .dt { background: var(--blue); color: #fff; border-radius: 10px; padding: 6px 10px; text-align: center; min-width: 52px; }
.next-tr .dt small { display: block; font-size: 10px; opacity: .85; text-transform: uppercase; font-weight: 700; }
.next-tr .dt b { font-size: 19px; line-height: 1; }
.next-tr .info { flex: 1; min-width: 150px; }
.next-tr .info b { display: block; }
.next-tr .rsvp { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rsvp-btn { border: 1.5px solid var(--border); background: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; color: var(--text); }
.rsvp-btn.yes.on { background: #e6f6ec; border-color: #48bb78; color: #217a45; }
.rsvp-btn.no.on  { background: #fff4d6; border-color: #e8a000; color: #92600a; }
.rsvp-note { max-width: 200px; padding: 7px 10px; font-size: 13px; }
@media (max-width: 600px) {
  .att-row .att-name b { white-space: normal; line-height: 1.25; font-size: 14px; }
  .att-btn { width: 40px; height: 38px; }
  .att-row { gap: 8px; padding: 8px 10px; }
  .att-row .av { width: 30px; height: 30px; }
}

/* ---------- Nastavení oznámení ---------- */
.np-list { display: grid; gap: 8px; }
.np-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--bg); border-radius: 10px; cursor: pointer; }
.np-item .ico { color: var(--blue-light); width: 20px; height: 20px; }
.np-item .np-t { flex: 1; }
.np-item .np-t b { display: block; font-size: 14px; }
.np-item .np-t small { color: var(--muted); font-size: 12px; }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: #cbd5e1; border-radius: 26px; transition: background .15s; }
.switch i::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--blue-light); }
.switch input:checked + i::after { transform: translateX(18px); }

/* ---------- Partneři ---------- */
.partners-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.partner-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 26px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.partner-logo { height: 80px; display: flex; align-items: center; justify-content: center; }
.partner-logo img { max-height: 80px; max-width: 180px; object-fit: contain; }
.partner-logo .ico { width: 54px; height: 54px; color: var(--blue-light); }
.partner-card h3 { font-size: 1.05rem; font-weight: 800; color: var(--blue); margin: 0; }
.partner-card p { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0; }
.footer-partners { border-top: 1px solid rgba(255,255,255,.12); }
.footer-partners .container { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }
.footer-partners span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.55); font-weight: 700; }
.footer-partners a { color: rgba(255,255,255,.85); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.footer-partners img { height: 30px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px 6px; }

/* ---------- QR platba ---------- */
.qr-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.qr-box { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; text-align: center; }
.qr-box #qrOut { width: 260px; height: 260px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.qr-box #qrOut img, .qr-box #qrOut svg { width: 260px; height: 260px; image-rendering: pixelated; }
.qr-box .qr-ph { color: var(--muted); font-size: 14px; }
.qr-acc { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--muted); word-break: break-all; }
@media (max-width: 800px) { .qr-wrap { grid-template-columns: 1fr; } }

/* ---------- Kalendář do telefonu ---------- */
.ics-box { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 16px; background: #fff; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 20px; }
.ics-box .ico-big { width: 34px; height: 34px; color: var(--blue-light); }
.ics-box .txt { flex: 1; min-width: 200px; }
.ics-box .txt b { display: block; }
.ics-box .txt small { color: var(--muted); }
.ics-help { font-size: 13px; color: var(--muted); margin-top: 8px; display: none; width: 100%; }
.ics-help.open { display: block; }
.ics-help ol { padding-left: 18px; margin: 6px 0 0; }

@media (max-width: 768px) { body.has-bnav .ie-toast { bottom: calc(80px + env(safe-area-inset-bottom)); right: 12px; left: 12px; } }
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .att-table td, .att-table th { padding: 8px 6px; }
  .att-bar { min-width: 36px; }
}
.np-item .np-t small { display: block; line-height: 1.4; margin-top: 2px; }
.np-item .np-t b { line-height: 1.3; }

/* ---------- Rozbalovací menu (Družstva, Členská sekce) ---------- */
.nav-menu ul, .dropdown-menu { list-style: none; margin: 0; }
.dropdown-menu li { list-style: none; }
@media (min-width: 769px) and (max-width: 1240px) {
  .nav-menu > li > a { padding: 8px 8px; font-size: 14px; }
}
@media (max-width: 768px) {
  .nav-menu > li { list-style: none; }
  .nav-menu .dropdown > a { justify-content: space-between; }
  .nav-menu .dropdown.open > a { background: var(--blue-pale); color: var(--blue); }
  .nav-menu .dropdown.open .dd-caret { transform: rotate(180deg); }
  .dd-caret { transition: transform .15s; display: inline-block; }
  .dropdown-menu {
    display: none; position: static !important; box-shadow: none !important; border: 0 !important;
    background: #f6f8fe; border-radius: 12px; padding: 6px !important; margin: 4px 0 8px !important; min-width: 0 !important;
  }
  .dropdown:not(.open):hover .dropdown-menu { display: none; }
  .dropdown.open .dropdown-menu, .dropdown.open:hover .dropdown-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .dropdown-menu li a {
    display: flex !important; align-items: center; gap: 10px; padding: 11px 12px !important; border-radius: 10px;
    background: #fff; border: 1px solid var(--border); font-size: 14px !important; font-weight: 600; color: var(--text) !important;
  }
  .dropdown-menu li a .ico { width: 18px; height: 18px; color: var(--blue-light); }
  .dropdown-menu li a:active { background: var(--blue-pale); }
}
@media (max-width: 360px) { .dropdown.open .dropdown-menu { grid-template-columns: 1fr; } }
@media (min-width: 769px) and (max-width: 1060px) {
  .navbar-logo span { display: none; }
  .nav-menu > li > a { padding: 8px 6px; font-size: 13.5px; }
}
@media (min-width: 769px) { .nav-menu > li > a { white-space: nowrap; } }
@media (min-width: 769px) and (max-width: 900px) { .nav-menu > li > a { padding: 8px 5px; font-size: 13px; } .nav-menu { gap: 0; } }
