/* ============================================================
   GPOS Voorraadbeheer – The Glitch Custom Stylesheet
   Kleurpallet: #CD1719 rood | #000000 zwart | #1a1a1a donker | #FFFFFF wit
   ============================================================ */

/* ── Google Font: Inter ──────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Variabelen ──────────────────────────────────────── */
:root {
    --tg-red:        #CD1719;
    --tg-red-dark:   #a81315;
    --tg-red-light:  #e81d1f;
    --tg-black:      #000000;
    --tg-dark:       #1a1a1a;
    --tg-dark2:      #2a2a2a;
    --tg-dark3:      #333333;
    --tg-mid:        #434343;
    --tg-light:      #f0f0f0;
    --tg-white:      #ffffff;
    --tg-border:     #3a3a3a;
}

/* ── Layout ──────────────────────────────────────────────── */

body {
    padding-top: 56px;
    background-color: var(--tg-dark);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    color: var(--tg-white);
}

.wrapper {
    min-height: calc(100vh - 56px);
}

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar {
    width: 250px;
    min-width: 250px;
    min-height: calc(100vh - 56px);
    background-color: var(--tg-dark);
    border-right: 1px solid var(--tg-border);
    color: var(--tg-white);
    position: sticky;
    top: 56px;
    align-self: flex-start;
    padding-top: 0.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 56px);
}

.sidebar .nav-link {
    color: #cccccc;
    padding: 0.6rem 1.25rem;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    background-color: var(--tg-dark2);
    color: var(--tg-white);
    border-left-color: var(--tg-red);
}

.sidebar .nav-link.active {
    background-color: rgba(205, 23, 25, 0.15);
    color: var(--tg-white);
    font-weight: 600;
    border-left: 3px solid var(--tg-red);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

/* Sidebar zoekbalk */
.sidebar .form-control {
    background-color: var(--tg-dark2);
    border-color: var(--tg-border);
    color: var(--tg-white);
    font-size: 0.85rem;
}

.sidebar .form-control::placeholder {
    color: #888;
}

.sidebar .form-control:focus {
    background-color: var(--tg-dark2);
    border-color: var(--tg-red);
    color: var(--tg-white);
    box-shadow: 0 0 0 0.2rem rgba(205, 23, 25, 0.25);
}

/* Sidebar sectie-headers */
.sidebar .nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
    padding: 0.75rem 1.25rem 0.25rem;
}

/* ── Navbar ──────────────────────────────────────────────── */

.navbar.bg-dark {
    background-color: var(--tg-black) !important;
    border-bottom: 2px solid var(--tg-red);
}

.navbar-brand {
    color: var(--tg-red) !important;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

.navbar-brand:hover {
    color: var(--tg-red-light) !important;
}

/* ── Main content ────────────────────────────────────────── */

.main-content {
    padding: 1.5rem;
    width: 100%;
}

/* ── Cards ───────────────────────────────────────────────── */

.card {
    background-color: var(--tg-white);
    border: none;
    color: var(--tg-dark3);
}

.card-header {
    background-color: var(--tg-black);
    color: var(--tg-white);
    border-bottom: 2px solid var(--tg-red);
    font-weight: 600;
}

.card-header.bg-dark,
.card-header.bg-secondary,
.card-header.bg-primary {
    background-color: var(--tg-black) !important;
    color: var(--tg-white) !important;
    border-bottom: 2px solid var(--tg-red);
}

/* ── Dashboard stat cards ────────────────────────────────── */

.stat-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
    background-color: var(--tg-white);
    color: var(--tg-dark3);
    border-left: 4px solid var(--tg-red);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(205, 23, 25, 0.2);
}

.stat-card .card-icon {
    font-size: 2.5rem;
    opacity: 0.75;
    color: var(--tg-red);
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn-primary {
    background-color: var(--tg-red) !important;
    border-color: var(--tg-red) !important;
    color: var(--tg-white) !important;
    font-weight: 500;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--tg-red-dark) !important;
    border-color: var(--tg-red-dark) !important;
    color: var(--tg-white) !important;
    box-shadow: 0 0 0 0.2rem rgba(205, 23, 25, 0.35) !important;
}

.btn-outline-primary {
    color: var(--tg-red) !important;
    border-color: var(--tg-red) !important;
}

.btn-outline-primary:hover {
    background-color: var(--tg-red) !important;
    color: var(--tg-white) !important;
}

.btn-outline-light:hover {
    color: var(--tg-dark3) !important;
}

/* ── Status colours ──────────────────────────────────────── */

.status-green { background-color: #d4edda !important; }
.status-yellow { background-color: #fff3cd !important; }
.status-red { background-color: #f8d7da !important; }

tr.status-green td { background-color: #d4edda; }
tr.status-yellow td { background-color: #fff3cd; }
tr.status-red td { background-color: #f8d7da; }

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.green  { background-color: #28a745; }
.status-dot.yellow { background-color: #ffc107; }
.status-dot.red    { background-color: #dc3545; }

/* ── Tables ──────────────────────────────────────────────── */

.table {
    color: var(--tg-dark3);
}

.table thead th {
    background-color: var(--tg-black) !important;
    color: var(--tg-white) !important;
    font-weight: 600;
    white-space: nowrap;
    border-color: var(--tg-border);
}

/* Bootstrap table-dark override */
.table-dark thead th,
.table.table-dark th {
    background-color: var(--tg-black) !important;
    color: var(--tg-white) !important;
}

.table-hover tbody tr:hover {
    background-color: rgba(205, 23, 25, 0.06) !important;
}

/* Tabel in kaarten — witte achtergrond */
.card .table {
    color: var(--tg-dark3);
    background-color: var(--tg-white);
}

.card .table tbody tr {
    background-color: var(--tg-white);
}

.card .table tbody tr:nth-child(even) {
    background-color: #f8f8f8;
}

/* ── Forms ───────────────────────────────────────────────── */

.form-card {
    background: var(--tg-white);
    border-radius: 0.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    padding: 1.75rem 2rem;
    color: var(--tg-dark3);
}

.form-label {
    font-weight: 500;
    color: var(--tg-dark3);
}

/* ── Nav tabs ────────────────────────────────────────────── */

.nav-tabs .nav-link {
    color: #aaa;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    padding: 0.5rem 1rem;
}

.nav-tabs .nav-link:hover {
    color: var(--tg-white);
    border-bottom-color: var(--tg-red);
}

.nav-tabs .nav-link.active {
    color: var(--tg-red);
    border-bottom: 2px solid var(--tg-red);
    background: none;
    font-weight: 600;
}

.nav-tabs {
    border-bottom: 1px solid var(--tg-border);
    margin-bottom: 1.5rem;
}

/* Tabs in kaarten (witte achtergrond) */
.card .nav-tabs .nav-link {
    color: #555;
}

.card .nav-tabs .nav-link:hover {
    color: var(--tg-red);
    border-bottom-color: var(--tg-red);
}

.card .nav-tabs .nav-link.active {
    color: var(--tg-red);
    border-bottom: 2px solid var(--tg-red);
}

/* ── Page titles & text ──────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    color: inherit;
}

/* Titels op donkere achtergrond (buiten kaarten) */
.main-content > h1,
.main-content > h2,
.main-content > .d-flex > h1,
.main-content > .d-flex > h2 {
    color: var(--tg-white);
}

/* Breadcrumbs */
.breadcrumb-item a {
    color: var(--tg-red);
}

.breadcrumb-item.active {
    color: #aaa;
}

/* ── Badges ──────────────────────────────────────────────── */

.badge.bg-primary {
    background-color: var(--tg-red) !important;
}

.badge.bg-dark {
    background-color: var(--tg-dark3) !important;
}

/* ── Alerts ──────────────────────────────────────────────── */

.alert-info {
    background-color: rgba(205, 23, 25, 0.1);
    border-color: var(--tg-red);
    color: var(--tg-red);
}

/* ── Progress bars ───────────────────────────────────────── */

.progress {
    background-color: #e0e0e0;
    border-radius: 4px;
}

.progress-bar.bg-success {
    background-color: var(--tg-red) !important;
}

/* ── Product property form ───────────────────────────────── */

.property-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.property-row:last-child {
    border-bottom: none;
}

.property-label {
    width: 200px;
    font-weight: 500;
    flex-shrink: 0;
    color: var(--tg-mid);
}

.property-value {
    flex: 1;
}

.property-add-btn {
    display: none;
}

/* ── Flash messages ──────────────────────────────────────── */

.flash-message {
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Login pagina ────────────────────────────────────────── */

body.login-page {
    background-color: var(--tg-dark) !important;
}

.login-card .card {
    background-color: var(--tg-white);
    border-top: 3px solid var(--tg-red);
}

.login-logo {
    color: var(--tg-red);
    font-size: 2rem;
    font-weight: 700;
}

/* ── Sorteer-iconen in tabelkoppen ───────────────────────── */

th[data-sort] {
    cursor: pointer;
    user-select: none;
}

th[data-sort]:hover {
    background-color: var(--tg-dark3) !important;
}

th[data-sort] .sort-icon {
    opacity: 0.5;
    font-size: 0.75rem;
    margin-left: 4px;
}

th[data-sort].sorted-asc .sort-icon,
th[data-sort].sorted-desc .sort-icon {
    opacity: 1;
    color: var(--tg-red);
}

/* ── Zwevende actiebalk (duplicaten) ─────────────────────── */

#floatingActionBar {
    background-color: var(--tg-black);
    border-top: 2px solid var(--tg-red);
    color: var(--tg-white);
}

/* ── Modals ──────────────────────────────────────────────── */

.modal-header {
    background-color: var(--tg-black);
    color: var(--tg-white);
    border-bottom: 2px solid var(--tg-red);
}

.modal-header .btn-close {
    filter: invert(1);
}

/* ── Scrollbar (webkit) ──────────────────────────────────── */

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--tg-dark);
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--tg-border);
    border-radius: 4px;
}

/* ── Responsive: collapse sidebar on small screens ──────── */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -250px;
        z-index: 1040;
        height: calc(100vh - 56px);
        transition: left 0.25s ease;
    }

    .sidebar.show {
        left: 0;
    }

    .main-content {
        padding: 1rem;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1039;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* ── Utility ─────────────────────────────────────────────── */

.cursor-pointer { cursor: pointer; }

.text-truncate-150 {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* ── Accent kleur helpers ────────────────────────────────── */

.text-tg-red { color: var(--tg-red) !important; }
.bg-tg-red   { background-color: var(--tg-red) !important; }
.border-tg-red { border-color: var(--tg-red) !important; }
