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

a {
    text-decoration: none;
    color: inherit;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #0b1120;
    color: #e5e7eb;
}

/* =========================
   LAYOUT
========================= */
.layout {
    display: flex;
}

/* =========================
   SIDEBAR
========================= */
.sidebar {
    width: 230px;
    background: #020617;
    padding: 20px;

    min-height: 100vh;
    border-right: 1px solid rgba(255,255,255,0.05);

    display: flex;
    flex-direction: column;

    position: sticky;
    top: 0;
    align-self: flex-start;
}

.sidebar h2 {
    margin-bottom: 25px;
    font-size: 18px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 6px;

    cursor: pointer;
    opacity: 0.7;
    transition: 0.2s;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    background: #1e293b;
    opacity: 1;
}

/* BOTTOM */
.sidebar-bottom {
    margin-top: auto;
}

.scan-action {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    background: #f97316;
    color: white;

    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;

    cursor: pointer;
    transition: 0.2s;
}

.scan-action:hover {
    opacity: 0.9;
}

/* =========================
   MAIN
========================= */
.main {
    flex: 1;
    padding: 30px;
	width: 100%;
}

h1 {
    font-size: 26px;
}

/* =========================
   TOPBAR (STICKY + GLASS)
========================= */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding-bottom: 15px;
    margin-bottom: 20px;

    backdrop-filter: blur(8px);
    background: rgba(11, 17, 32, 0.85);
}

/* subtiele lijn onder header */
.topbar::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;

    width: 100%;
    height: 1px;

    background: rgba(255,255,255,0.05);
}

/* linker blok */
.topbar > div:first-child {
    display: flex;
    flex-direction: column;
}

.subtitle {
    font-size: 16px;
    opacity: 0.8;
    margin-top: 2px;
}

/* =========================
   AUTH
========================= */
.auth {
    margin-left: auto;
}

.auth a {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: 0.2s;
}

.login-btn {
    background: #1e293b;
    color: white;
}

.logout-btn {
    background: #ef4444;
    color: white;
}

.auth a:hover {
    opacity: 0.9;
}

@media (max-width: 900px) {
	.auth {
		display: none;
	}
}

/* =========================
   STATS
========================= */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 16px;
    padding: 20px;
    position: relative;
}

.stat-card h2 {
    font-size: 28px;
}

.stat-card span {
    font-size: 13px;
    opacity: 0.7;
}

.stat-card p {
    font-size: 12px;
    opacity: 0.6;
}

.stat-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.06;
    width: 90px;
    height: 90px;
}

.stat-card.warning {
    background: linear-gradient(145deg, #3b0f0f, #1f0a0a);
}

/* =========================
   FILTER BAR
========================= */
.filters.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    background: #1e293b;
    border-radius: 14px;
    padding: 4px;
	width: fit-content;
}

@media (max-width: 900px) {
	.filters.tabs {
		overflow-x: scroll;
		width: auto;
	}
}


.filter {
    display: flex;
    align-items: center;
    gap: 6px;

    padding: 8px 16px;
    border-radius: 10px;

    background: transparent;
    border: none;
    color: white;

    cursor: pointer;
}

.filter.active {
    background: #0f172a;
}

/* =========================
   MATERIAL GROUPS
========================= */
.material-group {
    margin-bottom: 35px;
}

.material-title {
    font-size: 18px;
    font-weight: 600;

    display: inline-flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 15px;
    padding-bottom: 6px;

    border-bottom: 2px solid;
}

/* =========================
   GRID
========================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* =========================
   CARD
========================= */
.card {
    background: #1e293b;
    border-radius: 16px;
    padding: 18px;
    transition: 0.2s;
}

.card:hover {
    transform: translateY(-3px);
}

.card-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* COLOR */
.color-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.1);
}

/* MAIN */
.card-main {
    flex: 1;
}

/* TOP */
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.title {
    font-size: 16px;
    font-weight: 600;
}

.brand {
    font-size: 13px;
    opacity: 0.6;
}

/* ACTIONS */
.card-actions-horizontal {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* LOW STOCK */
.low-stock-label {
    display: flex;
    align-items: center;
    gap: 5px;

    background: #facc15;
    color: #000;

    padding: 4px 8px;
    border-radius: 8px;

    font-size: 11px;
    font-weight: 600;
}

.low-stock-label i svg {
    width: 12px;
    height: 12px;
    stroke: #000;
}

/* NO STOCK */
.no-stock-label {
    display: flex;
    align-items: center;
    gap: 5px;

    background: #ff3542;
    color: #000;

    padding: 4px 8px;
    border-radius: 8px;

    font-size: 11px;
    font-weight: 600;
}

.no-stock-label i svg {
    width: 12px;
    height: 12px;
    stroke: #000;
}

/* EDIT */
.edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    background: #334155;
    border: none;

    border-radius: 8px;
    padding: 6px;

    cursor: pointer;
    transition: 0.2s;
}

.edit-btn:hover {
    background: #475569;
}

.edit-btn i svg {
    width: 14px;
    height: 14px;
}

/* BOTTOM */
.card-bottom {
    display: flex;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.card-stats div {
    text-align: center;
}

.card-stats span {
    font-size: 11px;
    opacity: 0.6;
}

.card-stats strong {
    display: block;
    font-size: 16px;
}

/* =========================
   LOGIN PAGE
========================= */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: #1e293b;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.login-card h1 {
    margin-bottom: 5px;
}

.login-card .subtitle {
    margin-bottom: 20px;
    font-size: 14px;
    opacity: 0.7;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-card input {
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: #0f172a;
    color: white;
}

.login-card button {
    margin-top: 10px;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: #f97316;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.error {
    background: #7f1d1d;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* =========================
   MODAL
========================= */
.modal {
    display: none;

    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.6);

    align-items: center;
    justify-content: center;

    z-index: 200;
}

.modal-content {
    background: #1e293b;
    padding: 25px;
    border-radius: 16px;

    width: 90%;
    max-width: 400px;
}

/* FORM */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    opacity: 0.7;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: none;
    background: #0f172a;
    color: white;
}

/* NUMBER INPUT */
.number-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

.number-input input {
    text-align: center;
}

/* BUTTONS */
.number-input button {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
}

.number-input button:first-child {
    background: #ef4444;
    color: white;
}

.number-input button:last-child {
    background: #22c55e;
    color: white;
}

/* ACTIONS */
.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.cancel-btn {
    background: #334155;
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    color: white;
}

.save-btn {
    background: #f97316;
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    color: white;
}

/* =========================
   SCANNER
========================= */
.scan-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.toggle-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: #1e293b;
    color: white;
    cursor: pointer;
}

.toggle-btn.active {
    background: #f97316;
}

#reader {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
}

#scan-result {
    text-align: center;
    font-weight: 600;
}

/* =========================
   SCAN RESULT MOBILE FIX (FORCED)
========================= */
@media (max-width: 900px) {

    /* body */
    .login-page {
        display: flex !important;
        align-items: center;
        justify-content: center;
        height: auto;
        min-height: 100vh;
        padding: 20px;
    }

    /* 🔥 BELANGRIJK: container groter maken */
    .login-container {
        width: 100% !important;
        max-width: 500px !important; /* 👈 GROTER */
        padding: 0 !important;
    }

    /* card */
    .login-card {
        width: 100%;
        padding: 30px 25px;
        border-radius: 16px;
    }

    /* titel */
    .login-card h2 {
        font-size: 24px;
        text-align: center;
        margin-bottom: 12px;
    }

    /* tekst */
    .login-card p {
        font-size: 17px;
        text-align: center;
        margin-bottom: 25px;
    }

    /* knoppen */
    .login-card a {
        display: block;
        width: 100%;
    }

    .login-card button {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        border-radius: 12px;
    }

    .login-card a + a {
        margin-top: 12px;
    }

}

/* =========================
   MOBILE NAV
========================= */
.mobile-nav {
    display: none;

    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

    height: 70px;

    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(10px);

    border-top: 1px solid rgba(255,255,255,0.05);

    justify-content: space-around;
    align-items: center;

    z-index: 100;
}

/* ITEMS */
.mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;

    font-size: 8px;
    opacity: 0.7;
}

.mobile-nav .nav-item.active {
    opacity: 1;
}

.mobile-nav i svg {
    width: 20px;
    height: 20px;
}

/* SCAN BUTTON (CENTER STYLE 🔥) */
.mobile-nav .scan {
    background: #f97316;
    color: white;

    width: 55px;
    height: 55px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav .scan i svg {
    width: 24px;
    height: 24px;
}

/* =========================
   FIX: BUTTON ALS CARD
========================= */

/* voorkomt dat buttons de card styling slopen */
button.card {
    all: unset;
    display: block;
    width: 90%;

    background: #1e293b;
    border-radius: 16px;
    padding: 18px;

    cursor: pointer;
    transition: 0.2s;
}

/* hover zoals normale cards */
button.card:hover {
    transform: translateY(-3px);
}

/* zorg dat inner content correct blijft */
button.card .card-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* =========================
   MOBILE ONLY
========================= */
@media (max-width: 900px) {

    .mobile-nav {
        display: flex;
    }

    /* ruimte onder content */
    .main {
        padding-bottom: 90px;
    }

}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .main {
        padding: 20px;
    }
}