/* RFID účet — Detské centrum Rožňava. Dotykové UI, veľké ciele. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #0e7fb8;
    --primary-dark: #0a648f;
    --accent: #f59e0b;
    --ok: #16a34a;
    --danger: #dc2626;
    --bg: #f2f6f9;
    --card: #ffffff;
    --text: #1e2a32;
    --muted: #64748b;
    --border: #d8e1e8;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(30, 42, 50, .12);
}
html { font-size: 17px; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

/* ── horná lišta ─────────────────────────────── */
.topbar {
    display: flex; align-items: center; gap: 1rem;
    background: var(--primary); color: #fff;
    padding: .5rem 1rem;
    position: sticky; top: 0; z-index: 20;
}
.topbar .brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.topbar nav { display: flex; gap: .25rem; flex: 1; }
.topbar nav a {
    color: #eaf4fa; text-decoration: none; padding: .55rem .8rem;
    border-radius: 8px; font-weight: 600;
}
.topbar nav a:active, .topbar nav a:hover { background: var(--primary-dark); }
.topbar-user { display: flex; align-items: center; gap: .6rem; font-weight: 600; }

.page { padding: 1rem; max-width: 1280px; margin: 0 auto; }

/* ── tlačidlá ────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    border: none; border-radius: var(--radius); cursor: pointer;
    background: var(--primary); color: #fff;
    font-size: 1.05rem; font-weight: 700;
    padding: .85rem 1.4rem; min-height: 52px;
    text-decoration: none; box-shadow: var(--shadow);
    transition: transform .05s;
}
.btn:active { transform: scale(.97); }
.btn-ok { background: var(--ok); }
.btn-danger { background: var(--danger); }
.btn-outline { background: transparent; border: 2px solid currentColor; color: inherit; box-shadow: none; }
.btn-big { font-size: 1.3rem; padding: 1.1rem 2rem; min-height: 64px; }
.btn-small { font-size: .9rem; padding: .4rem .8rem; min-height: 40px; border-radius: 10px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ── flash správy ───────────────────────────── */
.flash {
    padding: .9rem 1.2rem; border-radius: var(--radius); margin-bottom: 1rem;
    font-weight: 600; box-shadow: var(--shadow);
}
.flash-ok { background: #dcfce7; color: #14532d; }
.flash-err { background: #fee2e2; color: #7f1d1d; }

/* ── login ──────────────────────────────────── */
.login-wrap { max-width: 640px; margin: 3vh auto; text-align: center; }
.login-wrap h1 { margin-bottom: 1.5rem; font-size: 1.6rem; }
.user-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.user-tile {
    background: var(--card); border: 2px solid var(--border); border-radius: var(--radius);
    padding: 1.4rem .8rem; font-size: 1.2rem; font-weight: 700; cursor: pointer;
    box-shadow: var(--shadow);
}
.user-tile:active { border-color: var(--primary); }
.pinpad { max-width: 320px; margin: 1rem auto; }
.pin-display {
    font-size: 2rem; letter-spacing: .6rem; text-align: center;
    min-height: 3rem; margin-bottom: 1rem; font-weight: 700;
}
.pin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.pin-key {
    font-size: 1.5rem; font-weight: 700; padding: 1rem 0; min-height: 68px;
    border: 2px solid var(--border); border-radius: var(--radius);
    background: var(--card); cursor: pointer; box-shadow: var(--shadow);
}
.pin-key:active { background: #e8f2f8; border-color: var(--primary); }

/* ── sken / index ───────────────────────────── */
.scan-banner {
    display: flex; align-items: center; gap: 1rem;
    background: var(--card); border: 2px dashed var(--primary);
    border-radius: var(--radius); padding: 1.1rem 1.4rem; margin-bottom: 1.2rem;
    font-size: 1.15rem; font-weight: 600; color: var(--primary-dark);
}
.scan-banner .pulse {
    width: 14px; height: 14px; border-radius: 50%; background: var(--primary);
    animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.section-title { font-size: 1.1rem; color: var(--muted); margin: 1.2rem 0 .6rem; text-transform: uppercase; letter-spacing: .04em; }
.tab-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.tab-tile {
    display: block; background: var(--card); border-radius: var(--radius);
    padding: 1rem 1.2rem; text-decoration: none; color: var(--text);
    box-shadow: var(--shadow); border-left: 6px solid var(--accent);
}
.tab-tile .tt-label { font-size: 1.2rem; font-weight: 800; }
.tab-tile .tt-uid { color: var(--muted); font-size: .85rem; }
.tab-tile .tt-sum { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); margin-top: .3rem; }
.tab-tile .tt-meta { color: var(--muted); font-size: .85rem; }

/* ── obrazovka účtu ─────────────────────────── */
.tab-layout { display: grid; grid-template-columns: 1fr 380px; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .tab-layout { grid-template-columns: 1fr; } }

.cat-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.cat-tab {
    border: 2px solid var(--border); background: var(--card); border-radius: 999px;
    padding: .6rem 1.1rem; font-size: 1rem; font-weight: 700; cursor: pointer; min-height: 48px;
}
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.item-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.item-tile {
    background: var(--card); border: 2px solid var(--border); border-radius: var(--radius);
    padding: .8rem .6rem; min-height: 92px; cursor: pointer; text-align: center;
    display: flex; flex-direction: column; justify-content: center; gap: .35rem;
    box-shadow: var(--shadow); font-size: .95rem; font-weight: 600;
}
.item-tile:active { border-color: var(--ok); background: #f0fdf4; }
.item-tile .price { color: var(--primary-dark); font-weight: 800; font-size: 1.05rem; }

.tab-panel {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1rem; position: sticky; top: 70px;
}
.tab-panel h2 { font-size: 1.05rem; color: var(--muted); margin-bottom: .6rem; }
.tab-items { list-style: none; max-height: 46vh; overflow-y: auto; }
.tab-items li {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem 0; border-bottom: 1px solid var(--border);
}
.ti-name { flex: 1; font-weight: 600; font-size: .95rem; }
.ti-qty { display: flex; align-items: center; gap: .35rem; }
.ti-qty button {
    width: 42px; height: 42px; border-radius: 10px; border: 2px solid var(--border);
    background: var(--card); font-size: 1.3rem; font-weight: 800; cursor: pointer;
}
.ti-qty button:active { border-color: var(--primary); }
.ti-qty .q { min-width: 2ch; text-align: center; font-weight: 800; font-size: 1.1rem; }
.ti-sum { min-width: 72px; text-align: right; font-weight: 700; }

.tab-total {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 1.15rem; font-weight: 700; padding: .9rem 0;
}
.tab-total .sum { font-size: 1.8rem; font-weight: 900; color: var(--primary-dark); }

.label-row { display: flex; gap: .5rem; margin-bottom: .8rem; }
.label-row input {
    flex: 1; font-size: 1.05rem; padding: .6rem .8rem;
    border: 2px solid var(--border); border-radius: 10px;
}

/* ── checkout ───────────────────────────────── */
.checkout-card {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    max-width: 720px; margin: 0 auto; padding: 1.5rem;
}
.checkout-card h1 { font-size: 1.4rem; margin-bottom: 1rem; }
.checkout-table { width: 100%; border-collapse: collapse; font-size: 1.15rem; }
.checkout-table th { text-align: left; color: var(--muted); font-size: .9rem; text-transform: uppercase; padding: .4rem .5rem; }
.checkout-table td { padding: .65rem .5rem; border-top: 1px solid var(--border); }
.checkout-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.checkout-table .qty { font-weight: 800; }
.checkout-total {
    display: flex; justify-content: space-between; align-items: baseline;
    border-top: 3px solid var(--text); margin-top: .5rem; padding-top: .8rem;
    font-size: 1.3rem; font-weight: 800;
}
.checkout-total .sum { font-size: 2.4rem; font-weight: 900; color: var(--primary-dark); }
.checkout-actions { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.checkout-actions form { flex: 1; }
.checkout-actions .btn { width: 100%; }

/* ── tabuľky (admin, import, users) ─────────── */
.data-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: #e8eff5; text-align: left; padding: .6rem .8rem; font-size: .85rem; text-transform: uppercase; color: var(--muted); }
.data-table td { padding: .6rem .8rem; border-top: 1px solid var(--border); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge-open { background: #fef3c7; color: #92400e; }
.badge-closed { background: #e2e8f0; color: #334155; }
.badge-new { background: #dcfce7; color: #14532d; }
.badge-changed { background: #fef3c7; color: #92400e; }
.badge-removed { background: #fee2e2; color: #7f1d1d; }

.form-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; max-width: 560px; margin-bottom: 1.2rem; }
.form-card label { display: block; font-weight: 700; margin: .8rem 0 .3rem; }
.form-card input, .form-card select {
    width: 100%; font-size: 1.05rem; padding: .65rem .8rem;
    border: 2px solid var(--border); border-radius: 10px; background: #fff;
}
.muted { color: var(--muted); }
.mt { margin-top: 1rem; }
