/* ============================================================
   Dashboard La French Pizza — Styles
   ============================================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* --- Login page --- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

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

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.8rem;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
}

.login-header p {
    color: #666;
    font-size: 0.95rem;
}

/* --- Formulaire --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #444;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #0f3460;
}

/* --- Boutons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    width: 100%;
    background: #0f3460;
    color: #fff;
}

.btn-primary:hover {
    background: #1a4a7a;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Alertes --- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* --- Navbar --- */
.navbar {
    background: #1a1a2e;
    color: #fff;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-logo {
    font-size: 1.5rem;
}

.navbar-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-user {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* --- Container --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container h1 {
    margin-bottom: 1.5rem;
    color: #1a1a2e;
}

/* --- Grille modules --- */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.module-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

.module-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}

.module-card p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.module-placeholder {
    opacity: 0.7;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

/* --- Module cards actifs --- */
.module-active-link {
    text-decoration: none;
    color: inherit;
    opacity: 1;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.module-active-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* --- Navbar link --- */
.navbar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

/* --- Formulaire : select --- */
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s;
    appearance: auto;
}

.form-group select:focus {
    outline: none;
    border-color: #0f3460;
}

/* --- Formulaire : aide --- */
.form-help {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.3rem;
}

/* --- Checkboxes --- */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* --- Sélecteur avec recherche --- */
.search-select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.search-select-wrapper input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.search-select-wrapper input[type="text"]:focus {
    outline: none;
    border-color: #0f3460;
}

/* --- Calculateur : layout --- */
.calc-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.calc-form-card,
.calc-result-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

.calc-result-card h2 {
    font-size: 1.1rem;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.btn-calc {
    margin-top: 0.5rem;
}

/* --- Calculateur : tableau résultat --- */
.calc-table {
    width: 100%;
    border-collapse: collapse;
}

.calc-table td {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.calc-table .text-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.calc-subtotal td {
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
}

.calc-total td {
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 2px solid #1a1a2e;
    padding-top: 0.75rem;
}

.calc-total-ttc td {
    color: #0f3460;
    font-size: 1.15rem;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .navbar {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .calc-layout {
        grid-template-columns: 1fr;
    }
}
