/* Admin Panel Styles */
.admin-body {
    background: #FDFBF7;
    min-height: 100vh;
}

/* Login */
.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 3rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(58, 46, 43, 0.1);
    text-align: center;
}

.login-card h1 {
    color: #3A2E2B;
    margin-bottom: 0.5rem;
}

.login-card p {
    color: #7a6a65;
    margin-bottom: 2rem;
}

.login-card input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #e8ddd6;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.login-card input:focus {
    outline: none;
    border-color: #C97A63;
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: #C97A63;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #b56a54;
}

.error {
    color: #d63031;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* Header */
.admin-header {
    background: #fff;
    border-bottom: 1px solid #e8ddd6;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #7a6a65;
    transition: all 0.2s;
}

.tab:hover {
    background: #F3ECE2;
}

.tab.active {
    background: #C97A63;
    color: #fff;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid #e8ddd6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #7a6a65;
    margin-left: 1rem;
}

.btn-logout:hover {
    border-color: #d63031;
    color: #d63031;
}

/* Main */
.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 12px rgba(58, 46, 43, 0.06);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #C97A63;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #7a6a65;
}

/* Filters */
.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e8ddd6;
    border-radius: 6px;
    font-size: 0.875rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: #F3ECE2;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #3A2E2B;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #e8ddd6;
}

/* Reservation Cards */
.reservations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reservation-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(58, 46, 43, 0.05);
    border-left: 4px solid #e8ddd6;
}

.reservation-card:has(.badge-confirmee) {
    border-left-color: #00b894;
}

.reservation-card:has(.badge-en_attente) {
    border-left-color: #fdcb6e;
}

.reservation-card:has(.badge-annulee) {
    border-left-color: #d63031;
}

.rc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.rc-header strong {
    color: #3A2E2B;
}

.rc-details {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: #7a6a65;
    margin-bottom: 0.5rem;
}

.rc-contact {
    font-size: 0.8rem;
    color: #9a8a85;
    margin-bottom: 0.75rem;
}

.rc-contact a {
    color: #C97A63;
    text-decoration: none;
}

.rc-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: 5px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.btn-confirm {
    background: #00b894;
    color: #fff;
}

.btn-cancel {
    background: #fdcb6e;
    color: #3A2E2B;
}

.btn-done {
    background: #74b9ff;
    color: #fff;
}

.btn-delete {
    background: none;
    border: 1px solid #e8ddd6;
    color: #d63031;
}

.btn-delete:hover {
    background: #ffeaea;
}

/* Badges */
.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-en_attente {
    background: #ffeaa7;
    color: #6c5a00;
}

.badge-confirmee {
    background: #dfe6e9;
    color: #00704a;
    background: #d4f5e9;
}

.badge-annulee {
    background: #ffeaea;
    color: #d63031;
}

.badge-terminee {
    background: #dfe6e9;
    color: #2d3436;
}

/* Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(58, 46, 43, 0.05);
}

.admin-table th {
    background: #F3ECE2;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    color: #7a6a65;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0ebe5;
    font-size: 0.875rem;
    color: #3A2E2B;
}

.admin-table a {
    color: #C97A63;
    text-decoration: none;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.page-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e8ddd6;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.875rem;
}

.page-btn.active {
    background: #C97A63;
    color: #fff;
    border-color: #C97A63;
}

/* ─── AGENDA ─────────────────────────────────────────────────────────────── */

.agenda-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.agenda-toolbar h2 {
    min-width: 200px;
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #3A2E2B;
}

.btn-cal-arrow {
    width: 36px;
    height: 36px;
    border: 1px solid #e8ddd6;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    color: #3A2E2B;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-cal-arrow:hover {
    background: #F3ECE2;
    border-color: #C97A63;
}

.agenda-view-toggle {
    display: flex;
    border: 1px solid #e8ddd6;
    border-radius: 8px;
    overflow: hidden;
    margin-left: auto;
}

.agenda-view-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    color: #7a6a65;
    transition: all 0.2s;
}

.agenda-view-btn.active {
    background: #C97A63;
    color: #fff;
}

/* Week Grid */
.agenda-week-grid {
    display: grid;
    grid-template-columns: 60px repeat(6, 1fr);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(58, 46, 43, 0.06);
    overflow: hidden;
    min-height: 600px;
    position: relative;
}

.agenda-day-grid {
    display: grid;
    grid-template-columns: 60px 1fr;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(58, 46, 43, 0.06);
    overflow: hidden;
    min-height: 600px;
    position: relative;
}

.agenda-time-col {
    border-right: 1px solid #f0ebe5;
}

.agenda-time-slot {
    height: 60px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
    font-size: 0.7rem;
    color: #9a8a85;
    border-bottom: 1px solid #f8f4f0;
}

.agenda-day-col {
    position: relative;
    border-right: 1px solid #f0ebe5;
    min-height: 660px;
}

.agenda-day-col:last-child {
    border-right: none;
}

.agenda-day-header {
    text-align: center;
    padding: 0.75rem 0.25rem;
    border-bottom: 1px solid #f0ebe5;
    background: #FDFBF7;
    position: sticky;
    top: 0;
    z-index: 2;
}

.agenda-day-header .day-name {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9a8a85;
}

.agenda-day-header .day-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: #3A2E2B;
    line-height: 1.2;
}

.agenda-day-header.is-today .day-number {
    background: #C97A63;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.agenda-day-body {
    position: relative;
    height: 660px;
}

.agenda-hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: #f0ebe5;
}

.agenda-event {
    position: absolute;
    left: 3px;
    right: 3px;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 0.7rem;
    line-height: 1.3;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    z-index: 1;
}

.agenda-event:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.agenda-event .event-time {
    font-weight: 600;
    opacity: 0.9;
}

.agenda-event .event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-event .event-client {
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Event Colors by status */
.agenda-event.status-confirmee {
    background: #d4f5e9;
    border-left: 3px solid #00b894;
    color: #00704a;
}

.agenda-event.status-en_attente {
    background: #fff3cd;
    border-left: 3px solid #fdcb6e;
    color: #6c5a00;
}

.agenda-event.status-terminee {
    background: #e8eaed;
    border-left: 3px solid #95a5a6;
    color: #5a6c6e;
}

.agenda-event.status-annulee {
    background: #ffeaea;
    border-left: 3px solid #d63031;
    color: #d63031;
    opacity: 0.6;
    text-decoration: line-through;
}

/* Now indicator */
.agenda-now-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #d63031;
    z-index: 3;
}

.agenda-now-line::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d63031;
}

/* Utilities */
.hidden {
    display: none !important;
}

.muted {
    color: #9a8a85;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-nav {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .tab {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters {
        flex-direction: column;
    }

    .rc-details {
        flex-direction: column;
        gap: 0.25rem;
    }

    .admin-main {
        padding: 1rem;
    }

    /* Agenda mobile → force day view */
    .agenda-week-grid {
        grid-template-columns: 50px 1fr;
    }

    .agenda-week-grid .agenda-day-col:not(.agenda-day-col-active) {
        display: none;
    }

    .agenda-toolbar h2 {
        min-width: unset;
        font-size: 1rem;
    }

    .agenda-view-toggle {
        margin-left: 0;
    }

    .agenda-event {
        font-size: 0.65rem;
        padding: 3px 5px;
    }
}

.gcal-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px;
  background: #F3ECE2;
  border-bottom: 1px solid #e0d5c5;
  font-size: 0.8rem;
}

.gcal-badge {
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
}

.gcal-badge.gcal-loading { background: #eee; color: #888; }
.gcal-badge.gcal-connected { background: #d4edda; color: #155724; }
.gcal-badge.gcal-disconnected { background: #f8d7da; color: #721c24; }

.btn-gcal-connect {
  font-size: 0.75rem;
  padding: 3px 10px;
  background: #4285F4;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-gcal-connect:hover { background: #1967D2; }

.agenda-gcal-event {
  background: #4285F4 !important;
  color: white !important;
  border-left: 3px solid #1967D2 !important;
  opacity: 0.88;
  font-style: italic;
}

.agenda-gcal-event .event-client {
  font-size: 0.65rem;
  opacity: 0.8;
}
