/**
 * Wahra Rentals & Bookings — Admin Analytics Styles
 *
 * @package WahraRentalsBookings
 */

/* ==========================================================================
   Layout
   ========================================================================== */
.wahrb-aa {
    max-width: 1280px;
}

/* ==========================================================================
   Filters bar
   ========================================================================== */
.wahrb-aa-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin: 16px 0 20px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.wahrb-aa-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wahrb-aa-filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.wahrb-aa-filter-group select {
    height: 36px;
    min-width: 160px;
    padding: 0 32px 0 10px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 8px center/14px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color .15s;
}

.wahrb-aa-filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .15);
}

/* ==========================================================================
   Loading state
   ========================================================================== */
.wahrb-aa-loading {
    padding: 40px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* ==========================================================================
   KPI cards
   ========================================================================== */
.wahrb-aa-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.wahrb-aa-kpi {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    transition: box-shadow .15s;
}

.wahrb-aa-kpi:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.wahrb-aa-kpi-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.wahrb-aa-kpi--bookings .wahrb-aa-kpi-icon { background: #eff6ff; }
.wahrb-aa-kpi--revenue .wahrb-aa-kpi-icon  { background: #ecfdf5; }
.wahrb-aa-kpi--rate .wahrb-aa-kpi-icon     { background: #fefce8; }
.wahrb-aa-kpi--vendors .wahrb-aa-kpi-icon  { background: #f5f3ff; }

.wahrb-aa-kpi-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wahrb-aa-kpi-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.wahrb-aa-kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: visible;
    line-height: 1.3;
}

/* ==========================================================================
   Activity badges
   ========================================================================== */
.wahrb-aa-activity {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.wahrb-aa-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.wahrb-aa-badge strong {
    font-size: 15px;
    color: #1e293b;
}

.wahrb-aa-badge--upcoming { border-left: 3px solid #3b82f6; }
.wahrb-aa-badge--checkin  { border-left: 3px solid #10b981; }
.wahrb-aa-badge--checkout { border-left: 3px solid #f59e0b; }

/* ==========================================================================
   Tabs
   ========================================================================== */
.wahrb-aa-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 0;
    background: #fff;
    padding: 0 4px;
    border-radius: 8px 8px 0 0;
    border: 1px solid #e2e8f0;
    border-bottom-width: 2px;
}

.wahrb-aa-tab {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.wahrb-aa-tab:hover {
    color: #1e293b;
    background: #f8fafc;
}

.wahrb-aa-tab--active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 600;
}

/* ==========================================================================
   Panels (tab content)
   ========================================================================== */
.wahrb-aa-panel {
    display: none;
    padding: 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.wahrb-aa-panel--active {
    display: block;
}

/* ==========================================================================
   Sections
   ========================================================================== */
.wahrb-aa-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.wahrb-aa-section:last-child {
    margin-bottom: 0;
}

.wahrb-aa-section h3 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

/* ==========================================================================
   Status breakdown grid
   ========================================================================== */
.wahrb-aa-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.wahrb-aa-status-card {
    padding: 14px 16px;
    background: #fff;
    border-radius: 8px;
    text-align: center;
    transition: transform .1s;
}

.wahrb-aa-status-card:hover {
    transform: translateY(-1px);
}

.wahrb-aa-status-count {
    font-size: 28px;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.wahrb-aa-status-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    display: block;
}

/* ==========================================================================
   Charts
   ========================================================================== */
.wahrb-aa-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wahrb-aa-chart-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 24px;
}

.wahrb-aa-chart-card h3 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.wahrb-aa-chart-wrap {
    height: 280px;
    position: relative;
}

.wahrb-aa-chart-wrap--small {
    height: 220px;
    position: relative;
    margin-bottom: 16px;
}

/* ==========================================================================
   Breakdown grid (Products & Categories tab)
   ========================================================================== */
.wahrb-aa-breakdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wahrb-aa-cat-table {
    margin-top: 8px;
}

/* Top products table improvements */
.wahrb-aa-section .wp-list-table {
    border-radius: 6px;
    overflow: hidden;
}

.wahrb-aa-section .wp-list-table thead th {
    background: #f1f5f9;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 10px 12px;
}

.wahrb-aa-section .wp-list-table td {
    padding: 10px 12px;
    font-size: 13px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .wahrb-aa-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
    .wahrb-aa-charts-row,
    .wahrb-aa-breakdown-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .wahrb-aa-kpis {
        grid-template-columns: 1fr;
    }
    .wahrb-aa-filters {
        flex-direction: column;
    }
    .wahrb-aa-tabs {
        overflow-x: auto;
    }
    .wahrb-aa-panel {
        padding: 16px;
    }
}
