/* ====== ZÁKLAD ====== */
:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #0e1424;
    --muted: #5a6c8f;
    --primary: #2f74ff;
    --primary-ink: #ffffff;
    --border: #03A9F4;
    --btn-bg-1: #2196F3;
    --btn-bg-2: #46c5ff;
    --ring: rgba(47, 116, 255, .25);
    --shadow: 0 8px 24px rgba(15, 29, 60, .08);
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: radial-gradient(1200px 600px at 10% -10%, rgba(90, 167, 255, .08), transparent 60%), var(--bg);
    background-repeat: no-repeat;
    display: flex;
    flex-wrap: wrap;
    align-content: space-between;
    height: 100vh;
}

a {
    text-decoration: none;
    color: #2196F3;
}

a:hover {
    color: #01589f;
}

/* Kontejner stránky */
.container {
    width: min(1100px, 92%);
    margin: 24px auto;
    max-width: 350px;
    background: #F8F9FD;
    background: linear-gradient(0deg, rgb(255, 255, 255) 0%, rgb(244, 247, 251) 100%);
    border-radius: 40px;
    padding: 25px 35px;
    border: 5px solid rgb(255, 255, 255);
    box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 30px 30px -20px;
}

section {
    width: min(1100px, 92%);
    margin: 24px auto;
    background: #F8F9FD;
    background: linear-gradient(0deg, rgb(255, 255, 255) 0%, rgb(244, 247, 251) 100%);
    border-radius: 40px;
    padding: 25px;
    border: 5px solid rgb(255, 255, 255);
    box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 30px 30px -20px;
}

/* Panel / karta */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

/* Hlavička stránky */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.title {
    font-size: clamp(18px, 2.2vw, 28px);
    font-weight: 700;
    letter-spacing: .2px;
}

.subtitle {
    color: var(--muted);
    font-size: .95rem
}

.btns {
    margin: 30px 0;
    display: flex;
    justify-content: space-between;
}


/* ====== FORMULÁŘE ====== */
form {
    display: grid;
    gap: 12px
}

input,
button {
    height: 40px;
    font-size: 15px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--text);
    outline: none;
    margin-top: 15px;
    box-shadow: #cff0ff 0px 10px 10px -5px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 6px var(--ring);
}

label {
    font-weight: 600;
    font-size: .95rem
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px
}

/* Dvou-sloupec na větších displejích */
.grid-2 {
    display: grid;
    gap: 12px;
}

@media (min-width: 720px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Switch/checkbox (pro „checked“) */
.switch {
    --s: 22px;
    appearance: none;
    width: calc(var(--s)*2);
    height: var(--s);
    background: #a9b4c9;
    border-radius: var(--s);
    position: relative;
    outline: none;
    cursor: pointer;
    border: none;
    transition: background .2s;
}

.switch:before {
    content: "";
    position: absolute;
    inset: 3px auto 3px 3px;
    width: calc(var(--s) - 6px);
    aspect-ratio: 1;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}

.switch:checked {
    background: var(--success)
}

.switch:checked:before {
    transform: translateX(calc(var(--s) - 6px))
}

/* ====== TLAČÍTKA ====== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    --clr-font-main: #333;
    cursor: pointer;
    padding: .9em ;
    min-width: 120px;
    height: 44px;
    font-size: var(--size, 1rem);
    font-weight: 500;
    transition: 0.8s;
    background-size: 280% auto;
    background-image: linear-gradient(325deg, var(--btn-bg-2) 0%, var(--btn-bg-1) 55%, var(--btn-bg-2) 90%);
    border: none;
    border-radius: .5em;
    color: #ffffff;
    box-shadow: 0px 0px 20px #47b8ff80, 
                0px 5px 5px -1px #3a7de940, 
                inset 4px 4px 8px #afe6ff80, 
                inset -4px -4px 8px #135fd838;
    margin-top: 20px;
}

@media (prefers-reduced-motion: reduce) {
    .btn {
        transition: linear;
    }
}

.btn:hover {
    background-position: right top;
}

.btn:is(:focus, :focus-visible, :active) {
    outline: none;
    box-shadow:
        0 0 0 3px var(--btn-bg-color),
        0 0 0 6px var(--btn-bg-2);
}

.logout {
    border: none;
    background: none;
    cursor: pointer;
    color: #2196F3;
    font-size: 16px;
}

.logout:hover {
    color: #01589f;
}


.fa-solid {
    margin-right: 10px;
}

.check {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 4px
}

/* ====== TABULKA ====== */
.table {
    max-width: 720px;
}

.table-wrapper {
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 0 0 14px 14px;
    overflow: hidden;
}

.table-wrapper > .table-body:last-child p:first-child {
    border-bottom-left-radius: 13px;
}

.table-wrapper > .table-body:last-child p:last-child {
    border-bottom-right-radius: 13px;
}

.table-head {
    width: 100%;
    max-width: 720px;
    border-spacing: 0;
    background: color-mix(in oklab, var(--panel), black 4%);
    overflow: auto;
}

.table-head p {
    padding: 10px 15px;
    margin: 0;
    font-weight: bold;
    border: 1px solid #9E9E9E;
}

.table-head,
.table-body {
    display: grid;
    grid-template-columns: 45% 32% 23%;
}

.table-body p {
    padding: 10px 15px;
    margin: 0;
    border: 1px solid #9E9E9E;
}

.table-body a {
    font-weight: bold;
}

.filters {
    display: flex; 
    align-items: center;
    margin: 1rem 0 0; 
}

.filter-btn {
    border: 2px solid var(--border);
    padding: 5px 10px;
    border-radius: 10px 10px 0 0;
}

.filter-btn.active {
    color: #ffffff;
    background-image: linear-gradient(325deg, var(--btn-bg-2) 0%, var(--btn-bg-1) 55%, var(--btn-bg-2) 90%);
}

.list-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.list-item h2 {
    width: 100%;
    text-align: center;
}

.item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 10px auto;
    text-align: center;
}

.item1,
.item2 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 10px auto;
    text-align: center;
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    color: var(--text);
    outline: none;
    border: 1px solid var(--border);
    margin-top: 15px;
    box-shadow: #cff0ff 0px 10px 10px -5px;
}

.item p {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 250px;
    margin: 10px 0;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    color: var(--text);
    outline: none;
    border: 1px solid var(--border);
    margin-top: 15px;
    box-shadow: #cff0ff 0px 10px 10px -5px;
}

.item p strong,
.item1 p,
.item2 strong {
    width: 100%;
}

.detail-item {
    width: 80%;
}

.after::after {
    content: "";
    display: block;
    height: 2px;
    background-color: #0099ff;
    width: 30%;
    margin: 0 auto;
}


/* Odznaky (status) */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
}

.badge.ok {
    background: color-mix(in oklab, var(--success), white 70%);
    color: #0f3a26
}

.badge.miss {
    background: color-mix(in oklab, var(--warn), white 70%);
    color: #3b2a00
}

.badge.out {
    background: color-mix(in oklab, var(--danger), white 70%);
    color: #4a0c0c
}

/* Řádkové akce */
.row-actions {
    display: flex;
    gap: 8px
}

/* ====== LOGIN STRÁNKA ====== */
.login-page {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(600px 300px at 100% 0, rgba(57, 192, 127, .08), transparent 60%),
        radial-gradient(800px 500px at 0 100%, rgba(90, 167, 255, .10), transparent 60%),
        var(--bg);
}

.login-card {
    width: min(420px, 92%);
    padding: 28px;
    display: grid;
    gap: 14px;
    text-align: center;
}

.login-card h2 {
    margin: 0 0 6px
}

.helper {
    color: var(--muted);
    font-size: .9rem
}

/* ====== NOTIFIKACE ====== */
.alert {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: color-mix(in oklab, var(--panel), white 4%);
}

.alert.ok {
    border-color: color-mix(in oklab, var(--success), white 40%)
}

.alert.warn {
    border-color: color-mix(in oklab, var(--warn), white 40%)
}

.alert.err {
    border-color: color-mix(in oklab, var(--danger), white 40%)
}

/* ====== KAMERA / SKEN ====== */
.scan-area {
    display: grid;
    gap: 10px;
    background: var(--panel);
    border: 1px dashed var(--border);
    border-radius: 14px;
    padding: 12px;
    align-items: center;
    justify-items: center;
}

video#preview {
    width: 100%;
    max-height: 50dvh;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.code-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: sweep 1.6s linear infinite;
}

@keyframes sweep {
    0% {
        transform: translateX(-100%)
    }

    100% {
        transform: translateX(100%)
    }
}

/* ====== PAGER / FILTRY ====== */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 14px;
}

.search {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search input {
    min-width: 220px
}


/* ====== SCAN ====== */
#result {
    display:none; 
    margin-top:12px; 
    padding:12px; 
    border:1px solid #e5e7eb; 
    border-radius:12px;
}


/* ====== FOOTER ====== */
footer {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 100px;
    background: linear-gradient(0deg, rgb(255, 255, 255) 0%, rgb(244, 247, 251) 100%);
    padding: 25px 35px;
    border: 5px solid rgb(255, 255, 255);
    box-shadow: rgba(133, 189, 215, 0.8784313725) 0px -20px 30px -20px;
    background: #f8f8f8;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    font-size: 15px;
}

.footer-nav {
    display: flex;
    gap: 50px;
    align-items: center; 
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    width: 50%;
}

.footer-copy {
    margin: 0;
    color: #555;
}

.footer-copy a {
    color: #007bff;
    text-decoration: none;
}

.footer-copy a:hover {
    text-decoration: underline;
}

.footer-nav .nav-item {
    background: none;
    border: none;
    font: inherit;
    color: #007bff;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.footer-nav .nav-item:hover {
    color: #01589f;
}

.logout-form {
    margin: 0;
}

/* odstraníme defaultní margin od form */
.footer-nav .logout-form {
    margin: 0;
}



@media (pointer: coarse) {
    .btn {
        padding: 12px 16px
    }

}







.heading {
    text-align: center;
    font-weight: 900;
    font-size: 30px;
    color: rgb(16, 137, 211);
}

.form {
    margin-top: 20px;
}

form p {
    margin: 0;
}

.form input::-moz-placeholder {
    color: rgb(170, 170, 170);
}

.form input::placeholder {
    color: rgb(170, 170, 170);
}

.form input:focus {
    outline: none;
    border-inline: 2px solid #12B1D1;
}

.form .forgot-password {
    display: block;
    margin-top: 10px;
    margin-left: 10px;
}

.form .forgot-password a {
    font-size: 11px;
    color: #0099ff;
    text-decoration: none;
}

.form .login-button {
    display: block;
    width: 100%;
    font-weight: bold;
    background: linear-gradient(45deg, rgb(16, 137, 211) 0%, rgb(18, 177, 209) 100%);
    color: white;
    padding-block: 15px;
    margin: 20px auto;
    border-radius: 20px;
    box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 20px 10px -15px;
    border: none;
    transition: all 0.2s ease-in-out;
}

.form .login-button:hover {
    transform: scale(1.03);
    box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 23px 10px -20px;
}

.form .login-button:active {
    transform: scale(0.95);
    box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 15px 10px -10px;
}

.agreement {
    display: block;
    text-align: center;
    margin-top: 15px;
}

.agreement a {
    text-decoration: none;
    color: #0099ff;
    font-size: 9px;
}







@media (min-width: 600px) and (max-width: 1024px) {
    .container {
        padding: 40px;
    }
}

@media (max-width: 662.99px) {
    section {
        width: min(1100px, 100%);
        margin: 24px 0;
    }

    .table-body p {
        padding: 10px;
    }

    .filters {
        overflow: scroll;
    }

    .item {
        justify-content: center;
        margin: 0 auto;
    }

    .item p {
        width: 100%;
        margin: 10px 0;
    }

    .item1 {
        margin: 10px auto;
    }

    .item2 {
        margin: 10px auto 20px;
    }

    .detail-item {
        width: 100%;
    }

    .footer-container {
        justify-content: center;
    }

}

