/* =========================
   BASE & RESET (OPTIMIZED)
========================= */

/* Apply box-sizing only to layout elements (faster than *) */
html {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f4f4;
    color: #000;
}

/* Inherit box-sizing only where needed */
.app,
.sidebar,
.content,
table,
th,
td,
.order-card,
.order-card * {
    box-sizing: inherit;
}

/* =========================
   APP LAYOUT
========================= */
.app {
    display: flex;
    min-height: 100vh;
}

/* =========================
   SIDEBAR
========================= */
.sidebar {
    width: 240px;
    background: #1f1f1f;
    color: #ffffff;
    padding: 20px;
    flex-shrink: 0;
}

.sidebar h3 {
    margin: 0 0 12px 0;
    font-size: 13px;
    text-transform: uppercase;
    opacity: 0.6;
}

.sidebar a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    padding: 8px 0;
    font-size: 15px;
}

.sidebar a:hover {
    opacity: 0.75;
}

/* =========================
   CONTENT
========================= */
.content {
    flex: 1;
    padding: 30px;
    background: #ffffff;
    overflow-x: auto;
}

/* =========================
   HEADINGS
========================= */
h2 {
    margin: 0 0 15px 0;
}

/* =========================
   BUTTONS
========================= */
a.button,
button {
    padding: 8px 14px;
    background: #333;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

a.button:hover,
button:hover {
    opacity: 0.85;
}

/* =========================
   TABLES (DESKTOP)
========================= */
table {
    width: 100%;
    margin-top: 15px;
    border-collapse: collapse;
}

th,
td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    background: #f4f4f4;
}

table.orders-table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

table.orders-table tr {
    background: #ffffff;
}

table.orders-table tr:hover {
    background: #f6f6f6;
}

/* =========================
   STATUS BADGES
========================= */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

.status-da_fare {
    background: #ffecec;
    color: #b30000;
}

.status-in_lavorazione {
    background: #fff6d6;
    color: #8a6d00;
}

.status-completato {
    background: #e6ffe6;
    color: #006600;
}

/* =========================
   MOBILE MENU BUTTON
========================= */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: #1f1f1f;
    color: #ffffff;
    border: none;
    padding: 10px 14px;
    font-size: 18px;
    border-radius: 4px;
}

/* =========================
   ORDERS MOBILE CARDS
========================= */
.orders-cards {
    display: none; /* hidden on desktop */
}

.order-card {
    background: #ffffff;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    cursor: pointer;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-card strong {
    font-size: 15px;
}

.order-card-row {
    font-size: 14px;
    margin-bottom: 6px;
}

.order-card-row span {
    opacity: 0.6;
}

/* =========================
   RESPONSIVE (MOBILE)
========================= */
@media (max-width: 768px) {

    .menu-toggle {
        display: block;
    }

    .app {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100%;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .content {
        padding: 20px;
    }

    table.orders-table {
        display: none;
    }

    .orders-cards {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
}
