/* =========================
   Reset & Base
========================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f9f9f9;
    color: #333;
    min-height: 100vh;
}

/* =========================
   Admin Wrapper
========================= */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* =========================
   Sidebar (Desktop Default)
========================= */
.sidebar {
    width: 220px;
    background: #ffffff;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: left 0.3s ease;
    z-index: 1003;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
}

.sidebar h2 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #4a4a4a;
    text-align: center;
}

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

.sidebar nav a {
    text-decoration: none;
    color: #555;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar nav a:hover {
    background: #4a90e2;
    color: #fff;
}

/* =========================
   Content Area
========================= */
.content {
    flex: 1;
    padding: 30px;
    margin-left: 220px; /* desktop spacing */
}

.content header h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #333;
}

/* =========================
   Buttons
========================= */
button, .btn {
    background: #000;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-weight: 500;
    text-align: center;
}

button:hover, .btn:hover {
    background: #357ABD;
}

button.delete-btn {
    background: #e74c3c;
}

button.delete-btn:hover {
    background: #c0392b;
}

.checkout-button {
    background: #27ae60;
}

.checkout-button:hover {
    background: #1e8449;
}

/* =========================
   Forms
========================= */
input[type="text"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #4a90e2;
}

/* =========================
   Inventory Cards
========================= */
.inventory-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.inventory-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.inventory-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.inventory-card img {
    max-width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.inventory-card h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.inventory-card p {
    font-size: 0.95rem;
    margin-bottom: 5px;
}

/* =========================
   MOBILE SIDEBAR
========================= */
@media screen and (max-width: 900px) {
    /* Sidebar offscreen by default */
    .sidebar {
        left: -240px !important;
        padding-top: 60px;
        position: fixed !important;
        z-index: 1003;
        height: 100%;
    }

    .sidebar.active {
        left: 0 !important;
    }

    /* Hamburger button */
    #hamburger-btn {
        display: block !important;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1005;
        font-size: 1.5rem;
        background: #fff;
        color: #000;
        border: none;
        padding: 10px 14px;
        border-radius: 6px;
        cursor: pointer;
    }

    /* Overlay */
    #sidebar-overlay {
        display: none !important;
        position: fixed;
        top:0;
        left:0;
        width:100%;
        height:100%;
        background: rgba(0,0,0,0.4);
        z-index: 1002;
    }

    #sidebar-overlay.active {
        display: block !important;
    }

    /* Content full width on mobile */
    .content {
        margin-left: 0 !important;
        padding: 20px !important;
    }

    /* Admin wrapper stacked */
    .admin-wrapper {
        flex-direction: column !important;
    }

    /* Inventory cards mobile */
    .inventory-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .inventory-card img {
        height: 120px;
    }
main.content h1 {
    padding-left: 51px;
}
.category-grid {
    padding-top: 24px;
}
.inventory-card {width:160px !important}
main.content {
    padding-top: 21px !important
}
div#admin_dashboard .inventory-card {
    width: 100% !important;
}
div#admin_users .inventory-card {
    width: 100% !important;
}
main.content form{margin-left:0px !important;}
}

/* Extra small devices */
@media screen and (max-width: 480px) {
    .inventory-card img {
        height: 100px;
    }

    .inventory-card h3 {
        font-size: 1rem;
    }

    .inventory-card p {
        font-size: 0.85rem;
    }
}


.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.card-actions .btn {
    flex: 1;
    min-width: 90px;
    text-align: center;
}

/* Mobile tweak */
@media (max-width: 600px) {
    .card-actions {
        gap: 6px;
    }

    .card-actions .btn {
        flex: 1 1 30%;
        font-size: 13px;
        padding: 8px;
    }
}












.admin-wrapper main.content { padding: 20px; }

/* TABLE (Desktop default) */
.admin-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.admin-wrapper table th,
.admin-wrapper table td {
    padding: 12px 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.admin-wrapper table th {
    background-color: #f4f4f4;
}

.admin-wrapper table tr:hover {
    background-color: #f9f9f9;
}

/* Buttons */
.btn {
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
    background-color: #007bff;
    color: #fff;
    font-size: 14px;
    display: inline-block;
}

.btn:hover { background-color: #0056b3; }

.btn.delete-btn { background-color: #dc3545; }
.btn.delete-btn:hover { background-color: #c82333; }

/* Alert */
.alert-success {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* 📱 MOBILE CARD LAYOUT */
@media (max-width: 768px) {

    /* Hide table header */
    table thead {
        display: none;
    }

    /* Turn rows into cards */
    table, table tbody, table tr, table td {
        display: block;
        width: 100%;
    }

    table tr {
        background: #fff;
        margin-bottom: 15px;
        border-radius: 10px;
        padding: 15px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        border: none;
    }

    table td {
        border: none;
        padding: 8px 0;
        font-size: 14px;
    }

    /* Label each field */
    table td::before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        color: #555;
        margin-bottom: 3px;
        font-size: 13px;
    }

    /* Actions buttons */
    td:last-child {
        display: flex;
        gap: 10px;
        margin-top: 10px;
    }

    .btn {
        flex: 1;
        text-align: center;
        padding: 10px;
        font-size: 15px;
    }
}