/* Utility: zet alleen titel en QR code in één rij, zonder de rest te beïnvloeden */
.product-title-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.25rem; /* Reduce space below title/QR row */
}
.product-title-row h2, .product-title-row .product-title {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    word-break: break-word;
    white-space: normal;
    display: block;
}
.product-title-row .product-qr-container {
    flex: 0 0 auto;
    position: static;
    top: auto;
    right: auto;
}
/* PanelTrack CSS Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Bar */
.top-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo styling voor header */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    height: 80px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
}

.top-bar h1 {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Dropdown styling */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    position: relative;
}

/* New header button styling from uiverse */
.header-button {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1rem;
    gap: 8px;
    height: auto;
    min-height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* Header button variants */
.header-button.secondary {
    background: rgba(94, 65, 222, 0.4);
    color: white;
}

.header-button.secondary:hover {
    background: rgba(94, 65, 222, 0.7);
    border-color: rgba(255, 255, 255, 0.5);
}

.header-button.danger {
    background: rgba(220, 53, 69, 0.5);
    color: white;
}

.header-button.danger:hover {
    background: rgba(220, 53, 69, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
}

.header-button.settings {
    background: rgba(94, 65, 222, 0.4);
    color: white;
}

.header-button.settings:hover {
    background: rgba(94, 65, 222, 0.7);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Primary variant for prominent actions (e.g., Product toevoegen) */
.header-button.primary {
    background: rgba(40, 167, 69, 0.6);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.header-button.primary:hover {
    background: rgba(40, 167, 69, 0.85);
    border-color: rgba(255, 255, 255, 0.6);
}

.header-button.settings:hover .svg-icon {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.header-button .svg-icon {
    width: 20px;
    height: 20px;
    fill: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 100%;
    width: max-content;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f1f1f1;
    transition: background-color 0.2s ease;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #667eea;
}

.dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

/* Reststuk code (ACR code) styling */
.reststuk-code {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 2px;
}

/* Version badge */
.version-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 999px;
    color: #fff;
    background: rgba(17, 24, 39, 0.25);
    text-decoration: none;
    font-size: 0.8rem;
    position: relative;
}
.version-badge .dot { width: 6px; height: 6px; background: #34d399; border-radius: 50%; display:inline-block; }
.version-badge .label { opacity: .85; font-weight: 500; }
.version-badge .chev { opacity: .7; font-size: .9em; }
.version-badge:hover { background: rgba(17,24,39,0.4); border-color: rgba(255,255,255,0.45); }
.version-badge .version-tooltip { display:none; position:absolute; bottom: calc(100% + 6px); right:0; background:#111827; color:#fff; padding:6px 8px; border-radius:6px; font-size:.75rem; white-space:nowrap; opacity:.9; }
.version-badge:hover .version-tooltip { display:block; }

/* Header App Menu */
.app-menu { position: relative; display: inline-block; }
.menu-trigger {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0.5rem 0.75rem; border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px; color: #fff; background: rgba(94, 65, 222, 0.4);
    text-decoration: none; cursor: pointer; transition: all .2s ease;
}
.menu-trigger:hover { background: rgba(94,65,222,0.7); border-color: rgba(255,255,255,0.5); }
.menu-trigger .burger { width: 18px; height: 2px; background: #fff; position: relative; border-radius: 2px; }
.menu-trigger .burger::before, .menu-trigger .burger::after { content:""; position:absolute; left:0; right:0; height:2px; background:#fff; border-radius:2px; }
.menu-trigger .burger::before { top: -6px; }
.menu-trigger .burger::after { top: 6px; }

.menu-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 260px; z-index: 1500;
    background: linear-gradient(139deg, rgba(36, 40, 50, 1) 0%, rgba(37, 28, 40, 1) 100%);
    border-radius: 10px; padding: 12px 0; box-shadow: 0 8px 22px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08); display: none;
}
.menu-panel.active { display: block; }
.menu-section { padding: 6px 10px; }
.menu-sep { border-top: 1.5px solid #42434a; margin: 6px 0; }
.menu-list { list-style: none; margin: 0; padding: 0 8px; display: flex; flex-direction: column; gap: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; color: #cbd5e1; padding: 6px 8px; border-radius: 6px; cursor: pointer; transition: all .2s ease; text-decoration: none; }
.menu-item:hover { background: #5353ff; color: #fff; transform: translate(1px, -1px); }
.menu-item.danger:hover { background: #8e2a2a; }
.menu-item svg { width: 18px; height: 18px; stroke: currentColor; }
.menu-caption { color: #94a3b8; font-size: .75rem; padding: 0 14px 6px; text-transform: uppercase; letter-spacing: .03em; }

/* Modal overlay */
.modal-open { overflow: hidden; }
.modal-overlay[aria-hidden="true"] { display: none; }
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
}
.modal {
    background: #fff;
    width: min(720px, 95vw);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    position: relative;
    border: 1px solid #e5e7eb;
    color: #111827; /* Zorg dat tekst in modal donker is, niet geërfd wit uit header */
}
.modal-header { padding: 1.25rem 1.5rem 0.75rem; border-bottom: 1px solid #f1f5f9; display:flex; align-items:center; gap: .75rem; }
.modal-header h2 { margin: 0; font-size: 1.25rem; color: #1f2937; }
.version-chip { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; padding: .25rem .5rem; border-radius: 999px; font-weight: 600; font-size: .8rem; }
.modal-body { padding: 1rem 1.5rem 1.25rem; max-height: min(70vh, 680px); overflow: auto; }
.modal-close { position: absolute; top: 10px; right: 10px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; width: 36px; height: 36px; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.modal-close:hover { background: #f3f4f6; }
.modal-close .X, .modal-close .Y { position:absolute; width:18px; height:2px; background:#374151; border-radius: 2px; }
.modal-close .X { transform: rotate(45deg); }
.modal-close .Y { transform: rotate(-45deg); }

.changelog .release { padding: 1rem 0; }
.release-header { display:flex; align-items:center; justify-content: space-between; margin-bottom:.5rem; }
.release-header h3 { margin: 0; font-size: 1.1rem; color:#111827; }
.release-date { font-size: .85rem; color: #6b7280; }
.release-notes { margin: .25rem 0 0 1rem; }
.release-notes li { margin: .35rem 0; }

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.card-header-with-close {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    position: relative;
}

.card-header-with-close h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

/* Product QR Code Display */
.product-qr-container {
    position: static;
    top: auto;
    right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: auto;
}

.product-qr-code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.product-qr-label {
    display: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    height: auto;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Top row layout voor desktop */
.top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 50px; /* Meer ruimte naar het volgende blok */
    align-items: stretch; /* Zorgt voor gelijke hoogte */
}

/* Scanner sectie */
.scanner-section {
    width: 100%;
}

.scanner-section .card {
    height: 100%; /* Vult de volledige hoogte */
    display: flex;
    flex-direction: column;
}

/* Search sectie */
.search-section {
    width: 100%;
}

.search-section .card {
    height: 100%; /* Vult de volledige hoogte */
    display: flex;
    flex-direction: column;
    padding: 1.5rem; /* Minder padding voor search card */
}

.search-container {
    margin-bottom: 10px;
}

.search-container .form-group {
    margin-bottom: 0.75rem; /* Minder ruimte voor search form group */
}

.search-buttons {
    margin-top: 10px;
    text-align: right;
}

.search-results {
    flex: 1; /* Vult de resterende ruimte in de flex container */
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 10px;
    margin-bottom: 0; /* Verwijder extra margin onder zoekresultaten */
}

.search-results:empty::before {
    content: "Voer een zoekterm in om producten te vinden...";
    color: #6c757d;
    font-style: italic;
}

.search-result-item {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: #f0f4f8;
    border-color: #667eea;
    transform: translateY(-1px);
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-result-item .product-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.search-result-item .product-info {
    font-size: 0.9em;
    color: #666;
}

/* Responsive voor mobiel */
@media (max-width: 768px) {
    .top-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Producten overzicht header - betere mobiele weergave */
    .products-overview .card > div[style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .products-overview .card > div[style*="justify-content: space-between"] > div {
        align-self: flex-end;
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .products-overview .card h2 {
        margin-bottom: 0 !important;
    }
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    color: #212529;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Login Page Specifiek */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-box h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

/* Logo styling voor login pagina */
.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.logo-login {
    height: 100px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.subtitle {
    color: #6c757d;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.login-footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.btn-login {
    width: 100%;
    margin-top: 1rem;
}

/* Product Details */
.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.close-button {
    position: relative;
    width: 4em;
    height: 4em;
    border: none;
    background: rgba(180, 83, 107, 0.3);
    border-radius: 5px;
    transition: background 0.5s;
    cursor: pointer;
}

.close-button .X {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2em;
    height: 1.5px;
    background-color: rgb(255, 255, 255);
    transform: translateX(-50%) rotate(45deg);
}

.close-button .Y {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2em;
    height: 1.5px;
    background-color: #fff;
    transform: translateX(-50%) rotate(-45deg);
}

.close-button .close {
    position: absolute;
    display: flex;
    padding: 0.8rem 1.5rem;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
    top: -70%;
    left: 50%;
    width: 3em;
    height: 1.7em;
    font-size: 12px;
    background-color: rgb(19, 22, 24);
    color: rgb(187, 229, 236);
    border: none;
    border-radius: 3px;
    pointer-events: none;
    opacity: 0;
}

.close-button:hover {
    background-color: rgb(211, 21, 21);
}

.close-button:active {
    background-color: rgb(130, 0, 0);
}

.close-button:hover > .close {
    animation: close 0.2s forwards 0.25s;
}

@keyframes close {
    100% {
        opacity: 1;
    }
}

.product-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

/* Zorg dat de producttitel niet achter de QR code komt */
.product-info h2, .product-info .product-title {
    max-width: calc(100% - 100px); /* ruimte voor QR code (80px + marge) */
    word-break: break-word;
    white-space: normal;
    display: block;
}

.product-url-section {
    margin-top: 1rem;
}

.product-url-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.url-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.product-url-input {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.product-url-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.url-visit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stock-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.stock-controls .btn-sm {
    padding: 0.75rem 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
    min-width: 40px;
    height: 50px; /* Zelfde hoogte als het invoerveld */
    display: flex;
    align-items: center;
    justify-content: center;
}

.stock-section h4 {
    text-align: center;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.stock-input {
    width: 80px;
    text-align: center;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.stock-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Verberg spinner controls bij number inputs */
.stock-input::-webkit-outer-spin-button,
.stock-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stock-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Reststukken */
.reststukken-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e1e8ed; /* Subtiele scheidingslijn */
}

.reststukken-section h4 {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.reststukken-section h5 {
    text-align: center;
    font-size: 1.3rem; /* Zelfde grootte als h4 */
    margin-top: 2rem; /* Meer ruimte boven de titel */
    margin-bottom: 1rem;
    color: #2c3e50;
}

.reststuk-item {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reststuk-info {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.reststuk-dimensions {
    font-weight: bold;
    color: #2c3e50;
}

.reststuk-attributes {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.reststuk-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-container input[type="checkbox"] {
    transform: scale(1.2);
}

/* Custom checkbox styling van uiverse.io */
.checkBox {
    display: block;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0px 0px 0px 2px #667eea;
}

.checkBox div {
    width: 60px;
    height: 60px;
    background-color: #667eea;
    top: -52px;
    left: -52px;
    position: absolute;
    transform: rotateZ(45deg);
    z-index: 100;
}

.checkBox input[type=checkbox]:checked + div {
    left: -10px;
    top: -10px;
}

.checkBox input[type=checkbox] {
    position: absolute;
    left: 50px;
    visibility: hidden;
}

.transition {
    transition: 300ms ease;
}

/* Aangepaste checkbox container voor custom checkboxes */
.checkbox-container.custom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-container.custom .checkBox {
    margin: 0;
}

/* Disabled checkbox styling */
.checkBox.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: 0px 0px 0px 2px #ccc;
}

.checkBox.disabled div {
    background-color: #ccc;
}

.checkbox-container.custom label.disabled {
    color: #999;
    cursor: not-allowed;
}

/* Lijmfilm highlight - oranje accenten voor zichtbaarheid */
.checkbox-container.custom.lijmfilm-highlight label.lijmfilm-text {
    color: #b45309; /* oranje-bruin tekst */
}
.checkBox.disabled.lijmfilm { box-shadow: 0px 0px 0px 2px #f59e0b; }
.checkBox.disabled.lijmfilm div { background-color: #f59e0b; }
.checkbox-container.custom.lijmfilm-highlight { opacity: 1 !important; }
.reststuk-ordernummer { color:#374151; font-size:.85rem; }

/* Custom Add Button Styling van uiverse.io met afgeronde hoeken */
.button {
    position: relative;
    width: 150px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border: 1px solid #34974d;
    background-color: #3aa856;
    border-radius: 8px; /* Afgeronde hoeken */
    overflow: hidden; /* Zorgt dat de inner elementen binnen de ronde hoeken blijven */
}

.button, .button__icon, .button__text {
    transition: all 0.3s;
}

.button .button__text {
    transform: translateX(20px);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.button .button__icon {
    position: absolute;
    transform: translateX(109px);
    height: 100%;
    width: 39px;
    background-color: #34974d;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 8px 8px 0; /* Afgeronde hoeken rechts */
}

.button .svg {
    width: 24px;
    stroke: #fff;
}

.button:hover {
    background: #34974d;
}

.button:hover .button__text {
    color: transparent;
}

.button:hover .button__icon {
    width: 148px;
    transform: translateX(0);
    border-radius: 8px; /* Volledige afgeronde hoeken bij hover */
}

.button:active .button__icon {
    background-color: #2e8644;
}

.button:active {
    border: 1px solid #2e8644;
}

/* Custom Delete Button Styling van uiverse.io */
.bin-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background-color: rgb(255, 95, 95);
    cursor: pointer;
    border: 2px solid rgb(255, 201, 201);
    transition-duration: 0.3s;
}

/* Custom Label Print Button Styling */
.label-print-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background-color: #4CAF50;
    cursor: pointer;
    border: 2px solid #45a049;
    transition-duration: 0.3s;
    color: white;
    font-size: 16px;
    text-decoration: none;
}

.label-print-btn:hover {
    background-color: #45a049;
    border-color: #3d8b40;
    transform: scale(1.05);
}

.label-print-btn:active {
    transform: scale(0.95);
}

.bin-bottom {
    width: 13px;
}

.bin-top {
    width: 15px;
    transform-origin: right;
    transition-duration: 0.3s;
}

.bin-button:hover .bin-top {
    transform: rotate(45deg);
}

.bin-button:hover {
    background-color: rgb(255, 0, 0);
}

.bin-button:active {
    transform: scale(0.9);
}

/* Reststuk formulier uitlijning */
.add-reststuk-form .form-group {
    margin-bottom: 0; /* Verwijder standaard margin */
}

.add-reststuk-form .form-group label {
    margin-bottom: 0.5rem; /* Behoud label spacing */
    display: block;
}

.add-reststuk-form .form-group input {
    width: 170px; /* Iets bredere invoervelden */
}

.add-reststuk-form .checkbox-container {
    align-self: end; /* Uitlijning met de onderkant van de invoervelden */
    margin-bottom: 0.5rem; /* Compensatie voor label hoogte */
}

/* QR Scanner */
#qr-reader {
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

#scanner-controls {
    text-align: center;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1; /* Vult de resterende ruimte in de flex container */
}

/* Custom Scanner Button Styling */
.btn-scanner {
    position: relative;
    height: 50px;
    padding: 0 30px;
    border: 2px solid #667eea;
    background: #ffffff;
    user-select: none;
    white-space: nowrap;
    transition: all .05s linear;
    font-family: inherit;
    margin: 0 10px;
    border-radius: 4px;
}

.btn-scanner:before, .btn-scanner:after {
    content: "";
    position: absolute;
    background: #ffffff;
    transition: all .2s linear;
}

.btn-scanner:before {
    width: calc(100% + 6px);
    height: calc(100% - 16px);
    top: 8px;
    left: -3px;
}

.btn-scanner:after {
    width: calc(100% - 16px);
    height: calc(100% + 6px);
    top: -3px;
    left: 8px;
}

.btn-scanner:hover {
    cursor: crosshair;
    border-color: #764ba2;
}

.btn-scanner:active {
    transform: scale(0.95);
}

.btn-scanner:hover:before {
    height: calc(100% - 32px);
    top: 16px;
}

.btn-scanner:hover:after {
    width: calc(100% - 32px);
    left: 16px;
}

.btn-scanner span {
    font-size: 15px;
    z-index: 3;
    position: relative;
    font-weight: 600;
    color: #2c3e50;
}

/* Stop scanner button variant */
#stop-scanner {
    border-color: #dc3545;
}

#stop-scanner:hover {
    border-color: #c82333;
}

#stop-scanner span {
    color: #dc3545;
}

/* Producten overzicht */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.product-card {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.product-meta {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.stock-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.stock-in {
    background: #d4edda;
    color: #155724;
}

.stock-low {
    background: #fff3cd;
    color: #856404;
}

.stock-out {
    background: #f8d7da;
    color: #721c24;
}

/* Voorraad Product Readonly in overzicht */
.voorraad-product-readonly {
    margin-top: 0.5rem;
}

.voorraad-product-readonly .checkbox-container.disabled {
    opacity: 0.7;
    pointer-events: none;
}

.voorraad-product-readonly .checkbox-container.disabled label.disabled {
    color: #6c757d;
    cursor: default;
    font-size: 0.85rem;
}

.voorraad-product-readonly .checkbox-container.disabled .checkBox.disabled {
    cursor: default;
}

.voorraad-product-readonly .checkbox-container.disabled .checkBox.disabled input {
    cursor: default;
}

/* Voorraad Product Section Styling */
.voorraad-product-section {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.voorraad-product-section .checkbox-container {
    margin-bottom: 0;
}

/* Loading Overlay and Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
}

/* Uiverse.io Loader Animation */
@keyframes square-animation {
    0% {
        left: 0;
        top: 0;
    }
    10.5% {
        left: 0;
        top: 0;
    }
    12.5% {
        left: 32px;
        top: 0;
    }
    23% {
        left: 32px;
        top: 0;
    }
    25% {
        left: 64px;
        top: 0;
    }
    35.5% {
        left: 64px;
        top: 0;
    }
    37.5% {
        left: 64px;
        top: 32px;
    }
    48% {
        left: 64px;
        top: 32px;
    }
    50% {
        left: 32px;
        top: 32px;
    }
    60.5% {
        left: 32px;
        top: 32px;
    }
    62.5% {
        left: 32px;
        top: 64px;
    }
    73% {
        left: 32px;
        top: 64px;
    }
    75% {
        left: 0;
        top: 64px;
    }
    85.5% {
        left: 0;
        top: 64px;
    }
    87.5% {
        left: 0;
        top: 32px;
    }
    98% {
        left: 0;
        top: 32px;
    }
    100% {
        left: 0;
        top: 0;
    }
}

.loader {
    position: relative;
    width: 96px;
    height: 96px;
    transform: rotate(45deg);
}

.loader-square {
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    margin: 2px;
    border-radius: 0px;
    background: white;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    animation: square-animation 10s ease-in-out infinite both;
}

.loader-square:nth-of-type(1) {
    animation-delay: -1.4285714286s;
}

.loader-square:nth-of-type(2) {
    animation-delay: -2.8571428571s;
}

.loader-square:nth-of-type(3) {
    animation-delay: -4.2857142857s;
}

.loader-square:nth-of-type(4) {
    animation-delay: -5.7142857143s;
}

.loader-square:nth-of-type(5) {
    animation-delay: -7.1428571429s;
}

.loader-square:nth-of-type(6) {
    animation-delay: -8.5714285714s;
}

.loader-square:nth-of-type(7) {
    animation-delay: -10s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .top-bar {
        padding: 2.5rem 0 1rem 0; /* Meer ruimte bovenaan op mobiel */
    }
    
    .top-bar .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logo-container {
        justify-content: center;
        margin-top: 1rem; /* Extra ruimte boven logo */
    }
    
    /* Mobile header navigation grid */
    .user-info {
        display: grid !important;
    
    /* Mobile QR code positioning: keep in flex row, not absolute */
    .product-qr-container {
        position: static !important;
        top: auto !important;
        right: auto !important;
        margin-left: 0.5rem;
        margin-top: 0;
        align-items: flex-end;
    }
    
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        width: 100%;
        text-align: left;
    }
    
    .user-info > span {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        font-size: 0.9rem;
    }
    
    .user-info > .header-button[href="low_stock.php"],
    .user-info > .header-button[href="index.php"] {
        grid-column: 1;
        grid-row: 2;
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        justify-self: start;
    }
    
    .user-info > .header-button.danger {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .user-info > .dropdown {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
    }
    
    .user-info > .dropdown .header-button {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        white-space: nowrap;
    }
    
    .logo {
        height: 60px;
        max-width: 250px;
    }
    
    .logo-login {
        height: 80px;
        max-width: 250px;
    }
    
    /* Verberg printknop op mobiel */
    .user-info a[href="print_settings.php"] {
        display: none;
    }
    
    /* Dropdown mobile styling */
    .dropdown-menu {
        right: 0;
        min-width: 120px;
    }
    
    .dropdown-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Reststuk label print functionaliteit - mobiel gedrag */
    .add-reststuk-form .auto-print-section {
        display: none; /* Verberg auto-print opties op mobiel */
    }
    
    .reststuk-actions .label-print-btn {
        display: none; /* Verberg individuele label print knoppen op mobiel */
    }
    
    .card {
        margin: 1rem 0;
        padding: 1.5rem;
    }
    
    .product-details {
        grid-template-columns: 1fr;
    }
    
    .card-header-with-close {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2rem;
    }
    
    .card-header-with-close h2 {
        position: static;
        transform: none;
        left: auto;
        margin: 0;
        flex: 1;
        text-align: left;
    }
    
    .card-header-with-close .close-button {
        margin: 0;
    }
    
    /* Mobile QR code positioning: use flex/static, not absolute */
    /* .product-qr-container { position: static !important; ... } is already set above */
    
    .product-qr-code {
        padding: 0;
    }
    
    .product-qr-label {
        display: none;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .reststuk-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .reststuk-info {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .reststuk-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Scanner buttons responsive */
    .btn-scanner {
        margin: 5px;
        padding: 0 20px;
        height: 45px;
    }
    
    .btn-scanner span {
        font-size: 14px;
    }
    
    /* Reststuk formulier responsive - elementen onder elkaar op mobiel */
    .add-reststuk-form div[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        align-items: stretch !important;
    }
    
    .add-reststuk-form .form-group input {
        width: 100% !important;
    }
    
    .add-reststuk-form .checkbox-container {
        align-self: stretch !important;
        margin-bottom: 0 !important;
        margin-top: 0.5rem !important;
        justify-content: flex-start;
    }
    
    .add-reststuk-form .button {
        width: 150px !important;
        align-self: center !important;
        margin-top: 0.5rem !important;
    }
    
    /* URL input group responsive - knop onder invoerveld op mobiel */
    .url-input-group {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    .url-visit-btn {
        display: none !important; /* Verberg product pagina link knop op mobiel */
    }
    
    /* Low Stock Dashboard responsive */
    .card-header-with-refresh {
        flex-wrap: wrap !important;
        gap: 1rem;
    }
    
    .card-header-with-refresh h2 {
        margin-bottom: 0 !important;
        flex: 1 1 100%;
    }
    
    .dashboard-controls {
        align-self: flex-end;
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .dashboard-summary {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .low-stock-table-container {
        overflow-x: auto;
    }
    
    .low-stock-table {
        font-size: 0.85rem;
    }
    
    /* Mobile: hide all columns except name and stock */
    .low-stock-table th:not(.product-name):not(.product-stock),
    .low-stock-table td:not(.product-name):not(.product-stock) {
        display: none;
    }
    
    .low-stock-table th,
    .low-stock-table td {
        padding: 0.75rem 0.5rem !important;
    }
    
    .product-name {
        width: 70% !important;
        min-width: auto !important;
    }
    
    .product-stock {
        width: 30% !important;
        text-align: center !important;
    }
    
    /* Make table rows clickable on mobile */
    .low-stock-table tbody tr {
        cursor: pointer;
        transition: background-color 0.2s ease;
    }
    
    .low-stock-table tbody tr:hover {
        background: #e9ecef !important;
    }
    
    .low-stock-table tbody tr:active {
        background: #dee2e6 !important;
    }
    
    .product-actions .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Low Stock Dashboard Styling */
.low-stock-dashboard .card {
    margin-top: 2rem;
}

.card-header-with-refresh {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: nowrap;
}

.card-header-with-refresh h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.dashboard-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.last-refresh {
    font-size: 0.9rem;
    color: #6c757d;
}

.dashboard-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Low Stock Table */
.low-stock-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.low-stock-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.low-stock-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
}

.low-stock-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.low-stock-table tbody tr:hover {
    background: #f8f9fa;
}

.low-stock-table tbody tr:last-child td {
    border-bottom: none;
}

/* Product row styling based on stock level */
.product-row.stock-out {
    background: rgba(248, 215, 218, 0.3);
}

.product-row.stock-low {
    background: rgba(255, 243, 205, 0.3);
}

.product-name strong {
    color: #2c3e50;
    font-weight: 600;
}

.product-supplier {
    color: #6c757d;
}

.product-stock .stock-badge {
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
}

.product-voorraad-type .checkbox-container.disabled {
    opacity: 0.7;
    font-size: 0.85rem;
}

.product-updated .text-muted {
    font-size: 0.8rem;
    color: #6c757d;
}

/* States for low stock list */
.no-low-stock,
.loading-state,
.error-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.no-low-stock h3 {
    color: #28a745;
    margin-bottom: 1rem;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loader-small {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-state h3 {
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-state button {
    margin-top: 1rem;
}

/* Alert styling */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
    border: 1px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f1aeb5;
}

/* Form styling voor password change pagina */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: white;
}

.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Button variations */
.btn-danger {
    background-color: #dc3545;
    color: white;
    border: 2px solid #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Table responsive styling */
.users-table {
    overflow-x: auto;
}

@media (max-width: 768px) {
    .users-table table {
        font-size: 0.9rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.5rem !important;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}
