*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

:root{
    --papper:#fdfbf7;
    --ink:#1e293b;
    --marginal:#fca5a5;
    --linje:#e2e8f0;
}

body{
    font-family:'Inter',Arial,sans-serif;
    background:#e2e8f0;
    color:var(--ink);
    padding:10px;
    display:flex;
    justify-content:center;
}

/* ---------- Anteckningsboken ---------- */

.anteckningsbok{
    position:relative;
    width:100%;
    max-width:900px;
    min-height:90vh;

    padding:30px 20px 40px;

    background-color:var(--papper);
    background-image:repeating-linear-gradient(
        transparent,
        transparent 39px,
        var(--linje) 40px
    );
    background-position:0 40px;

    border-radius:4px 12px 12px 4px;
    box-shadow:
        -10px 0 20px rgba(0,0,0,.05),
        10px 10px 30px rgba(0,0,0,.1);
}

@media (min-width:640px){
    body{ padding:30px; }

    .anteckningsbok{
        padding:40px 40px 50px 80px;
    }

    /* Röd marginallinje */
    .anteckningsbok::before{
        content:"";
        position:absolute;
        left:48px;
        top:0;
        bottom:0;
        width:2px;
        background:var(--marginal);
    }
}

.page-title{
    font-family:'Caveat',cursive;
    font-size:3.6rem;
    font-weight:700;
    margin-bottom:10px;
}

.top-menu{
    margin-bottom:30px;
}

.admin-knapp{
    font-family:'Caveat',cursive;
    font-size:1.5rem;
    color:var(--ink);
    text-decoration:underline;
    text-decoration-style:wavy;
    text-decoration-color:var(--marginal);
    text-underline-offset:5px;
}

.admin-knapp:hover{
    color:#475569;
}

/* ---------- Produktlistan ---------- */

#produkt-lista{
    display:flex;
    flex-direction:column;
}

.produkt{
    display:flex;
    align-items:center;
    gap:20px;

    padding:16px 0;
    border-bottom:1px solid rgba(148,163,184,.35);
}

/* Bilden som ett fasttejpat foto */
.produkt-bild{
    width:90px;
    height:90px;
    flex-shrink:0;
    object-fit:cover;

    border:4px solid white;
    box-shadow:0 3px 8px rgba(0,0,0,.2);
    transform:rotate(-2deg);
}

.produkt:nth-child(even) .produkt-bild{
    transform:rotate(2deg);
}

.produkt-info{
    flex:1;
    min-width:0;
}

.produkt-info h2{
    font-family:'Caveat',cursive;
    font-size:2rem;
    font-weight:700;
    margin-bottom:6px;
}

/* ---------- Streck (tally marks) ---------- */

.streck-yta{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:14px;
    min-height:34px;
    margin-bottom:12px;
}

.streck-grupp{
    position:relative;
    height:32px;
    display:flex;
    align-items:center;
    gap:6px;
    padding:0 2px;
}

.streck{
    width:3px;
    height:100%;
    background:var(--ink);
    border-radius:4px 4px 4px 4px / 1px 1px 10px 10px;
    box-shadow:1px 0 1px rgba(0,0,0,.05);
}

.streck-diagonal{
    position:absolute;
    left:-15%;
    top:50%;
    width:130%;
    height:3px;
    background:var(--ink);
    border-radius:4px;
    transform:rotate(-45deg);
}

.streck-tomt,
.streck-antal{
    font-family:'Caveat',cursive;
    font-size:1.5rem;
    color:#94a3b8;
}

/* ---------- Knappar ---------- */

.btn-salj{
    font-family:'Caveat',cursive;
    font-size:1.5rem;

    background:var(--ink);
    color:white;
    border:none;
    border-radius:6px;
    padding:4px 20px;

    cursor:pointer;
    box-shadow:0 2px 5px rgba(0,0,0,.2);
    transition:background .2s;
}

.btn-salj:hover{
    background:#475569;
}

.saldo-rad{
    display:flex;
    align-items:center;
    gap:10px;
}

.saldo-knapp{
    width:42px;
    height:42px;
    border-radius:50%;
    font-size:24px;
    font-weight:bold;
    cursor:pointer;
    transition:background .2s;
}

.minus{
    background:transparent;
    color:var(--ink);
    border:2px solid var(--ink);
}

.minus:hover{ background:#f1f5f9; }

.plus{
    background:var(--ink);
    color:white;
    border:2px solid var(--ink);
}

.plus:hover{ background:#475569; }

.saldo-input{
    width:80px;
    text-align:center;

    font-family:'Caveat',cursive;
    font-size:2rem;
    font-weight:700;
    color:var(--ink);

    background:transparent;
    border:none;
    border-bottom:2px dashed #94a3b8;
    outline:none;
}

.saldo-input:focus{
    border-bottom:2px solid var(--ink);
}

/* ---------- Modal ---------- */

.modal-dold{
    display:none;
}

.modal-synlig{
    position:fixed;
    inset:0;
    z-index:50;

    display:flex;
    justify-content:center;
    align-items:center;

    background:rgba(0,0,0,.5);
}

.modal-innehall{
    background:var(--papper);
    padding:30px;
    border-radius:6px;
    width:90%;
    max-width:400px;
    text-align:center;
    box-shadow:0 10px 30px rgba(0,0,0,.3);
}

.modal-innehall h3{
    font-family:'Caveat',cursive;
    font-size:2.2rem;
    margin-bottom:20px;
}

.modal-knappar{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.btn-okej,
.btn-angra{
    font-family:'Caveat',cursive;
    font-size:1.5rem;
    padding:6px;
    border-radius:6px;
    cursor:pointer;
}

.btn-okej{
    background:var(--ink);
    color:white;
    border:2px solid var(--ink);
}

.btn-angra{
    background:transparent;
    color:#dc2626;
    border:2px solid #dc2626;
}

/* ---------- Inloggning ---------- */

#login-ruta{
    position:fixed;
    inset:0;
    z-index:100;

    display:flex;
    justify-content:center;
    align-items:center;

    background:#e2e8f0;
    padding:20px;
}

.login-kort{
    width:100%;
    max-width:360px;
    padding:30px;

    background:var(--papper);
    border-radius:6px;
    box-shadow:0 10px 30px rgba(0,0,0,.2);

    display:flex;
    flex-direction:column;
    gap:16px;
}

.login-kort h2{
    font-family:'Caveat',cursive;
    font-size:2.6rem;
    text-align:center;
}

.login-kort input{
    font-family:'Inter',Arial,sans-serif;
    font-size:1rem;
    padding:6px 2px;
    color:var(--ink);

    background:transparent;
    border:none;
    border-bottom:2px dashed #94a3b8;
    outline:none;
}

.login-kort input:focus{
    border-bottom:2px solid var(--ink);
}

.login-kort button{
    font-family:'Caveat',cursive;
    font-size:1.6rem;
    padding:4px;

    background:var(--ink);
    color:white;
    border:none;
    border-radius:6px;
    cursor:pointer;
}

.login-kort button:hover{
    background:#475569;
}

#login-fel{
    color:#dc2626;
    text-align:center;
    min-height:1.2em;
}