/* ============================================
   FAST FOOD MAROC - Styles Dashboard
   ============================================ */

:root {
    --sidebar-width: 260px;
    --header-height: 60px;
    --radius: 12px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; background: #f1f5f9; color: #1e293b; min-height: 100vh; }
a { text-decoration: none; color: inherit; }

/* ----- LOGIN ----- */
.login-screen {
    position: fixed; inset: 0; z-index: 9999;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.5s;
}
.login-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.login-box {
    background: #fff; padding: 3rem; border-radius: 20px;
    text-align: center; width: 90%; max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.login-box h1 { font-size: 2rem; color: var(--primary, #e85d04); margin-bottom: 0.5rem; }
.login-box p { color: #6c757d; margin-bottom: 2rem; }
.login-box input {
    width: 100%; padding: 1rem; border: 2px solid #e0e0e0;
    border-radius: 10px; font-size: 1rem; margin-bottom: 1rem;
    text-align: center; font-family: 'Poppins', sans-serif;
}
.login-box input:focus { border-color: var(--primary, #e85d04); outline: none; }
.login-box button {
    width: 100%; padding: 1rem;
    background: linear-gradient(135deg, #e85d04, #dc2f02);
    color: #fff; border: none; border-radius: 10px;
    font-weight: 700; font-size: 1rem; cursor: pointer;
    font-family: 'Poppins', sans-serif;
}
.login-box button:hover { transform: translateY(-2px); }
.login-error { color: #ef476f; font-size: 0.9rem; margin-top: 0.5rem; display: none; }

/* ----- LAYOUT ----- */
.dashboard { display: none; }
.dashboard.active { display: flex; }

/* ----- SIDEBAR ----- */
.sidebar {
    width: var(--sidebar-width); background: #1a1a2e; color: #fff;
    height: 100vh; position: fixed; left: 0; top: 0;
    overflow-y: auto; z-index: 100; transition: transform 0.3s;
    display: flex; flex-direction: column;
}
.sidebar-header {
    padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}
.sidebar-header h2 { font-size: 1.3rem; font-weight: 700; }
.sidebar-header span { color: #ffba08; }
.sidebar-header small { color: rgba(255,255,255,0.5); font-size: 0.75rem; }
.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.9rem 1.5rem; color: rgba(255,255,255,0.7);
    transition: var(--transition); font-weight: 500; font-size: 0.9rem;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,0.05); color: #fff;
    border-left-color: var(--primary, #e85d04);
}
.sidebar-nav a i { width: 20px; text-align: center; }
.sidebar-footer { padding: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer button {
    width: 100%; padding: 0.7rem; background: rgba(255,255,255,0.1);
    color: #fff; border: none; border-radius: 8px; cursor: pointer;
    font-family: 'Poppins', sans-serif; font-weight: 600;
    transition: var(--transition);
}
.sidebar-footer button:hover { background: #ef476f; }

/* ----- MAIN ----- */
.main-content { flex: 1; margin-left: var(--sidebar-width); padding: 2rem; min-height: 100vh; }
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.page-header h1 { font-size: 1.8rem; font-weight: 700; }

/* ----- STATS ----- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: #fff; border-radius: var(--radius); padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
    width: 50px; height: 50px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff;
}
.stat-icon.orange { background: linear-gradient(135deg, #e85d04, #dc2f02); }
.stat-icon.green { background: linear-gradient(135deg, #06d6a0, #05b388); }
.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.stat-info h3 { font-size: 1.5rem; font-weight: 800; }
.stat-info p { color: #6c757d; font-size: 0.8rem; }

/* ----- CARDS ----- */
.card {
    background: #fff; border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden; margin-bottom: 1.5rem;
}
.card-header {
    padding: 1rem 1.5rem; border-bottom: 1px solid #f0f0f0;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 0.5rem;
}
.card-header h2 { font-size: 1.1rem; font-weight: 700; }
.card-body { padding: 1.5rem; overflow-x: auto; }

/* ----- TABLE ----- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.7rem 0.8rem; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 0.85rem; }
th { background: #f9fafb; font-weight: 600; color: #6c757d; }
tr:hover { background: #f9fafb; }

/* ----- STATUS BADGES ----- */
.status-badge {
    padding: 0.2rem 0.7rem; border-radius: 15px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
}
.status-en_attente { background: #fef3c7; color: #92400e; }
.status-confirmee { background: #dbeafe; color: #1e40af; }
.status-en_cours { background: #e0e7ff; color: #3730a3; }
.status-livree { background: #d1fae5; color: #065f46; }
.status-annulee { background: #fee2e2; color: #991b1b; }

/* ----- BUTTONS ----- */
.btn {
    padding: 0.5rem 1.2rem; border-radius: 8px; font-weight: 600;
    cursor: pointer; border: none; font-family: 'Poppins', sans-serif;
    font-size: 0.8rem; transition: var(--transition);
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-primary { background: #e85d04; color: #fff; }
.btn-primary:hover { background: #dc2f02; }
.btn-success { background: #06d6a0; color: #fff; }
.btn-danger { background: #ef476f; color: #fff; }
.btn-outline { background: transparent; border: 2px solid #e85d04; color: #e85d04; }
.btn-outline:hover { background: #e85d04; color: #fff; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.75rem; }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.7rem; border-radius: 5px; }

/* ----- FORMS ----- */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.85rem; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 0.6rem 0.8rem; border: 2px solid #e0e0e0;
    border-radius: 8px; font-family: 'Poppins', sans-serif; font-size: 0.85rem;
}
.form-group input:focus, .form-group textarea:focus { border-color: #e85d04; outline: none; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* ----- UPLOAD BOX ----- */
.upload-box {
    border: 2px dashed #ddd; border-radius: 10px;
    padding: 1.2rem; text-align: center; cursor: pointer;
    transition: var(--transition); background: #fafafa;
    min-height: 100px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 0.3rem;
}
.upload-box:hover { border-color: #e85d04; background: #fff5eb; }
.upload-box.has-image { border-color: #06d6a0; background: #f0fdf4; }
.upload-box i { font-size: 1.5rem; color: #6c757d; }
.upload-box:hover i { color: #e85d04; }
.upload-box img { max-width: 120px; max-height: 80px; border-radius: 8px; margin-top: 0.3rem; object-fit: contain; }

/* ----- MODAL ----- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 500;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
    background: #fff; border-radius: var(--radius); width: 95%;
    max-width: 600px; max-height: 85vh; overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.modal-header {
    padding: 1.2rem; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { font-weight: 700; font-size: 1.2rem; }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: #6c757d; }
.modal-body { padding: 1.2rem; }
.modal-footer { padding: 1rem 1.2rem; border-top: 1px solid #eee; display: flex; gap: 0.8rem; justify-content: flex-end; }

/* ----- SECTIONS ----- */
.section { display: none; }
.section.active { display: block; }

/* ----- ACCORDION ----- */
.accordion { border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 0.8rem; overflow: hidden; }
.accordion-header {
    padding: 0.8rem 1rem; background: #f9fafb; cursor: pointer;
    font-weight: 600; display: flex; justify-content: space-between; align-items: center;
}
.accordion-header:hover { background: #f0f0f0; }
.accordion-body { padding: 1rem; display: none; background: #fff; }
.accordion.open .accordion-body { display: block; }
.accordion.open .accordion-header i { transform: rotate(180deg); }

/* ----- TOAST ----- */
.toast {
    position: fixed; bottom: 30px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b; color: #fff; padding: 0.8rem 2rem;
    border-radius: 50px; font-weight: 600; z-index: 9999;
    transition: transform 0.3s;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: #06d6a0; }
.toast.error { background: #ef476f; }

/* ----- RECEIPT IMAGE ----- */
.receipt-image {
    max-width: 100%; max-height: 300px; border-radius: 8px;
    cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}
.receipt-image:hover { transform: scale(1.02); }
.receipt-section { background: #f9fafb; border: 2px dashed #e0e0e0; border-radius: 10px; padding: 1.5rem; margin-top: 1rem; }
.receipt-actions { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1rem; }

/* ----- IMAGE FULLSCREEN ----- */
.image-fullscreen-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
}
.image-fullscreen-overlay img { max-width: 90%; max-height: 90%; border-radius: 10px; }
.close-fullscreen { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 2rem; cursor: pointer; }

/* ----- MENU TOGGLE ----- */
.menu-toggle { display: none; }

/* ----- RESPONSIVE ----- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle {
        display: block !important; position: fixed; top: 1rem; left: 1rem; z-index: 200;
        background: #1a1a2e; color: #fff; border: none;
        padding: 0.5rem 0.7rem; border-radius: 8px; font-size: 1.2rem; cursor: pointer;
    }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}