/* =========================================================
   2C2S Agenda — Feuille de styles principale
   Palette : Bleu professionnel / Blanc / Gris
   ========================================================= */

/* ===================== VARIABLES ===================== */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --primary-50: #EFF6FF;
    --secondary: #475569;
    --secondary-light: #94A3B8;
    --success: #10B981;
    --success-bg: #D1FAE5;
    --danger: #EF4444;
    --danger-bg: #FEE2E2;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --info: #3B82F6;
    --info-bg: #DBEAFE;
    --bg: #F8FAFC;
    --bg-white: #FFFFFF;
    --text: #1E293B;
    --text-light: #64748B;
    --text-lighter: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-sm: 4px;
    --transition: 0.2s ease;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ===================== RESET ===================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
}

/* ===================== LAYOUT ===================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
    padding: 30px 0;
}

/* ===================== NAVBAR ===================== */
.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.navbar-brand:hover {
    color: var(--primary);
}

.brand-icon {
    font-size: 1.5rem;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
}

.nav-link:hover {
    background-color: var(--primary-50);
    color: var(--primary);
}

.nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-link-logout {
    color: var(--danger);
}

.nav-link-logout:hover {
    background-color: var(--danger-bg);
    color: var(--danger);
}

/* Hamburger mobile */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text);
    transition: all var(--transition);
    border-radius: 2px;
}

/* ===================== FOOTER ===================== */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: auto;
}

.footer-contact {
    margin-bottom: 12px;
}

.footer-contact-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 6px;
}

.footer-contact-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    line-height: 1.8;
}

.footer-item {
    white-space: nowrap;
}

.footer-item a {
    color: var(--text-light);
    transition: color var(--transition);
}

.footer-item a:hover {
    color: var(--primary);
}

/* ===================== MODAL ATTACHMENTS ===================== */
.modal-attachments {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
}

.modal-attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.85rem;
    transition: all var(--transition);
    text-decoration: none;
}

.modal-attachment-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.attachment-file-icon {
    flex-shrink: 0;
}

.attachment-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-file-size {
    color: var(--text-lighter);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #374151;
    color: white;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #DC2626;
    color: white;
}

.btn-warning {
    background-color: var(--warning);
    color: #1E293B;
}

.btn-warning:hover {
    background-color: #D97706;
    color: #1E293B;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background-color: var(--bg);
    color: var(--text);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ===================== FORMS ===================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

.required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font);
    color: var(--text);
    background-color: var(--bg-white);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Form layout */
.form-row {
    display: flex;
    gap: 20px;
}

.form-group-half {
    flex: 1;
}

.form-group-third {
    flex: 1;
}

.form-group-quarter {
    flex: 0 0 calc(25% - 10px);
}

.form-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* Color picker */
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    cursor: pointer;
}

.color-option input {
    display: none;
}

.color-swatch {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: all var(--transition);
}

.color-option input:checked + .color-swatch {
    border-color: var(--text);
    transform: scale(1.15);
    box-shadow: var(--shadow-md);
}

.color-swatch:hover {
    transform: scale(1.1);
}

/* ===================== ALERTS ===================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert ul {
    margin: 0;
    padding-left: 18px;
}

.alert-error {
    background-color: var(--danger-bg);
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background-color: var(--success-bg);
    color: #065F46;
    border: 1px solid #A7F3D0;
}

/* Flash messages */
.flash-message {
    padding: 14px 18px;
    padding-right: 44px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    position: relative;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-success {
    background-color: var(--success-bg);
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.flash-error {
    background-color: var(--danger-bg);
    color: #991B1B;
    border: 1px solid #FECACA;
}

.flash-warning {
    background-color: var(--warning-bg);
    color: #92400E;
    border: 1px solid #FDE68A;
}

.flash-info {
    background-color: var(--info-bg);
    color: #1E40AF;
    border: 1px solid #93C5FD;
}

.flash-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    line-height: 1;
}

.flash-close:hover {
    opacity: 1;
}

/* ===================== AUTH ===================== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

/* ===================== ADMIN ===================== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-header h1 {
    font-size: 1.5rem;
}

.admin-filters {
    background: var(--bg-white);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.filters-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

/* Data table */
.table-responsive {
    overflow-x: auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: var(--bg);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: var(--primary-50);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    vertical-align: middle;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-online {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.badge-onsite {
    background-color: #D1FAE5;
    color: #065F46;
}

.badge-mini {
    font-size: 0.7rem;
    padding: 2px 6px;
}

.actions-cell {
    display: flex;
    gap: 4px;
    white-space: nowrap;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.empty-state p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.pagination-info {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Confirm card */
.confirm-card {
    text-align: center;
    padding: 50px 30px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 0 auto;
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.confirm-card h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.confirm-subject {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.confirm-warning {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* ===================== AGENDA PUBLIC ===================== */
.agenda-header {
    margin-bottom: 24px;
}

.agenda-header h1 {
    font-size: 1.6rem;
    margin-bottom: 16px;
}

/* Search bar */
.search-bar {
    background: var(--bg-white);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-input-wrapper {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    font-size: 1rem !important;
    padding: 12px 16px !important;
}

.search-btn {
    padding: 12px 20px;
}

.filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-controls select {
    min-width: 160px;
}

/* Calendar Navigation */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.view-modes {
    display: flex;
    gap: 4px;
}

.calendar-period {
    display: flex;
    align-items: center;
    gap: 16px;
}

.period-title {
    font-size: 1.15rem;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

/* ===================== VUE SEMAINE ===================== */
.agenda-week {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.week-day {
    flex: 1;
    min-width: 160px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.week-day:hover {
    box-shadow: var(--shadow-md);
}

.week-day.is-today {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.week-day-header {
    padding: 12px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.week-day.is-today .week-day-header {
    background: var(--primary-light);
}

.day-name {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.day-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.week-day.is-today .day-number {
    color: var(--primary);
}

.day-month {
    display: block;
    font-size: 0.75rem;
    color: var(--text-lighter);
}

.week-day-events {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
}

.no-events {
    text-align: center;
    color: var(--text-lighter);
    font-size: 0.8rem;
    padding: 20px 0;
}

/* Event cards */
.event-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 10px 12px;
    border-left: 4px solid var(--primary);
    cursor: pointer;
    transition: all var(--transition);
}

.event-card:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow);
}

.event-time {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 4px;
}

.event-subject {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 2px;
}

.event-teacher {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.event-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
}

.event-location {
    color: var(--text-lighter);
    font-size: 0.75rem;
}

.event-description {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
    border-top: 1px solid var(--border-light);
    padding-top: 6px;
}

/* ===================== VUE MOIS ===================== */
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.month-grid-header {
    background: var(--primary);
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.month-grid-cell {
    background: var(--bg-white);
    min-height: 110px;
    padding: 8px;
    transition: background-color var(--transition);
}

.month-grid-cell:hover:not(.month-grid-empty) {
    background-color: var(--primary-50);
}

.month-grid-cell.is-today {
    background-color: var(--primary-50);
}

.month-grid-cell.is-today .cell-date {
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-grid-empty {
    background-color: var(--bg);
}

.cell-date {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 6px;
}

.cell-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cell-event {
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cell-event-time {
    font-weight: 600;
    white-space: nowrap;
}

.cell-event-subject {
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-event-more {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 500;
    padding: 2px 6px;
}

/* ===================== VUE ANNÉE ===================== */
.agenda-year {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.year-month {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.year-month:hover {
    box-shadow: var(--shadow-md);
}

.year-month-header {
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
}

.month-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.month-link:hover {
    color: var(--primary);
}

.month-count {
    background: var(--primary);
    color: white;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.mini-calendar {
    padding: 10px 12px;
}

.mini-cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-lighter);
    margin-bottom: 4px;
}

.mini-cal-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 2px;
}

.mini-cal-day {
    padding: 4px 2px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    transition: all var(--transition);
}

.mini-cal-day.has-events {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.mini-cal-day.has-events:hover {
    background-color: var(--primary);
    color: white;
}

.mini-cal-day.is-today {
    background-color: var(--primary);
    color: white;
    font-weight: 700;
}

.mini-cal-empty {
    padding: 4px 2px;
}

/* ===================== MODAL ===================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    z-index: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: 30px;
}

.modal-body h3 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    padding-right: 30px;
}

.modal-detail {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.modal-detail-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.modal-detail-label {
    font-weight: 600;
    color: var(--text);
    min-width: 80px;
}

.modal-detail-value {
    color: var(--text-light);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .navbar-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 10px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    
    .navbar-links.open {
        display: flex;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .filters-form {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .calendar-nav {
        flex-direction: column;
        text-align: center;
    }
    
    .calendar-period {
        order: -1;
    }
    
    .period-title {
        font-size: 1rem;
        min-width: auto;
    }
    
    /* Vue semaine en colonne sur mobile */
    .agenda-week {
        flex-direction: column;
    }
    
    .week-day {
        min-width: auto;
    }
    
    /* Vue mois réduite */
    .month-grid-cell {
        min-height: 70px;
        padding: 4px;
    }
    
    .cell-event {
        font-size: 0.6rem;
    }
    
    .month-grid-header {
        font-size: 0.65rem;
        padding: 8px 4px;
    }
    
    /* Recherche */
    .search-input-wrapper {
        flex-direction: column;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .filter-controls select {
        min-width: 100%;
    }

    .agenda-year {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .form-card {
        padding: 20px;
    }
    
    .confirm-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .main-content {
        padding: 16px 0;
    }
    
    .agenda-header h1 {
        font-size: 1.2rem;
    }
    
    .month-grid-cell {
        min-height: 50px;
    }
    
    .cell-event {
        display: none;
    }
    
    .month-grid-cell.has-events::after {
        content: '';
        display: block;
        width: 6px;
        height: 6px;
        background: var(--primary);
        border-radius: 50%;
        margin: 4px auto 0;
    }

    .stats-cards {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .results-cards {
        grid-template-columns: 1fr;
    }

    .result-card {
        padding: 14px;
    }

    .agenda-header {
        flex-direction: column;
        gap: 10px;
    }

    .agenda-header-actions {
        flex-wrap: wrap;
    }
}

/* =========================================================
   V2 — DARK MODE
   ========================================================= */
[data-theme="dark"] {
    --primary: #60A5FA;
    --primary-dark: #93C5FD;
    --primary-light: #1E3A5F;
    --primary-50: #172554;
    --secondary: #94A3B8;
    --secondary-light: #64748B;
    --success: #34D399;
    --success-bg: #064E3B;
    --danger: #F87171;
    --danger-bg: #7F1D1D;
    --warning: #FBBF24;
    --warning-bg: #78350F;
    --info: #60A5FA;
    --info-bg: #1E3A5F;
    --bg: #0F172A;
    --bg-white: #1E293B;
    --text: #E2E8F0;
    --text-light: #94A3B8;
    --text-lighter: #64748B;
    --border: #334155;
    --border-light: #1E293B;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #0F172A;
    color: #E2E8F0;
    border-color: #334155;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #64748B;
}

[data-theme="dark"] .data-table tr:hover {
    background-color: #334155;
}

[data-theme="dark"] .color-dot {
    box-shadow: 0 0 0 2px #334155;
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 4px;
}

.theme-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

/* =========================================================
   V2 — STATUS BADGES
   ========================================================= */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-confirmed {
    background: var(--success-bg);
    color: var(--success);
}

.status-cancelled {
    background: var(--danger-bg);
    color: var(--danger);
}

.status-postponed {
    background: var(--warning-bg);
    color: var(--warning);
}

.row-cancelled td {
    opacity: 0.55;
    text-decoration: line-through;
}

.row-cancelled td:last-child {
    opacity: 1;
    text-decoration: none;
}

.event-cancelled {
    opacity: 0.5;
}

.card-cancelled {
    opacity: 0.6;
}

.badge-recurrence {
    font-size: 0.75rem;
    vertical-align: super;
}

/* =========================================================
   V2 — STATS DASHBOARD
   ========================================================= */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-accent {
    border-color: var(--primary);
    background: var(--primary-50);
}

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-top: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.stats-panel {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.stats-panel h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

/* Bar charts CSS */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-label {
    min-width: 100px;
    font-size: 0.82rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    flex: 1;
    height: 20px;
    background: var(--border-light);
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    min-width: 4px;
    transition: width 0.6s ease;
}

.bar-fill-alt { background: var(--info); }
.bar-fill-green { background: var(--success); }
.bar-fill-purple { background: #8B5CF6; }

.bar-value {
    min-width: 60px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: right;
    color: var(--text);
}

/* =========================================================
   V2 — RESULT CARDS & ROWS
   ========================================================= */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.results-count {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.display-toggle {
    display: flex;
    gap: 4px;
}

.results-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.result-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-card-clickable {
    cursor: pointer;
}

.result-row-clickable:hover {
    background-color: var(--primary-50);
}

.result-detail-btn {
    font-size: 0.8rem;
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.result-card-header h3 {
    font-size: 1rem;
    color: var(--text);
    margin: 0;
}

.result-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-light);
}

.result-card-body p {
    margin: 0;
}

.result-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 0.82rem;
}

/* =========================================================
   V2 — FORM FIELDSET & FILE INPUT
   ========================================================= */
.form-fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin: 18px 0;
    background: var(--bg);
}

.form-fieldset legend {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    padding: 0 8px;
}

.file-input {
    padding: 10px;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.file-input:hover {
    border-color: var(--primary);
    background: var(--primary-50);
}

.form-help {
    display: block;
    font-size: 0.78rem;
    color: var(--text-lighter);
    margin-top: 4px;
}

/* =========================================================
   V2 — ATTACHMENTS LIST
   ========================================================= */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}

.attachment-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.attachment-name {
    flex: 1;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    color: var(--text-lighter);
    font-size: 0.78rem;
    white-space: nowrap;
}

/* =========================================================
   V2 — PROFILE & SETTINGS PAGES
   ========================================================= */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

.settings-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.settings-section h3 {
    margin-bottom: 16px;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.form-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* =========================================================
   V2 — ALERT VARIANTS
   ========================================================= */
.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--info);
    border-radius: var(--radius);
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-warning ul,
.alert-info ul {
    margin-top: 8px;
    padding-left: 18px;
}

/* =========================================================
   V2 — AGENDA HEADER WITH ACTIONS
   ========================================================= */
.agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.agenda-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Event meta in week view */
.event-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Text muted */
.text-muted {
    color: var(--text-lighter);
    font-size: 0.85rem;
}
