/* Florijn Sprint 3 — Dashboard Grid CSS */

/* ═══ WIDGET GRID ═══ */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.dash-grid-3 { grid-template-columns: repeat(3, 1fr); }
.dash-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Widget sizes */
.widget { min-height: 0; }
.widget-1x1 { grid-column: span 1; }
.widget-2x1 { grid-column: span 2; }
.widget-3x1 { grid-column: span 3; }
.widget-4x1 { grid-column: span 4; }
.widget-2x2 { grid-column: span 2; grid-row: span 2; }

/* Widget card styling */
.widget-card {
    background: var(--card-bg, var(--card));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
}
.widget-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Widget header */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.widget-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.widget-icon {
    font-size: 14px;
}

/* KPI Widget */
.widget-kpi-value {
    font-size: 22px;
    font-weight: 900;
    line-height: 1.1;
    margin: 4px 0;
}
.widget-kpi-sub {
    font-size: 11px;
    color: var(--text3);
}
.widget-kpi-trend {
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: 6px;
}
.widget-kpi-trend.up { color: var(--ac); background: rgba(234,179,8,0.1); }
.widget-kpi-trend.down { color: var(--red); background: rgba(239,68,68,0.1); }

/* Chart Widget */
.widget-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 60px;
    margin-top: 8px;
}
.widget-chart-bar {
    flex: 1;
    background: var(--ac);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.4s ease;
    opacity: 0.7;
}
.widget-chart-bar:hover { opacity: 1; }
.widget-chart-bar.negative { background: var(--red); }

/* Mini sparkline */
.widget-spark {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    height: 24px;
}
.widget-spark-bar {
    flex: 1;
    background: var(--ac);
    border-radius: 1px;
    min-height: 1px;
    opacity: 0.5;
}

/* Donut chart */
.widget-donut {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.widget-donut-center {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg, var(--card));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    z-index: 1;
}

/* List widget */
.widget-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.widget-list-item:last-child { border-bottom: none; }

/* Progress ring */
.widget-ring {
    width: 52px;
    height: 52px;
    position: relative;
}

/* Quick actions grid */
.widget-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}
.widget-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border-radius: 8px;
    background: rgba(234,179,8,0.06);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 18px;
}
.widget-action-btn:hover {
    background: rgba(234,179,8,0.12);
    border-color: var(--ac);
}
.widget-action-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text2);
}

/* Dashboard toolbar */
.dash-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}
.dash-preset-btns {
    display: flex;
    gap: 4px;
}

/* Animated counter */
@keyframes countUp {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.widget-kpi-value { animation: countUp 0.3s ease; }

/* Staggered fade-in */
.widget-card { animation: widgetFadeIn 0.3s ease backwards; }
.dash-grid .widget-card:nth-child(1) { animation-delay: 0s; }
.dash-grid .widget-card:nth-child(2) { animation-delay: 0.05s; }
.dash-grid .widget-card:nth-child(3) { animation-delay: 0.1s; }
.dash-grid .widget-card:nth-child(4) { animation-delay: 0.15s; }
.dash-grid .widget-card:nth-child(5) { animation-delay: 0.2s; }
.dash-grid .widget-card:nth-child(6) { animation-delay: 0.25s; }
.dash-grid .widget-card:nth-child(7) { animation-delay: 0.3s; }
.dash-grid .widget-card:nth-child(8) { animation-delay: 0.35s; }
@keyframes widgetFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
    .dash-grid { grid-template-columns: repeat(2, 1fr); }
    .widget-2x2 { grid-column: span 2; }
    .widget-3x1, .widget-4x1 { grid-column: span 2; }
}
@media (max-width: 640px) {
    .dash-grid { grid-template-columns: 1fr; }
    .widget-2x1, .widget-2x2, .widget-3x1, .widget-4x1 { grid-column: span 1; grid-row: span 1; }
}
