* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

body {
    background-color: #0f172a;
    color: #f8fafc;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
header {
    background-color: #1e293b;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-nav-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: none;
}

h1 {
    font-size: 18px;
    font-weight: 600;
    color: #f1f5f9;
}

/* Side Menu (Drawer) */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 300;
    display: none;
    backdrop-filter: blur(2px);
}

.drawer-overlay.active { display: block; }

.side-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: #1e293b;
    border-right: 1px solid #334155;
    z-index: 301;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0,0,0,0.5);
    overflow-y: auto;
}

.side-drawer.open { left: 0; }

.drawer-header {
    padding: 20px;
    background: #0f172a;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h2 { font-size: 18px; color: #f8fafc; }

.close-drawer-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
}

/* Accordion Menu */
.drawer-accordion {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    gap: 8px;
}

.accordion-header {
    padding: 14px 16px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f8fafc;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header:hover { background: #1e293b; border-color: #475569; }

.accordion-icon {
    font-size: 12px;
    color: #94a3b8;
    transition: transform 0.2s;
}

.accordion-header.active .accordion-icon { transform: rotate(180deg); }

.accordion-content {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding-left: 10px;
    margin-top: 4px;
    margin-bottom: 6px;
}

.accordion-content.open { display: flex; }

.drawer-item {
    padding: 10px 14px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #cbd5e1;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-item:hover {
    background: #3b82f6;
    border-color: #60a5fa;
    color: #fff;
}

/* Main Container */
.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Tables View */
.tables-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.area-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #334155;
    padding-bottom: 10px;
    align-items: center;
    overflow-x: auto;
}

.btn-menu-toggle {
    padding: 12px 16px;
    font-size: 18px;
    background: #334155;
    border: 1px solid #475569;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.area-tab-btn {
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.area-tab-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
}

.area-content { display: none; }
.area-content.active { display: block; }

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;
}

.table-btn {
    aspect-ratio: 1;
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px;
    text-align: center;
}

.table-btn.status-open { background: #15803d; border-color: #22c55e; }
.table-btn.status-printed { background: #b91c1c; border-color: #ef4444; }
.table-btn .table-status { font-size: 11px; font-weight: 500; opacity: 0.9; }

/* POS View */
.pos-section {
    flex: 1;
    display: none;
    flex-direction: row;
    height: 100%;
}

.pos-section.active { display: flex; }

.menu-area {
    flex: 1.2;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #0f172a;
    border-right: 1px solid #334155;
    overflow-y: auto;
}

.order-area {
    flex: 0.8;
    background: #1e293b;
    display: flex;
    flex-direction: column;
}

/* Time Adjuster Bar */
.time-adjuster-bar {
    background: #0f172a;
    border-bottom: 1px solid #334155;
    padding: 10px 15px;
    display: none;
    flex-direction: column;
    gap: 8px;
}

.time-adjuster-bar.active { display: flex; }

.time-display-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.time-target-text {
    font-size: 15px;
    font-weight: 700;
    color: #38bdf8;
}

.time-buttons-row { display: flex; gap: 6px; flex-wrap: wrap; }

.time-btn {
    flex: 1;
    padding: 8px 4px;
    font-weight: 700;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid #334155;
    cursor: pointer;
    background: #1e293b;
    color: #f1f5f9;
    white-space: nowrap;
    text-align: center;
}

.time-btn.plus { background: #166534; border-color: #22c55e; color: #fff; }
.time-btn.min { background: #991b1b; border-color: #ef4444; color: #fff; }
.time-btn.custom { background: #0284c7; border-color: #38bdf8; color: #fff; flex: 1.3; }
.time-btn.reset { background: #334155; border-color: #64748b; color: #cbd5e1; flex: 1; }

/* POS Menu Items */
.main-cat-selector { display: flex; gap: 12px; }

.main-cat-btn {
    flex: 1;
    padding: 14px;
    font-size: 17px;
    font-weight: 700;
    border: 2px solid #334155;
    background: #1e293b;
    border-radius: 10px;
    cursor: pointer;
    color: #cbd5e1;
}

.main-cat-btn.active { background: #2563eb; color: #ffffff; border-color: #3b82f6; }

.sub-cat-selector { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; }

.sub-cat-btn {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #334155;
    background: #1e293b;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    color: #94a3b8;
}

.sub-cat-btn.active { background: #f8fafc; color: #0f172a; border-color: #f8fafc; }

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    align-content: start;
    flex: 1;
}

.item-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 95px;
    cursor: pointer;
}

.item-card:hover { border-color: #3b82f6; background: #334155; }
.item-card.sold-out { opacity: 0.5; border-color: #ef4444; background: #0f172a; }
.item-card.sold-out:hover { border-color: #ef4444; background: #0f172a; }
.item-title { font-size: 14px; font-weight: 600; color: #f8fafc; }
.item-has-addons { font-size: 11px; color: #38bdf8; margin-top: 4px; font-weight: 600; }
.item-sold-out-tag { font-size: 11px; color: #f87171; margin-top: 4px; font-weight: 700; }
.item-price { font-size: 13px; font-weight: 700; color: #34d399; margin-top: 6px; }

/* Order Side */
.order-header {
    padding: 18px 20px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-gangenscheider {
    padding: 8px 12px;
    background: #334155;
    border: 1px dashed #64748b;
    border-radius: 6px;
    color: #f1f5f9;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

.order-items-list { flex: 1; overflow-y: auto; padding: 15px 20px; }

.order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #334155;
}

.order-item-row.divider-row {
    background: #334155;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px dashed #64748b;
    margin: 10px 0;
    font-weight: bold;
    color: #f1f5f9;
    font-size: 13px;
}

.order-item-info { display: flex; flex-direction: column; gap: 2px; }
.order-item-name { font-size: 14px; font-weight: 600; color: #f8fafc; }
.order-addon-line { font-size: 12px; margin-left: 8px; display: flex; gap: 6px; }
.order-addon-line.plus { color: #4ade80; }
.order-addon-line.min { color: #f87171; }
.order-note-line { font-size: 12px; margin-left: 8px; color: #fde047; font-style: italic; }
.order-item-price { font-size: 12px; color: #94a3b8; }

.order-item-controls { display: flex; align-items: center; gap: 8px; }

.btn-item-note {
    background: #334155;
    border: 1px solid #475569;
    color: #f1f5f9;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}
.btn-item-note:hover { background: #475569; }

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #475569;
    background: #334155;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.order-summary {
    padding: 20px;
    background: #0f172a;
    border-top: 1px solid #334155;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #f8fafc;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-action {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-print-bill { background: #0284c7; color: white; }
.btn-send-kitchen { background: #d97706; color: white; }
.btn-pay { background: #059669; color: white; }
.btn-clear-table { background: #dc2626; color: white; }

/* Payment Modal Specifics */
.payment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

.payment-option-btn {
    padding: 18px 12px;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 10px;
    color: #f8fafc;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.payment-option-btn:hover {
    border-color: #38bdf8;
    background: #1e293b;
    transform: translateY(-2px);
}

.payment-option-btn .pay-icon { font-size: 26px; }

/* Modals Generic */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 400;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active { display: flex; }

.modal-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-card.wide { max-width: 850px; }

.modal-title { font-size: 18px; font-weight: 700; color: #f8fafc; margin-bottom: 4px; }
.modal-subtitle { font-size: 13px; color: #94a3b8; margin-bottom: 15px; }

.modal-actions { display: flex; gap: 10px; margin-top: 15px; }
.btn-modal-cancel { flex: 1; background: #334155; color: white; border: none; padding: 12px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.btn-modal-save { flex: 1.5; background: #2563eb; color: white; border: none; padding: 12px; border-radius: 8px; font-weight: 700; cursor: pointer; }

/* Form Inputs & Filters */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    background: #0f172a;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #334155;
    align-items: center;
}

.filter-btn {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #334155;
    background: #1e293b;
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
}

.filter-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.form-group label { font-size: 13px; font-weight: 600; color: #cbd5e1; }
.form-group input, .form-group select, .form-group textarea {
    padding: 10px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
}

.management-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    max-height: 250px;
    overflow-y: auto;
}

.management-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #334155;
    gap: 10px;
}

.management-item input, .management-item select {
    background: #1e293b;
    border: 1px solid #334155;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.btn-delete-row {
    background: #b91c1c;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

/* Addons modal buttons */
.addon-type-tabs { display: flex; gap: 10px; margin-bottom: 15px; }

.addon-type-btn {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    font-weight: 800;
    border-radius: 8px;
    border: 2px solid #334155;
    background: #0f172a;
    color: #94a3b8;
    cursor: pointer;
}

.addon-type-btn.plus-btn.active { background: #15803d; border-color: #22c55e; color: #ffffff; }
.addon-type-btn.min-btn.active { background: #b91c1c; border-color: #ef4444; color: #ffffff; }

.addons-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.addon-option {
    background: #0f172a;
    border: 1px solid #334155;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: #cbd5e1;
    font-weight: 500;
}

.addon-option.selected-plus { border-color: #22c55e; background: #14532d; color: #ffffff; }
.addon-option.selected-min { border-color: #ef4444; background: #7f1d1d; color: #ffffff; }

/* Menu mgmt tabs & table */
.mgmt-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #334155;
    padding-bottom: 10px;
}

.mgmt-tab-btn {
    padding: 8px 16px;
    background: #0f172a;
    border: 1px solid #334155;
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.mgmt-tab-btn.active {
    background: #2563eb;
    color: white;
    border-color: #3b82f6;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-custom th, .table-custom td {
    padding: 8px 10px;
    border-bottom: 1px solid #334155;
    text-align: left;
}

.table-custom th { color: #94a3b8; }

/* Rapport Preview Styling */
.report-preview-box {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    color: #38bdf8;
    margin: 15px 0;
    white-space: pre-wrap;
    max-height: 320px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.4;
}

@media print {
    /* Verberg alles op de pagina standaard */
    body * {
        visibility: hidden;
    }

    /* Maak de overlay en modal kaart expliciet zichtbaar zodat het rapport getoond wordt */
    .modal-overlay.active,
    .modal-overlay.active .modal-card {
        visibility: visible !important;
    }

    /* Maak de pagina zelf klaar voor A4 en wit */
    body {
        background: #ffffff !important;
        color: #000000 !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Maak het rapport-voorbeeld en de inhoud van de modal volledig zichtbaar op A4 */
    .modal-overlay.active {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        background: transparent !important;
        display: block !important;
    }

    .modal-card {
        background: #ffffff !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Verberg knoppen zoals 'Sluiten', 'Print op Bonprinter', 'Opslaan als PDF' en 'Export naar Excel' op de print/PDF */
    .modal-actions, 
    .modal-title, 
    .modal-subtitle,
    .filter-bar,
    .form-group {
        display: none !important;
    }

    /* Laat het rapport zelf zien in A4-stijl */
    .report-preview-box, #report-preview-container {
        visibility: visible !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-height: none !important;
        overflow: visible !important;
        background: #ffffff !important;
        color: #000000 !important;
        border: none !important;
        font-family: 'Courier New', Courier, monospace !important;
        font-size: 14px !important;
        line-height: 1.5 !important;
        box-shadow: none !important;
    }
}