/* ============================================
   Admin Dashboard Styles
   ============================================ */

/* --- Login --- */
.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f1724 0%, #1a2a4a 50%, #0f1724 100%);
    padding: 2rem;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 3rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.8rem;
    color: #1a2a4a;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
}

.password-wrapper {
    position: relative;
}

.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
}

.btn-login {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.login-footer a {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.9rem;
}

/* --- Dashboard --- */
.admin-dashboard {
    padding: 6rem 0 3rem;
    min-height: 100vh;
    background: #f4f6fb;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.welcome-msg h2 {
    color: #1a2a4a;
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
}

.welcome-msg p {
    color: #666;
}

.dashboard-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dashboard-actions button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-refresh {
    background: #e0e7ff;
    color: #3730a3;
}

.btn-refresh:hover {
    background: #c7d2fe;
}

.btn-export {
    background: #d1fae5;
    color: #065f46;
}

.btn-export:hover {
    background: #a7f3d0;
}

.btn-logout {
    background: #fee2e2;
    color: #991b1b;
}

.btn-logout:hover {
    background: #fecaca;
}

/* --- Stats --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.stat-icon {
    font-size: 2.2rem;
}

.stat-info h3 {
    font-size: 2rem;
    color: #1a2a4a;
    margin: 0;
    line-height: 1;
}

.stat-info p {
    color: #888;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* --- Filters --- */
.filters-bar {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.search-box input:focus {
    outline: none;
    border-color: #2563eb;
}

.filter-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-controls select,
.filter-controls input[type="date"] {
    padding: 0.65rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
}

.filter-controls select:focus,
.filter-controls input[type="date"]:focus {
    outline: none;
    border-color: #2563eb;
}

/* --- View Toggle --- */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.view-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.view-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* --- Table --- */
.bookings-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.bookings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.bookings-table thead {
    background: #1a2a4a;
    color: #fff;
}

.bookings-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.bookings-table td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.bookings-table tr:hover {
    background: #f8faff;
}

.bookings-table tr.cancelled {
    opacity: 0.5;
}

.bookings-table a {
    color: #2563eb;
    text-decoration: none;
}

.btn-view {
    padding: 0.4rem 0.9rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-view:hover {
    background: #1d4ed8;
}

/* --- Badges --- */
.badge {
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-confirmed {
    background: #d1fae5;
    color: #065f46;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* --- No Bookings / Loading --- */
.no-bookings {
    text-align: center;
    padding: 3rem;
    color: #888;
    font-size: 1.1rem;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-row {
    text-align: center;
    color: #dc2626;
    padding: 2rem !important;
}

/* --- Calendar --- */
.calendar-view {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.calendar-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.cal-nav-btn {
    background: #e0e7ff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.cal-nav-btn:hover {
    background: #c7d2fe;
}

.calendar-nav h3 {
    font-size: 1.3rem;
    color: #1a2a4a;
    min-width: 180px;
    text-align: center;
}

.calendar-grid,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-header {
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #666;
    padding: 0.5rem;
    text-transform: uppercase;
}

.cal-day {
    min-height: 90px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 0.4rem;
    font-size: 0.8rem;
    position: relative;
    overflow: hidden;
    transition: background 0.2s;
}

.cal-day:hover {
    background: #f8faff;
}

.cal-empty {
    border: none;
    background: transparent;
}

.cal-today {
    background: #eff6ff;
    border-color: #2563eb;
}

.cal-day-num {
    font-weight: 700;
    color: #333;
    font-size: 0.9rem;
}

.cal-today .cal-day-num {
    color: #2563eb;
}

.cal-booking-indicator {
    background: #2563eb;
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    margin-top: 4px;
    display: inline-block;
    font-weight: 600;
}

.cal-booking-mini {
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.7rem;
    margin-top: 2px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-booking-mini:hover {
    background: #c7d2fe;
}

.cal-more {
    font-size: 0.7rem;
    color: #2563eb;
    margin-top: 2px;
    font-weight: 600;
}

/* --- Modal --- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    margin: 0;
    color: #1a2a4a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 1.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.detail-item label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.detail-item p {
    color: #1a2a4a;
    font-size: 0.95rem;
    margin: 0;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.modal-actions {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    border-top: 1px solid #f0f0f0;
}

.modal-actions button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-confirm {
    background: #d1fae5;
    color: #065f46;
}

.btn-confirm:hover {
    background: #a7f3d0;
}

.btn-cancel {
    background: #fef3c7;
    color: #92400e;
}

.btn-cancel:hover {
    background: #fde68a;
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
    margin-left: auto;
}

.btn-delete:hover {
    background: #fecaca;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-bar {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }

    .filter-controls {
        width: 100%;
    }

    .filter-controls select,
    .filter-controls input[type="date"] {
        flex: 1;
        min-width: 120px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .cal-day {
        min-height: 60px;
        font-size: 0.7rem;
    }

    .cal-booking-mini {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-delete {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}