/* Dashboard Personalizable — grid layout + cards + composer */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-grid--composer {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.dashboard-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
}

.dashboard-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-card--sm {
    grid-column: span 1;
}

.dashboard-card--md {
    grid-column: span 1;
}

.dashboard-card--lg {
    grid-column: span 2;
}

.dashboard-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.75rem;
}

.dashboard-card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-strong);
}

.dashboard-card__remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.dashboard-card__remove:hover {
    color: var(--status-danger-fg);
}

.dashboard-card__body {
    flex: 1;
    font-size: 0.9rem;
}

/* KPI Cards */
.kpi-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.kpi-card__label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.kpi-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 0.5rem;
}

.kpi-card__hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* Composer mode */
.dashboard-composer {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 0;
}

.dashboard-composer__toolbar {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.dashboard-composer__action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-strong);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.dashboard-composer__action-button:hover {
    background: var(--surface-soft);
    border-color: var(--accent-primary);
}

/* Empty state */
.dashboard-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.dashboard-empty__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.dashboard-empty__title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.5rem;
}

/* Card wrapper for drag-drop */
.dashboard-card-wrapper {
    position: relative;
}

.dashboard-card-wrapper--draggable {
    cursor: move;
    opacity: 1;
    transition: opacity 0.2s;
}

.dashboard-card-wrapper--draggable:hover {
    opacity: 0.9;
}

.dashboard-card-wrapper--draggable[draggable="true"]:active {
    opacity: 0.7;
}

.dashboard-card-wrapper__remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.dashboard-card-wrapper__remove:hover {
    background: rgba(220, 38, 38, 1);
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card--lg {
        grid-column: span 1;
    }
}
