:root {
    --bg: #f6f7f9;
    --card: #ffffff;
    --primary: #3b82f6;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --radius: 14px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
}

/* Layout */
.pos-wrapper {
    display: flex;
    height: 100vh;
}

/* ================= KASSA ================= */

.cart {
    width: 400px;
    background: #f1f3f5;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.cart h2 {
    font-size: 22px;
    margin-bottom: 15px;
}

/* Bon-stijl cart-items */
.cart-items {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    font-family: monospace; /* echte kassabon vibe */
    mask: repeating-conic-gradient(from 140deg at 50% 13px,#0000 0,#000 1deg 79deg,#0000 80deg 180deg) 50% -13px/21.82px

}

/* Cart-item als bonregel */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed #ccc; /* stippellijn zoals bon */
}

.cart-item:last-child {
    border-bottom: none; /* laatste regel geen streep */
}

.cart-item span {
    font-family: monospace;
    font-size: 14px;
}

/* Prijs + remove knop container */
.item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Remove knop, rood zoals C-knop */
.remove-btn {
    background: #e76f51; /* hetzelfde rood als C-knop */
    color: white;
    border: none;
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    position: static; /* naast prijs */
}

.remove-btn:hover {
    background: #d94f48;
}

.quantity-display {
    text-align: center;
    margin: 10px 0;
    font-size: 16px;
}

/* Keypad */
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.key {
    padding: 14px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    background: #e5e7eb;
    cursor: pointer;
}

.key.clear {
    grid-column: 2 / 4;
    background: #e76f51;
    color: white;
}

.total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    margin-bottom: 15px;
}

.pay-btn {
    background: var(--primary);
    color: white;
    padding: 16px;
    border-radius: var(--radius);
    font-size: 18px;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(79,124,255,0.3);
}

/* ================= PRODUCTEN ================= */

.products {
    flex: none;
    padding: 25px;
    overflow-y: auto;
}

.products h2 {
    font-size: 22px;
    margin-bottom: 15px;
}

.categories {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    margin-top: 20px;

    overflow-x: auto;      
    white-space: nowrap;   
    padding-bottom: 5px;   
    -webkit-overflow-scrolling: touch; 
}
/* Verberg de scrollbar optioneel */
.categories::-webkit-scrollbar {
    display: none; 
}
.categories::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}

.category {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 18px;
    cursor: pointer;
    font-weight: bolder;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;  
}

.category.active {
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(79,124,255,0.2);
}

/* Search */
.search {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}

.search form {
    flex: 1; 
    display: flex; 
}

.search input {
    flex: 1; 
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 16px;
}

.edit-buttons {
    display: flex;
    gap: 12px;
    margin-left: auto; 
}

/* ================= PRODUCTEN ================= */
.products {
    flex: 1;
    flex-direction: column;
    padding: 25px;
    overflow: hidden;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 150px); /* pas dit aan afhankelijk van header + categories hoogte */
}

/* verberg scrollbar */
.product-grid::-webkit-scrollbar {
    display: none;              
}
.product-grid {
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE 10+ */
}

/* ================= PRODUCT ITEM ================= */
.product {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

/* Product image */
.product-image {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 10px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* Product info */
.product-info {
    text-align: center;
    margin-top: 8px;
}

.product .name {
    display: block;
    font-weight: 600;
}

.product .price {
    color: var(--muted);
    font-size: 14px;
}

.product:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.1);
}

.total {
    font-weight: bold;            /* dikker */
    font-size: 16px;              /* iets groter dan bonregels */
    border-top: 2px solid #333;   /* streep erboven om het te scheiden */
    margin-top: 8px;
    padding-top: 6px;
    display: flex;
    justify-content: space-between;
    color: #111;                  /* iets donkerder */
}

/* ================= PRODUCT SECTION ================= */

/* Full width achtergrond */
.db-section {
    width: 100%;
    background: var(--bg);
    padding: 25px 0;
}

/* Inner container = zelfde als navbar */
.db-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px; /* zelfde padding als navbar */
}

/* === PRODUCT MENU (3 DOTS) === */

.product {
    cursor: pointer;
}

/* container */
.product-menu {
    position: absolute;
    top: 8px;
    right: 8px;
}

.menu-dropdown {
    position: absolute;
    top: 28px;
    right: 0;
}

/* 3 dots button */
.menu-toggle {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 6px;
}

.menu-toggle:hover {
    background: #f1f3f5;
}

/* dropdown */
.menu-dropdown {
    position: absolute;
    top: 28px;
    right: 0;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    overflow: hidden;
    display: none;
    min-width: 140px;
    z-index: 10;
}

/* buttons */
.menu-item {
    display: block;        
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;          
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none; 
    color: inherit;     
}

.menu-item:hover {
    background: #f6f7f9;
}

.menu-item.danger {
    color: #e63946;
}

.category-add {
    flex-shrink: 0;   
    background-color: var(--primary);
    color: white;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    transition: background 0.2s;
}

/* ================= CATEGORY TABLE ================= */
.category-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 15px;
}

.category-table th,
.category-table td {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

.category-table th {
    background: var(--bg);
    font-weight: 600;
}

.category-table tr:hover {
    background: #f9f9f9;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    color: white;
    transition: background 0.2s;
}

.edit-btn {
    background: #3b82f6; /* blauw */
}

.edit-btn:hover {
    background: #2563eb;
}

.delete-btn {
    background: #e63946; /* rood */
}

.delete-btn:hover {
    background: #b32d3a;
}

.remove-item{
    padding: 0 11px;
    font-size: 30px;
}

@media print {
    body * {
        visibility: hidden; /* verberg alles */
    }
    #printable-receipt, #printable-receipt * {
        visibility: visible; /* toon alleen het bonnetje */
    }
    #printable-receipt {
        position: absolute;
        left: 0;
        top: 0;
    }
}

/* ================= FILTER FORM ================= */
.filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.filter-input {
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 14px;
}

.filter-btn {
    background-color: var(--primary);
    color: white;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
    font-size: 16px;
}

.top-right-logout {
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 1000;

    display: flex;         
    align-items: center;
    gap: 12px;              
}

.logout-btn {
    background: var(--primary);
    color: #fff;

    padding: 10px 18px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;

    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;

    border: none;           
    cursor: pointer;
}
#users-header {
    display: flex;
    align-items: center; /* Zorgt dat ze verticaal netjes uitlijnen */
    justify-content: space-between; /* Zet h2 links en knop rechts */
    margin-bottom: 20px;
}

#users-header h2 {
    margin: 0;
}

@media (max-width: 768px) {
    #users-header {
        flex-wrap: wrap; /* zodat h2 en knop netjes kunnen wrappen */
        gap: 10px;       /* beetje ruimte tussen h2 en knop */
    }

    #users-header h2 {
        flex: 1 1 auto;  /* h2 neemt beschikbare ruimte, maar kan krimpen */
        font-size: 20px;
    }

    #users-header .category-add {
        flex: 0 0 auto;  /* knop wordt niet te breed */
        padding: 10px 14px;
        font-size: 14px;
        white-space: nowrap; /* voorkom dat de tekst afbreekt */
    }
}

/* =========================
   SALES HEADER
   ========================= */
.sales-header {
    display: flex;
    align-items: center; /* verticaal gecentreerd */
    gap: 10px;
    flex-wrap: wrap;
}

/* Form + div.btn-group uitlijnen als flex-items */
.sales-header > form,
.sales-header > .btn-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

/* Alle knoppen exact dezelfde hoogte + flexbox */
.sales-header button.filter-btn,
.sales-header a.filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 14px;
    font-size: 16px;
}

/* =========================
   MOBIEL
   ========================= */
@media (max-width: 768px) {
    .sales-header .filter-form {
        flex-wrap: wrap;      /* rijen mogen wrappen */
        gap: 8px;
    }

    .sales-header .filter-input,
    .sales-header select,
    .sales-header .filter-btn {
        flex: 1 1 auto;       /* neem hele breedte van container */
        min-width: 0;
        max-width: 100%;
        font-size: 14px;
        padding: 10px;
    }
}



/* =========================
/* =========================
   REAL MOBILE FIX (NO NAVBAR)
   ========================= */
@media (max-width: 768px) {

    /* DB CONTAINER */
    .db-container {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 12px !important;
    }

    .db-section {
        padding: 12px 0 !important;
    }

    /* SEARCH STACK */
    .search {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .edit-buttons {
        width: 100%;
        gap: 10px;
    }

    .category-add {
        flex: 1;
        justify-content: center;
        padding: 14px;
        font-size: 16px;
    }

    /* CATEGORIES */
    .category {
        padding: 12px 18px;
        font-size: 15px;
    }

    /* PRODUCT GRID — FORCE MOBILE */
    .product-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* PRODUCT CARD */
    .product {
        padding: 14px !important;
        border-radius: 16px;
    }

    .product-image {
        height: 130px !important;
    }

    .product .name {
        font-size: 16px;
        line-height: 1.3;
    }

    .product .price {
        font-size: 15px;
    }

    /* PRODUCT 3-DOTS MENU (GEEN NAVBAR) */
    .menu-toggle {
        font-size: 22px;
        padding: 14px;
    }

    .menu-item {
        padding: 14px 18px;
        font-size: 16px;
    }

    /* APP FEEL */
    body {
        -webkit-tap-highlight-color: transparent;
    }

    .product:active {
        transform: scale(0.97);
    }
}

/* ================= CATEGORY HEADER ================= */
.category-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* mobiel vriendelijk */
}

/* ================= ALERTS ================= */
.category-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    max-width: 520px;
    animation: fadeIn 0.2s ease-in;
}

/* ❌ ERROR */
.category-alert.error {
    background: #fdecea;          /* licht rood */
    color: #b42318;               /* donker rood */
    border: 1px solid #f5c2c0;
}

/* ✅ SUCCESS */
.category-alert.success {
    background: #ecfdf3;          /* licht groen */
    color: #027a48;
    border: 1px solid #a6f4c5;
}

/* Icons */
.category-alert i {
    font-size: 16px;
}

/* Subtiele animatie */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================= HEADER TOP ================= */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
}

/* Titel */
.user-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

/* ================= ALERT CONTAINER ================= */
.header-alerts {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
    }

    .header-top .category-add {
        width: 100%;
        justify-content: center;
    }
}

