/* =============================================
   Dashboard Widgets – Shared Styles
   Brand: #011272 (deep blue) | #ff007f (hot pink)
   ============================================= */

/* ── Widget card ───────────────────────────── */
.dashboard-widget-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(1, 18, 114, 0.08);
    border-left: 4px solid #011272;
    padding: 20px 20px 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-widget-card.accent-pink   { border-left-color: #ff007f; }
.dashboard-widget-card.accent-green  { border-left-color: #4CAF50; }
.dashboard-widget-card.accent-teal   { border-left-color: #00BCD4; }
.dashboard-widget-card.accent-orange { border-left-color: #FF9800; }
.dashboard-widget-card.accent-purple { border-left-color: #9C27B0; }

/* ── Widget header ─────────────────────────── */
.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 700;
    color: #011272;
    line-height: 1.3;
}

.widget-title-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(1, 18, 114, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #011272;
    flex-shrink: 0;
}

.accent-pink   .widget-title-icon { background: rgba(255,  0, 127, 0.08); color: #ff007f; }
.accent-green  .widget-title-icon { background: rgba( 76, 175,  80, 0.08); color: #4CAF50; }
.accent-teal   .widget-title-icon { background: rgba(  0, 188, 212, 0.08); color: #00BCD4; }
.accent-orange .widget-title-icon { background: rgba(255, 152,   0, 0.08); color: #FF9800; }
.accent-purple .widget-title-icon { background: rgba(156,  39, 176, 0.08); color: #9C27B0; }

/* ── Expand button ──────────────────────────── */
.widget-expand-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(1, 18, 114, 0.12);
    background: transparent;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.widget-expand-btn:hover               { background: rgba(1,   18, 114, 0.06); color: #011272; }
.accent-pink   .widget-expand-btn:hover { background: rgba(255,  0, 127, 0.06); color: #ff007f; }
.accent-green  .widget-expand-btn:hover { background: rgba( 76, 175,  80, 0.06); color: #4CAF50; }
.accent-teal   .widget-expand-btn:hover { background: rgba(  0, 188, 212, 0.06); color: #00BCD4; }
.accent-orange .widget-expand-btn:hover { background: rgba(255, 152,   0, 0.06); color: #FF9800; }
.accent-purple .widget-expand-btn:hover { background: rgba(156,  39, 176, 0.06); color: #9C27B0; }

/* ── Fullscreen expand overlay ──────────────── */
.widget-expand-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9998;
    animation: dw-fadeIn 0.2s ease;
}

.dashboard-widget-card.widget-expanded,
.rating-widget-card.widget-expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 1100px);
    height: auto;
    max-height: 90vh;
    overflow: auto;
    z-index: 9999;
    border-radius: 20px;
    animation: dw-expandIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dw-expandIn {
    from { transform: translate(-50%, -50%) scale(0.88); opacity: 0; }
    to   { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
}

@keyframes dw-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Chart area ────────────────────────────── */
.widget-chart {
    width: 100%;
    min-height: 300px;
    flex: 1;
}

/* ── Empty state ────────────────────────────── */
.widget-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 240px;
    color: #adb5bd;
    font-size: 14px;
    font-weight: 500;
}

.widget-empty-icon {
    font-size: 40px;
    opacity: 0.3;
}

/* ── KPI summary row ───────────────────────── */
.dashboard-kpi-row {
    margin-bottom: 24px;
}

.kpi-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(1, 18, 114, 0.08);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(1, 18, 114, 0.13);
}

.kpi-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.kpi-blue   { background: rgba(1,   18, 114, 0.10); color: #011272; }
.kpi-pink   { background: rgba(255,  0, 127, 0.10); color: #ff007f; }
.kpi-green  { background: rgba( 76, 175,  80, 0.10); color: #4CAF50; }
.kpi-teal   { background: rgba(  0, 188, 212, 0.10); color: #00BCD4; }
.kpi-orange { background: rgba(255, 152,   0, 0.10); color: #FF9800; }

.kpi-body {
    flex: 1;
    min-width: 0;
}

.kpi-value {
    font-size: 26px;
    font-weight: 800;
    color: #011272;
    line-height: 1.1;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* KPI skeleton shimmer */
.kpi-value.loading {
    position: relative;
    overflow: hidden;
    color: transparent !important;
    background: #e9ecef;
    border-radius: 6px;
    min-width: 64px;
    min-height: 32px;
}

.kpi-value.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.65) 50%, transparent 100%);
    animation: dw-shimmer 1.4s infinite;
}

@keyframes dw-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.kpi-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ── Dashboard page header ──────────────────── */
.dashboard-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 0 2px;
}

.dashboard-page-header-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #011272 0%, #1a3aad 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(1, 18, 114, 0.28);
}

.dashboard-page-header-title {
    font-size: 22px;
    font-weight: 800;
    color: #011272;
    line-height: 1.2;
}

.dashboard-page-header-subtitle {
    font-size: 13px;
    color: #6c757d;
    margin-top: 3px;
}

/* ── Filter bar ────────────────────────────── */
.dashboard-filter-bar {
    background: linear-gradient(135deg, rgba(1, 18, 114, 0.03), rgba(255, 0, 127, 0.03));
    border-radius: 14px;
    border: 1px solid rgba(1, 18, 114, 0.09);
    padding: 12px 20px 4px;
    margin-bottom: 24px;
}

/* ── Date preset buttons ────────────────────── */
.date-preset-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.date-preset-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    margin-right: 2px;
}

.date-preset-btn {
    padding: 3px 13px;
    border-radius: 20px;
    border: 1px solid rgba(1, 18, 114, 0.2);
    background: transparent;
    color: #011272;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1.6;
}

.date-preset-btn:hover,
.date-preset-btn.active {
    background: #011272;
    color: #fff;
    border-color: #011272;
}

/* ── Rating widget improvements ────────────── */
.rating-widget-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(1, 18, 114, 0.08);
    border-left: 4px solid #FF9800;
    padding: 20px;
    height: 100%;
}

.rating-score-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.rating-score-big {
    font-size: 42px;
    font-weight: 900;
    color: #011272;
    line-height: 1;
}

.rating-score-max {
    font-size: 16px;
    color: #6c757d;
    font-weight: 500;
}

.rating-count-badge {
    background: rgba(1, 18, 114, 0.07);
    color: #011272;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 600;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.rating-bar-row:last-child { border-bottom: none; }

.rating-stars {
    display: flex;
    gap: 2px;
    width: 80px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.star-filled { color: #FF9800; font-size: 13px; }
.star-empty  { color: #ddd;    font-size: 13px; }

.rating-progress-track {
    flex: 1;
    height: 8px;
    background: #f0f0f0;
    border-radius: 99px;
    overflow: hidden;
}

.rating-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF9800, #FFD54F);
    border-radius: 99px;
    transition: width 0.6s ease;
}

.rating-pct {
    font-size: 12px;
    color: #6c757d;
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

/* ── ApexCharts overrides ───────────────────── */
.apexcharts-tooltip {
    border-radius: 10px !important;
    box-shadow: 0 4px 16px rgba(1, 18, 114, 0.15) !important;
}

.apexcharts-legend-text {
    font-size: 13px !important;
    font-weight: 500 !important;
}

/* Download toolbar icon — only show the download button */
.apexcharts-toolbar {
    top: -2px !important;
    right: 4px !important;
}

.apexcharts-menu-icon svg,
.apexcharts-download-icon svg {
    fill: #adb5bd;
    transition: fill 0.15s;
}

.apexcharts-menu-icon:hover svg,
.apexcharts-download-icon:hover svg {
    fill: #011272;
}
