/* Alicante Camp Manager – UI
   Mobile-first, karty, veľké ovládacie prvky, svetlý aj tmavý režim. */

:root {
    --bg: #f3f5fa;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #1d4ed8;
    --primary-2: #1e40af;
    --primary-soft: #e0e9ff;
    --navy: #0f2d6b;
    --accent: #f97316;
    --accent-soft: #fff1e6;
    --success: #15803d;
    --success-soft: #dcfce7;
    --warn: #b45309;
    --warn-soft: #fef3c7;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --info-soft: #e0f2fe;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
    --shadow-lg: 0 10px 40px rgba(15, 23, 42, .16);
    --radius: 16px;
    --radius-sm: 10px;
    --tap: 48px;
    --sidebar: 268px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1120;
        --surface: #121a2e;
        --surface-2: #17213a;
        --text: #e8edf7;
        --text-2: #cbd5e1;
        --muted: #8b9ab4;
        --border: #24304a;
        --primary: #6d9bff;
        --primary-2: #8fb2ff;
        --primary-soft: #1a2a52;
        --accent-soft: #3a2413;
        --success: #4ade80;
        --success-soft: #11321f;
        --warn: #fbbf24;
        --warn-soft: #3a2c0c;
        --danger: #f87171;
        --danger-soft: #3d1414;
        --info-soft: #0f2c3d;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5;
    background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .75rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; } .mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--success); } .neg { color: var(--danger); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface);
    border-right: 1px solid var(--border); padding: 16px 12px; overflow-y: auto; z-index: 40;
    transform: translateX(-100%); transition: transform .2s ease;
}
body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
.backdrop { display: none; }
body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .45); z-index: 30; }
.main-wrap { min-width: 0; }
.content { padding: 16px; max-width: 1180px; margin: 0 auto; padding-bottom: 96px; }

@media (min-width: 1024px) {
    .sidebar { transform: none; }
    .main-wrap { margin-left: var(--sidebar); }
    .content { padding: 24px 32px 48px; }
    .only-mobile { display: none !important; }
    .bottom-nav { display: none !important; }
}

.brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 14px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand small, .guest-brand small { display: block; color: var(--muted); font-size: .75rem; }
.brand-logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--primary)); font-size: 22px; }
.brand-logo.big { width: 56px; height: 56px; font-size: 30px; border-radius: 16px; }

.project-chip {
    display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
    background: var(--primary-soft); color: var(--text); margin-bottom: 12px;
}
.project-chip:hover { text-decoration: none; filter: brightness(.98); }
.project-chip-text { flex: 1; min-width: 0; }
.project-chip-text strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.project-chip-text small { color: var(--muted); font-size: .75rem; }
.project-emoji { font-size: 24px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-nav .linklike {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
    color: var(--text-2); font-weight: 500; min-height: 44px; width: 100%; text-align: left;
}
.side-nav a:hover, .side-nav .linklike:hover { background: var(--surface-2); text-decoration: none; }
.side-nav a.active { background: var(--primary); color: #fff; }
.side-nav .ico { width: 24px; text-align: center; font-size: 18px; }
.side-nav .pill { margin-left: auto; }
.side-nav-secondary { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; }

.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
@media (min-width: 1024px) { .topbar { padding: 14px 32px; } }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.2rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-project { display: block; font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
    position: relative; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--surface); display: grid; place-items: center; font-size: 18px; cursor: pointer; color: var(--text);
}
.icon-btn:hover { text-decoration: none; background: var(--surface-2); }
.avatar {
    width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #fb923c); color: #fff; font-size: .9rem;
}
.avatar:hover { text-decoration: none; }
.badge-dot {
    position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
    background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, .06);
}
.bottom-nav a {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 62px; color: var(--muted); font-size: .7rem; font-weight: 600;
}
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav .ico { font-size: 22px; line-height: 1; filter: grayscale(.6); }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a.active .ico { filter: none; transform: scale(1.1); }
.bottom-nav .badge-dot { top: 6px; right: calc(50% - 22px); }

/* ---------- Components ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0;
}
@media (min-width: 768px) { .card { padding: 20px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-highlight { border-color: var(--accent); background: var(--accent-soft); }
.card-flat { box-shadow: none; }
.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; border-color: var(--primary); }

.grid { display: grid; gap: 16px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid-main { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1500px) { .card .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.split-sticky { position: sticky; top: 80px; }
@media (max-width: 1099px) { .split-sticky { position: static; } }
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
    box-shadow: var(--shadow); min-width: 0;
}
.stat .label { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.stat.accent { background: linear-gradient(135deg, var(--navy), var(--primary)); color: #fff; border: 0; }
.stat.accent .label, .stat.accent .sub { color: rgba(255, 255, 255, .8); }
.stat-icon { font-size: 22px; float: right; }

.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--primary) 60%, #2563eb 100%); color: #fff;
    border-radius: var(--radius); padding: 20px; margin-bottom: 16px; position: relative; overflow: hidden;
}
.hero::after { content: "☀️"; position: absolute; right: -10px; top: -18px; font-size: 110px; opacity: .14; }
.hero h2 { font-size: 1.5rem; margin: 0; }
.hero .meta { opacity: .85; font-size: .95rem; }
.hero .countdown { display: inline-block; margin-top: 10px; background: rgba(255, 255, 255, .16); padding: 6px 12px; border-radius: 999px; font-weight: 700; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px;
    border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: transform .05s ease, background .15s ease;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #ea580c; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .875rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 1.05rem; padding: 0 24px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fab {
    position: fixed; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 24; width: 58px; height: 58px; border-radius: 18px;
    background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 28px; box-shadow: var(--shadow-lg);
}
.fab:hover { text-decoration: none; }
@media (min-width: 1024px) { .fab { bottom: 32px; right: 32px; } }

.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .75rem;
    font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap;
}
.badge-blue { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-green { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-orange { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-red { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-yellow { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-gray { background: var(--surface-2); color: var(--muted); }
.pill { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 8px; font-size: .75rem; font-weight: 700; }

.progress { display: block; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--success), #22c55e); border-radius: 999px; }
.progress.warn > span { background: linear-gradient(90deg, var(--accent), #fb923c); }
.progress.danger > span { background: linear-gradient(90deg, var(--danger), #ef4444); }

.alert {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 12px;
    border: 1px solid transparent; font-weight: 500;
}
.alert > div { flex: 1; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error, .alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-warning, .alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-info { background: var(--info-soft); color: var(--text-2); }
.alert-close { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.alert a { color: inherit; text-decoration: underline; }
.offline-banner { background: var(--warn-soft); color: var(--warn); padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; font-weight: 600; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li, .list > a.item, .list-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); color: inherit;
}
.list > li:last-child, .list > a.item:last-child { border-bottom: 0; }
.list > a.item:hover { text-decoration: none; background: var(--surface-2); border-radius: 10px; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }
.list .meta { font-size: .85rem; color: var(--muted); }
.list .icon-circle { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-size: 20px; flex-shrink: 0; }
.list .amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chev::after { content: "›"; color: var(--muted); font-size: 22px; margin-left: 4px; }

.person { display: flex; align-items: center; gap: 10px; }
.person .av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: #fff; flex-shrink: 0; background: var(--primary); }
.av-child { background: #0ea5e9 !important; } .av-parent { background: #8b5cf6 !important; } .av-coach { background: #f97316 !important; } .av-organizer { background: #0f2d6b !important; } .av-other { background: #64748b !important; } .av-cook { background: #16a34a !important; }

/* ---------- Timeline (program) ---------- */
.day-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
    flex: 0 0 auto; scroll-snap-align: start; min-width: 64px; padding: 8px 10px; border-radius: 14px; text-align: center;
    background: var(--surface); border: 1px solid var(--border); color: var(--text); position: relative;
}
.day-tab:hover { text-decoration: none; border-color: var(--primary); }
.day-tab .dow { display: block; font-size: .7rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.day-tab .dnum { display: block; font-size: 1.2rem; font-weight: 800; }
.day-tab .dot { position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.day-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.day-tab.active .dow { color: rgba(255, 255, 255, .8); }
.day-tab.today:not(.active) { border-color: var(--accent); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 62px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; display: grid; grid-template-columns: 54px 1fr; gap: 20px; padding: 6px 0; }
.tl-time { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; padding-top: 12px; font-size: 1.02rem; }
.tl-time small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
.tl-dot { position: absolute; left: 56px; top: 18px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); z-index: 1; }
.tl-card {
    display: block; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--primary);
    border-radius: 14px; padding: 12px 14px; color: inherit; box-shadow: var(--shadow); min-width: 0;
}
.tl-card:hover { text-decoration: none; border-color: var(--primary); }
.tl-card .tl-title { font-weight: 700; font-size: 1.02rem; display: flex; gap: 8px; align-items: center; }
.tl-card .tl-meta { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.tl-item.past { opacity: .55; }
.tl-item.now .tl-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); }
.tl-item.now .tl-card { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.tl-item.cancelled .tl-title { text-decoration: line-through; }

.live {
    display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius); margin-bottom: 16px;
    background: linear-gradient(135deg, #f97316, #fb923c); color: #fff; box-shadow: var(--shadow);
}
.live .pin { font-size: 30px; }
.live .live-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; opacity: .9; }
.live .live-place { font-size: 1.2rem; font-weight: 800; }
.live a { color: #fff; text-decoration: underline; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #fff; margin-right: 6px; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }

/* ---------- Tiles (Viac) ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
    display: flex; flex-direction: column; gap: 6px; padding: 18px 16px; border-radius: var(--radius); background: var(--surface);
    border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow); min-height: 110px;
}
.tile:hover { text-decoration: none; border-color: var(--primary); }
.tile .t-ico { font-size: 30px; }
.tile strong { font-size: 1rem; }
.tile small { color: var(--muted); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .full { grid-column: 1 / -1; } }
.field label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--text-2); }
.field .help { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.field-error { color: var(--danger); font-size: .85rem; margin-top: 4px; font-weight: 600; }
.req::after { content: " *"; color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=time], input[type=url], input[type=tel], input[type=search], select, textarea {
    width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font: inherit; font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.is-invalid { border-color: var(--danger) !important; }
input[type=color] { width: 64px; height: 44px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 2px; }
input[type=file] { width: 100%; padding: 12px; border: 2px dashed var(--border); border-radius: 12px; background: var(--surface-2); font: inherit; }
.input-group { display: flex; gap: 8px; }
.input-group > * { flex: 1; }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money-input { font-size: 1.4rem !important; font-weight: 800; font-variant-numeric: tabular-nums; }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 8px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); flex-shrink: 0; margin: 1px 0 0; }
.check-card {
    display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface); cursor: pointer; min-height: var(--tap);
}
.check-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.check-card input { width: 20px; height: 20px; accent-color: var(--primary); }
.check-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented label {
    flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: var(--tap);
    padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 600; background: var(--surface);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--primary); }

fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; padding-top: 6px; }
@media (max-width: 639px) {
    .form-actions { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0; z-index: 5; }
    .form-actions .btn { flex: 1; }
}

.person-row {
    display: grid; gap: 10px; grid-template-columns: 1fr; padding: 14px; border: 1px solid var(--border);
    border-radius: 14px; background: var(--surface-2); position: relative;
}
@media (min-width: 768px) { .person-row { grid-template-columns: 140px 1fr 1fr 160px; align-items: end; } .person-row .wide { grid-column: span 2; } }
.person-row .remove { position: absolute; top: 6px; right: 6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 800; border-top: 2px solid var(--border); }
.table .num, .table .right { text-align: right; white-space: nowrap; }
.table tr.click { cursor: pointer; } .table tr.click:hover td { background: var(--surface-2); }
@media (max-width: 639px) {
    table.table.responsive thead { display: none; }
    table.table.responsive tr { display: block; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 6px 10px; background: var(--surface); }
    table.table.responsive td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 0; text-align: right; }
    table.table.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; }
    table.table.responsive td.main { font-weight: 700; font-size: 1rem; }
    table.table.responsive td.main::before { content: none; }
    table.table.responsive tfoot tr { background: var(--primary-soft); }
}

/* ---------- Filters / tabs ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar form { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.toolbar input[type=search], .toolbar select { width: auto; flex: 1 1 160px; min-height: 42px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: .88rem; }
.chip:hover { text-decoration: none; border-color: var(--primary); }
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--primary); border-color: var(--primary); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* ---------- Finance ---------- */
.bar-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; }
.bar-row > span { display: block; min-width: 0; }
.bar-row .bar { display: block; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.bar-row .bar span { display: block; height: 100%; border-radius: 999px; }
.split-preview { border: 1px dashed var(--primary); background: var(--primary-soft); border-radius: 14px; padding: 14px; }
.split-preview .sp-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--primary) 15%, transparent); }
.split-preview .sp-row:last-child { border: 0; }
.split-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.split-summary .badge { font-size: .85rem; padding: 4px 12px; }
.member-pick { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-height: 360px; overflow-y: auto; padding: 2px; }
.member-pick .check-card { min-height: 44px; }
.member-pick .custom-amount { width: 110px; min-height: 38px; padding: 6px 10px; margin-left: auto; text-align: right; }
.balance-big { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.settle { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; background: var(--surface); }
.settle .arrow { color: var(--muted); }
.settle .amount { margin-left: auto; font-weight: 800; }

/* ---------- Photos ---------- */
.gallery { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
@media (min-width: 768px) { .gallery { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; } }
.gallery a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); position: relative; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.gallery a:hover img { transform: scale(1.04); }
.gallery .lock { position: absolute; top: 6px; right: 6px; background: rgba(0, 0, 0, .55); color: #fff; border-radius: 8px; padding: 0 6px; font-size: .75rem; }
.album-card { padding: 0; overflow: hidden; }
.album-cover { aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft)); display: grid; place-items: center; font-size: 40px; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-card .album-body { padding: 12px 14px; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .92); z-index: 100; display: grid; place-items: center; padding: 16px; }
.lightbox img { max-height: 86vh; max-width: 100%; object-fit: contain; border-radius: 8px; }
.lightbox .lb-close, .lightbox .lb-prev, .lightbox .lb-next { position: absolute; background: rgba(255, 255, 255, .15); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 24px; cursor: pointer; }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 12px; top: 50%; } .lightbox .lb-next { right: 12px; top: 50%; }
.lightbox .lb-caption { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty .e-ico { font-size: 44px; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 6px; vertical-align: middle; border: 1px solid var(--border); }
.copy-row { display: grid; gap: 8px; grid-template-columns: 1fr; margin-top: 10px; }
@media (min-width: 768px) { .copy-row { grid-template-columns: 220px 1fr auto; align-items: center; } }
.contact-card { display: flex; gap: 12px; align-items: center; }
.contact-card .c-ico { font-size: 28px; }
.call-btn { margin-left: auto; }
.notif { display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--border); color: inherit; }
.notif:hover { text-decoration: none; background: var(--surface-2); }
.notif.unread .n-title { font-weight: 800; }
.notif.unread::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 8px; flex-shrink: 0; }
.notif .n-body { color: var(--text-2); font-size: .92rem; white-space: pre-line; }
.notif .n-time { color: var(--muted); font-size: .78rem; }
.checklist-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.checklist-item .toggle {
    width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--border); background: var(--surface); cursor: pointer;
    display: grid; place-items: center; flex-shrink: 0; font-size: 16px; color: #fff;
}
.checklist-item.done .toggle { background: var(--success); border-color: var(--success); }
.checklist-item.done .ci-title { text-decoration: line-through; color: var(--muted); }
.result { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.att-grid { display: flex; gap: 4px; flex-wrap: wrap; }
.att-grid label { padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: .82rem; font-weight: 600; background: var(--surface); }
.att-grid input { position: absolute; opacity: 0; }
.att-grid label:has(input:checked) { background: var(--primary); color: #fff; border-color: var(--primary); }
.att-grid label.att-absent:has(input:checked) { background: var(--danger); border-color: var(--danger); }
.att-grid label.att-excused:has(input:checked) { background: var(--warn); border-color: var(--warn); }
.matrix th, .matrix td { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix input { width: 20px; height: 20px; accent-color: var(--primary); }
.diff { font-size: .8rem; font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 6px 8px; border-radius: 8px; overflow-wrap: anywhere; }
.diff del { color: var(--danger); } .diff ins { color: var(--success); text-decoration: none; }
details summary { cursor: pointer; font-weight: 600; }
.print-only { display: none; }

/* ---------- Guest / public ---------- */
.guest-wrap { max-width: 440px; margin: 0 auto; padding: 32px 16px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.guest-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.guest-brand strong { font-size: 1.4rem; }
body.public { background: var(--bg); }
.public-hero { background: linear-gradient(135deg, var(--navy), var(--primary)); color: #fff; padding: 40px 16px 56px; }
.public-hero .inner, .public-main { max-width: 960px; margin: 0 auto; }
.public-hero h1 { font-size: 2rem; margin: 0 0 6px; }
.public-main { padding: 0 16px 32px; margin-top: -32px; }
.public-footer { text-align: center; padding: 24px; color: var(--muted); font-size: .9rem; }

@media print {
    .sidebar, .topbar, .bottom-nav, .fab, .no-print, .form-actions, .alert { display: none !important; }
    .main-wrap { margin: 0 !important; }
    .content { padding: 0 !important; max-width: none; }
    .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    .print-only { display: block; }
    body { background: #fff; color: #000; }
}

/* ---------- Čitateľné formuláre (vyšší kontrast) ---------- */
:root {
    --input-bg: #e8edf5;
    --input-bg-filled: #ffffff;
    --input-border: #6b7a90;
    --input-border-filled: #1e293b;
    --input-text: #0b1324;
    --label: #1e293b;
    --border: #c5cfdd;
}
@media (prefers-color-scheme: dark) {
    :root {
        --input-bg: #0b1222;
        --input-bg-filled: #16213a;
        --input-border: #4b5b78;
        --input-border-filled: #9fb3d9;
        --input-text: #f1f5fb;
        --label: #e2e8f0;
        --border: #2b3854;
    }
}
.field label, .label { color: var(--label); font-weight: 700; font-size: .93rem; letter-spacing: .01em; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=time], input[type=url], input[type=tel], input[type=search], select, textarea {
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    color: var(--input-text);
    font-size: 17px;
    font-weight: 600;
}
/* vyplnené pole – biele pozadie a tmavý rámček, aby bolo vidno, čo je zadané */
input.has-value, textarea.has-value, select.has-value {
    background: var(--input-bg-filled);
    border-color: var(--input-border-filled);
}
input::placeholder, textarea::placeholder { color: #8a97ab; font-weight: 400; opacity: 1; }
/* práve upravované pole */
input:focus, select:focus, textarea:focus {
    background: var(--input-bg-filled) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent);
    outline: none;
}
.field:focus-within > label { color: var(--primary); }
input:disabled { opacity: .65; background: var(--surface-2); }
.check-card, .segmented label { border-width: 2px; border-color: var(--input-border); }
.check { font-weight: 500; }
.check input, .check-card input { accent-color: var(--primary); }
/* sprievodca rodinou – každá osoba ako výrazná karta */
.person-row {
    background: var(--surface); border: 2px solid var(--input-border); border-left: 6px solid var(--primary);
    box-shadow: var(--shadow);
}
.person-row [data-type-label] { font-size: 1.05rem; }
.member-pick .custom-amount { background: var(--input-bg-filled); }
.card { border-color: var(--border); }

/* ---------- Ankety ---------- */
.poll-option { display: block; cursor: pointer; border-width: 2px; }
.poll-option:hover { border-color: var(--primary); }
.poll-option.poll-mine { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.poll-option.poll-leader .progress > span { background: linear-gradient(90deg, var(--accent), #fb923c); }
.poll-input { width: 26px; height: 26px; accent-color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.poll-label { font-size: 1.1rem; }
.poll-gallery { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important; margin-bottom: 10px; }
.poll-gallery a:first-child { grid-column: span 2; grid-row: span 2; }
.poll-option-row { grid-template-columns: 1fr; }
@media (min-width: 768px) { .poll-option-row { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; } .poll-option-row .wide { grid-column: span 2; } }
.acc-gallery { margin-top: 10px; }
/* ---------- Zjednodušené menu ---------- */
.side-more { margin-top: 4px; }
.side-more > summary { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; cursor: pointer; list-style: none; min-height: 44px; }
.side-more > summary::-webkit-details-marker { display: none; }
.side-more > summary:hover { background: var(--surface-2); }
.side-more[open] > summary { color: var(--text); }
.side-more > a { padding-left: 24px !important; font-size: .95rem; }

/* ---------- Pokladňa ---------- */
.cash-actions { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
@media (max-width: 639px) { .cash-actions { grid-template-columns: 1fr; } }
.cash-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px 18px; border-radius: var(--radius); color: #fff; box-shadow: var(--shadow); min-height: 96px; }
@media (max-width: 639px) { .cash-btn { flex-direction: row; align-items: center; gap: 12px; min-height: 64px; } .cash-btn small { margin-left: auto; } }
.cash-btn:hover { text-decoration: none; filter: brightness(1.05); }
.cash-btn span { font-size: 28px; line-height: 1; }
.cash-btn strong { font-size: 1.08rem; }
.cash-btn small { opacity: .9; }
.cash-expense { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.cash-club { background: linear-gradient(135deg, #0f2d6b, #1d4ed8); }
.cash-parent { background: linear-gradient(135deg, #15803d, #22c55e); }
.icon-circle.cash-in { background: var(--success-soft); }

/* ---------- Fotoaparát ---------- */
.camera-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 72px; border-radius: var(--radius); border: 0;
    background: linear-gradient(135deg, #f97316, #fb923c); color: #fff; font-size: 1.2rem; font-weight: 800; cursor: pointer; box-shadow: var(--shadow); }
.camera-btn span { font-size: 32px; }
.camera-btn input { display: none; }
.upload-queue { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); margin-top: 10px; }
.upload-queue .uq { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.upload-queue .uq img { width: 100%; height: 100%; object-fit: cover; }
.upload-queue .uq .st { position: absolute; inset: auto 0 0 0; font-size: .7rem; text-align: center; background: rgba(0, 0, 0, .55); color: #fff; padding: 2px; }
.upload-queue .uq.done .st { background: rgba(21, 128, 61, .85); }
.upload-queue .uq.err .st { background: rgba(185, 28, 28, .85); }
.import-img { position: relative; display: block; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; cursor: pointer; }
.import-img img { width: 100%; height: 100%; object-fit: cover; }
.import-img input { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; accent-color: var(--primary); }
.import-img:has(input:not(:checked)) img { opacity: .35; filter: grayscale(1); }

.poll-price { margin: 4px 0; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; font-size: .92rem; }

/* ---------- Navigácia (mapy) ---------- */
.tl-item { position: relative; }
.tl-item .tl-card { padding-right: 64px; }
.tl-nav { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 14px;
    display: grid; place-items: center; font-size: 24px; background: var(--accent); color: #fff; box-shadow: var(--shadow); z-index: 2; }
.tl-nav:hover { text-decoration: none; filter: brightness(1.08); }
.nav-buttons { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (max-width: 420px) { .nav-buttons { grid-template-columns: 1fr; } }