/* Enquiry Analytics Dashboard */

.ea-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Filter Panel ── */
.ea-filter-panel {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.ea-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    user-select: none;
}

.ea-filter-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--primary);
}

.ea-filter-header h3 i {
    margin-right: 0.5rem;
}

.ea-filter-collapse {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem;
    transition: transform 0.2s;
}

.ea-filter-body {
    padding: 0 1.25rem 1rem;
    transition: max-height 0.3s ease;
}

.ea-filter-body.collapsed {
    display: none;
}

.ea-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.ea-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ea-filter-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ea-input,
.ea-select {
    padding: 0.4rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
    color: #333;
    transition: border-color 0.2s;
}

.ea-input:focus,
.ea-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(15, 52, 96, 0.12);
}

.ea-select[multiple] {
    min-height: 60px;
    max-height: 100px;
}

.ea-date-range,
.ea-price-range {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.ea-date-range .ea-input,
.ea-price-range .ea-input {
    flex: 1;
    min-width: 0;
}

.ea-range-sep {
    font-size: 0.8rem;
    color: #888;
}

.ea-range-presets {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.2rem;
}

.ea-preset-btn {
    padding: 0.2rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    color: #555;
}

.ea-preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.ea-preset-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.ea-filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-end;
}

.ea-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.ea-btn-primary {
    background: var(--primary);
    color: #fff;
}

.ea-btn-primary:hover {
    background: #0c2a4d;
}

.ea-btn-secondary {
    background: #eee;
    color: #555;
}

.ea-btn-secondary:hover {
    background: #ddd;
}

/* ── KPI Cards ── */
.ea-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
}

.ea-kpi-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

.ea-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.ea-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(15, 52, 96, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--primary);
    flex-shrink: 0;
}

.ea-kpi-body {
    min-width: 0;
}

.ea-kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.ea-kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Charts Grid ── */
.ea-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.ea-chart-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}

.ea-chart-wide {
    grid-column: 1 / -1;
}

.ea-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.ea-chart-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.ea-chart-toggle {
    display: flex;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.ea-toggle-btn {
    padding: 0.2rem 0.6rem;
    border: none;
    background: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    color: #666;
    transition: all 0.15s;
}

.ea-toggle-btn:not(:last-child) {
    border-right: 1px solid #ddd;
}

.ea-toggle-btn.active {
    background: var(--primary);
    color: #fff;
}

.ea-chart-body {
    padding: 0.75rem 1rem 1rem;
    position: relative;
    min-height: 260px;
}

.ea-chart-body canvas {
    width: 100% !important;
    max-height: 300px;
}

.ea-chart-wide .ea-chart-body canvas {
    max-height: 250px;
}

.ea-chart-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #aaa;
    font-size: 0.9rem;
}

/* ── Sidebar sub-link ── */
.sidebar-link--sub {
    padding-left: 2.8rem !important;
    font-size: 0.88rem;
}

.sidebar-link--sub i {
    font-size: 0.82rem;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .ea-charts-grid {
        grid-template-columns: 1fr;
    }
    .ea-chart-wide {
        grid-column: 1;
    }
}

@media (max-width: 600px) {
    .ea-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ea-filter-grid {
        grid-template-columns: 1fr;
    }
}

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