:root {
    --primary: #3b82f6;
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --warning-bg: #E6E697; /* Jaune Flave demandé */
    --warning-border: #d4d480;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
}

.container { max-width: 1000px; margin: 0 auto; }

/* Header */
header { text-align: center; margin-bottom: 2rem; position: relative; }

.logout-link {
    position: absolute; top: 0; right: 0;
    color: #ef4444; text-decoration: none; font-weight: bold; font-size: 0.9rem;
    border: 1px solid #ef4444; padding: 5px 10px; border-radius: 4px;
}

/* Calendar */
.calendar-container {
    background: white; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); padding: 20px;
}
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.btn-nav { background: none; border: none; cursor: pointer; font-size: 1.5rem; padding: 5px 15px; border-radius: 50%; }
.btn-nav:hover { background-color: #f0f0f0; }

.grid-header, .grid-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.grid-header div { text-align: center; font-weight: bold; color: #6b7280; font-size: 0.9rem; padding-bottom: 10px; }

.day-cell {
    border: 1px solid var(--border-color); border-radius: 8px; height: 100px; padding: 8px;
    cursor: pointer; background: white; display: flex; flex-direction: column; justify-content: space-between;
    transition: background 0.2s; overflow: hidden;
}
.day-cell:hover { background-color: #eff6ff; }
.day-cell.other-month { background-color: #f9fafb; color: #9ca3af; pointer-events: none; }
.day-cell.today { border: 2px solid var(--primary); background-color: #eff6ff; }

.day-stats { font-size: 0.75rem; font-weight: 600; }
.stat-sales { color: #16a34a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-spending { color: #dc2626; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Modal */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 1000;
}
.modal.active { display: flex; }
.modal-content {
    background: white; width: 90%; max-width: 600px; border-radius: 12px;
    max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px; overflow-y: auto; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; }
.tab-btn {
    padding: 10px 20px; background: none; border: none; border-bottom: 2px solid transparent;
    cursor: pointer; font-weight: 500; flex: 1; text-align: center; border-radius: 8px 8px 0 0;
}
.tab-btn.active { border-bottom-color: var(--primary); color: var(--primary); background: #f9f9f9; }

/* --- STYLE SPECIFIQUE POUR L'ONGLET DEPENSES --- */
/* Quand le bouton Dépenses est actif, il devient jaune */
#btn-tab-spending.active {
    background-color: var(--warning-bg);
    color: #000;
    border-bottom: none;
    font-weight: bold;
}

/* Le contenu de l'onglet dépenses est jaune */
.tab-content-spending {
    background-color: var(--warning-bg);
    padding: 20px;
    border-radius: 0 0 8px 8px; /* Arrondi en bas */
    border: 1px solid var(--warning-border);
    margin-top: -20px; /* Pour coller aux onglets */
    padding-top: 30px;
}
/* Les champs de saisie dans la zone jaune restent blancs pour la lisibilité */
.tab-content-spending input {
    background-color: #fff;
    border: 1px solid #c0c0c0;
}

.tab-content { display: none; }
.tab-content.active { display: block; }
.info-currency { font-size: 0.8rem; color: #555; margin-bottom: 10px; font-style: italic; text-align: right; }

/* Forms */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; }
.form-group input {
    width: 100%; padding: 10px; border: 1px solid var(--border-color);
    border-radius: 6px; box-sizing: border-box; font-size: 16px;
}

.btn { padding: 12px 20px; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; font-size: 1rem; }
.btn-primary { background: var(--primary); color: white; width: 100%; }
.btn-secondary { background: #e5e7eb; color: #374151; }

.spending-list { margin-top: 15px; border-top: 1px solid #aaa; padding-top: 15px; }
.spending-item {
    display: flex; justify-content: space-between; padding: 10px;
    background: rgba(255,255,255,0.8); border-radius: 6px; margin-bottom: 8px;
    border: 1px solid #ccc;
}

.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; padding: 0 10px; }

/* Mobile */
@media (max-width: 600px) {
    body { padding: 10px; }
    .calendar-container { padding: 10px; }
    .day-cell { height: 75px; padding: 4px; }
    .grid-header div { font-size: 0.7rem; }
    .btn-nav { font-size: 1.2rem; padding: 0 10px; }
    .modal-content { width: 95%; max-height: 85vh; }
}

/* Login */
.login-body { display: flex; justify-content: center; align-items: center; height: 100vh; }
.login-container {
    background: white; padding: 30px; border-radius: 12px;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1); width: 100%; max-width: 400px;
}
.login-container h2 { text-align: center; margin-bottom: 20px; color: var(--primary); }