:root {
    --blue: #203bcc;
    --blue-dark: #162da3;
    --blue-light: #73a2ff;
    --yellow: #d99817;
    --yellow-light: #f3e292;
    --white: #ffffff;
    --gray: #f5f6fa;
    --gray-2: #f9fafb;
    --border: #e5e7eb;
    --text: #1f2937;
    --muted: #6b7280;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d99817;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--gray);
    color: var(--text);
}

/* ===== LAYOUT GLOBAL ===== */

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: linear-gradient(180deg, var(--blue), var(--blue-dark));
    color: white;
    padding: 28px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo {
    margin-bottom: 40px;
}

.logo strong {
    display: block;
    font-size: 30px;
    font-weight: 900;
}

.logo span {
    color: var(--yellow-light);
    font-weight: 700;
}

.sidebar nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 14px;
    margin-bottom: 6px;
    font-weight: 700;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.15);
}

.sidebar hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.25);
    margin: 20px 0;
}

.main-content {
    flex: 1;
    padding: 30px;
    max-width: 100%;
}

.topbar {
    background: white;
    padding: 18px 24px;
    border-radius: 22px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

.role-badge {
    background: var(--yellow-light);
    color: #111827;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 800;
}

/* ===== TITRES / HERO ===== */

.page-header,
.page-hero {
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
    color: white;
    border-radius: 28px;
    padding: 32px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    position: relative;
    overflow: hidden;
}

.page-header::after,
.page-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -80px;
    top: -90px;
    background: rgba(255,255,255,0.12);
    transform: rotate(34deg);
    border-radius: 42px;
}

.page-header h1,
.page-hero h1 {
    color: white;
    margin: 0 0 8px;
    font-size: 36px;
}

.page-header p,
.page-hero p {
    margin: 0;
    opacity: 0.92;
}

.page-header > *,
.page-hero > * {
    position: relative;
    z-index: 2;
}

.eyebrow {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 900;
    color: var(--yellow-light);
}

/* ===== PANELS / CARDS ===== */

.panel {
    background: white;
    padding: 26px;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.panel h2 {
    color: var(--blue);
    margin-top: 0;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.card {
    background: white;
    padding: 24px;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    border-left: 8px solid var(--blue);
}

.card.warning {
    border-left-color: var(--yellow);
}

.card.danger-card {
    border-left-color: var(--danger);
}

.card h3 {
    margin: 0;
    color: var(--blue);
}

.card p {
    font-size: 38px;
    font-weight: 900;
    margin: 16px 0 0;
}

/* ===== FORMULAIRES ===== */

.form-card {
    max-width: 850px;
}

.form-group {
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

label {
    display: block;
    margin-bottom: 7px;
    font-weight: 800;
    color: var(--text);
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    font-size: 15px;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(115,162,255,0.35);
    border-color: var(--blue);
}

textarea {
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.form-check input {
    width: auto;
    margin: 0;
}

.form-check label {
    margin: 0;
}

/* ===== BOUTONS ===== */

button,
.btn {
    display: inline-block;
    padding: 13px 20px;
    background: var(--yellow);
    color: #111827;
    border: none;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.btn:hover {
    opacity: 0.9;
}

.btn-secondary {
    display: inline-block;
    padding: 13px 18px;
    background: #e5e7eb;
    color: #111827;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 900;
}

.btn-small {
    display: inline-block;
    padding: 9px 13px;
    background: var(--blue);
    color: white;
    border-radius: 11px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.btn-small.danger,
.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

/* ===== ALERTES ===== */

.alert-success {
    background: #dcfce7;
    color: #166534;
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-weight: 800;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-weight: 800;
}

.info-box {
    background: #eff6ff;
    color: #1e40af;
    padding: 16px;
    border-radius: 16px;
    margin: 18px 0;
    font-weight: 700;
    line-height: 1.5;
}

/* ===== TABLEAUX ===== */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    background: #f3f4f6;
    color: var(--blue);
    padding: 15px;
    font-size: 14px;
}

.data-table td {
    padding: 16px 15px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.data-table tr:hover td {
    background: #f9fafb;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== BADGES ===== */

.badge {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

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

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gray {
    background: #e5e7eb;
    color: #374151;
}

/* ===== FILTRES ===== */

.filters {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr auto;
    gap: 18px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

/* ===== RÉSERVATIONS ===== */

.reservation-list,
.reservations-wrapper {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.reservation-card,
.booking-card {
    background: white;
    border-radius: 26px;
    padding: 26px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.reservation-card-header,
.booking-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.reservation-card-header h2,
.booking-header h2 {
    margin: 0;
    color: var(--blue);
}

.reservation-card-header p,
.booking-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.reservation-details,
.booking-dates {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.reservation-details div,
.booking-dates div {
    background: var(--gray-2);
    padding: 16px;
    border-radius: 16px;
}

.reservation-details strong,
.booking-dates span {
    display: block;
    color: var(--blue);
    margin-bottom: 6px;
    font-weight: 900;
}

.items-list,
.material-chips {
    display: grid;
    gap: 10px;
}

.item-line,
.material-chip {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    background: var(--gray-2);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: 16px;
}

.item-line small,
.material-chip span {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.quantity-pill,
.material-chip em {
    background: var(--yellow-light);
    color: #111827;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 900;
    font-style: normal;
}

.reservation-section,
.booking-section {
    margin-top: 22px;
}

.reservation-section h3,
.booking-section h3 {
    color: var(--blue);
    margin: 0 0 10px;
}

.formateur-comment,
.note-blue {
    background: #eff6ff;
    padding: 16px;
    border-radius: 16px;
}

.cancel-comment,
.note-red {
    background: #fee2e2;
    color: #7f1d1d;
    padding: 16px;
    border-radius: 16px;
}

/* ===== CALENDRIER / STATS ===== */

#calendar {
    background: white;
    padding: 10px;
}

.fc .fc-toolbar-title {
    color: var(--blue);
    font-size: 26px;
    font-weight: 900;
}

.fc .fc-button-primary {
    background: var(--blue);
    border-color: var(--blue);
}

.fc-event {
    border-radius: 8px;
    padding: 3px 5px;
    font-weight: 700;
}

.chart-panel {
    margin-bottom: 24px;
}

.chart-panel canvas {
    max-height: 360px;
}

/* ===== LOGIN ===== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
}

.login-card {
    width: 430px;
    background: white;
    padding: 42px;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-card h1 {
    margin: 0;
    color: var(--blue);
    font-size: 34px;
}

.login-card p {
    color: var(--muted);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1100px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters,
    .reservation-details,
    .booking-dates {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        padding: 18px;
    }

    .page-header,
    .page-hero,
    .reservation-card-header,
    .booking-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

    .item-line,
    .material-chip {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== PAGE MES RÉSERVATIONS - STYLE MODERNE ===== */

.reservation-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.mini-stat {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

.mini-stat span {
    display: block;
    color: #6b7280;
    font-weight: 700;
    margin-bottom: 8px;
}

.mini-stat strong {
    color: var(--blue);
    font-size: 32px;
}

.reservation-filter-panel {
    margin-bottom: 22px;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tabs a {
    text-decoration: none;
    color: #374151;
    background: #f3f4f6;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 800;
}

.filter-tabs a.active,
.filter-tabs a:hover {
    background: var(--blue);
    color: white;
}

.booking-card {
    display: grid;
    grid-template-columns: 70px 1fr;
    padding: 0;
    overflow: hidden;
}

.booking-left {
    background: #f3f4f6;
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 26px;
}

.booking-left::after {
    content: "";
    position: absolute;
    top: 72px;
    bottom: 0;
    width: 3px;
    background: #d1d5db;
}

.booking-id span {
    background: var(--blue);
    color: white;
    padding: 8px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 13px;
    position: relative;
    z-index: 2;
}

.timeline-dot {
    position: absolute;
    top: 78px;
    width: 14px;
    height: 14px;
    background: var(--yellow);
    border-radius: 999px;
    z-index: 2;
}

.booking-content {
    padding: 26px;
}

.booking-notes {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.booking-notes > div {
    background: #f9fafb;
    border-radius: 16px;
    padding: 16px;
}

.booking-notes strong {
    color: var(--blue);
}

.booking-notes p {
    margin: 8px 0 0;
}

.booking-treated {
    margin-top: 22px;
    padding: 14px 16px;
    background: #f3f4f6;
    border-radius: 14px;
    color: #374151;
}

.booking-actions {
    margin-top: 22px;
}

.empty-state {
    background: white;
    border-radius: 26px;
    padding: 40px;
    text-align: center;
}

.empty-state h2 {
    color: var(--blue);
    margin-top: 0;
}

@media (max-width: 700px) {
    .reservation-stats {
        grid-template-columns: 1fr;
    }

    .booking-card {
        grid-template-columns: 1fr;
    }

    .booking-left {
        display: none;
    }
}