/* dashboard-grid.css — Reusable drag-and-drop dashboard card grid */

/* ── Toolbar ─────────────────────────────────────────── */
.ch-dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 0;
}
.ch-dashboard-toolbar-btn {
    background: var(--bg-surface, #242424);
    border: 1px solid var(--border, #2e2e2e);
    color: var(--text-secondary, #888);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ch-dashboard-toolbar-btn:hover {
    background: var(--bg-hover, #2a2a2a);
    color: var(--text-primary, #e5e5e5);
    border-color: var(--accent, #00B4EA);
}

/* ── Grid ────────────────────────────────────────────── */
.ch-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 4px 0 24px;
}
@media (max-width: 1024px) {
    .ch-dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .ch-dashboard-grid { grid-template-columns: 1fr; }
}

/* ── Card ────────────────────────────────────────────── */
.ch-dashboard-card {
    background: var(--bg-surface, #242424);
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 8px;
    overflow: hidden;
    transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.ch-dashboard-card.dragging {
    opacity: 0.45;
}
.ch-dashboard-card.drag-over {
    border-color: var(--accent, #00B4EA);
    box-shadow: 0 0 0 2px rgba(0, 180, 234, 0.25);
}

/* ── Card header ─────────────────────────────────────── */
.ch-dashboard-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border, #2e2e2e);
    user-select: none;
}
.ch-dashboard-card-drag {
    cursor: grab;
    color: var(--text-muted, #555);
    font-size: 12px;
    line-height: 1;
    flex-shrink: 0;
    letter-spacing: -1px;
}
.ch-dashboard-card-drag:active { cursor: grabbing; }

.ch-dashboard-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e5e5e5);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ch-dashboard-card-close {
    background: none;
    border: none;
    color: var(--text-muted, #555);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.ch-dashboard-card-close:hover {
    color: var(--text-primary, #e5e5e5);
    background: var(--bg-hover, #2a2a2a);
}

/* ── Card body ───────────────────────────────────────── */
.ch-dashboard-card-body {
    padding: 10px 12px;
    min-height: 100px;
    font-size: 13px;
    color: var(--text-primary, #e5e5e5);
}

/* ── Empty state inside card ─────────────────────────── */
.ch-dashboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 8px;
    text-align: center;
    min-height: 80px;
}
.ch-dashboard-empty-icon {
    font-size: 24px;
    opacity: 0.4;
}
.ch-dashboard-empty-text {
    font-size: 12px;
    color: var(--text-muted, #555);
    line-height: 1.4;
}
.ch-dashboard-empty-btn {
    background: none;
    border: 1px dashed var(--border, #2e2e2e);
    color: var(--text-secondary, #888);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 4px;
    transition: border-color 0.15s, color 0.15s;
}
.ch-dashboard-empty-btn:hover {
    border-color: var(--accent, #00B4EA);
    color: var(--text-primary, #e5e5e5);
}

/* ── Item rows inside cards ──────────────────────────── */
.ch-dashboard-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.1s;
    border-radius: 3px;
}
.ch-dashboard-item:last-child { border-bottom: none; }
.ch-dashboard-item:hover { background: var(--bg-hover, #2a2a2a); }

.ch-dashboard-item-icon {
    font-size: 14px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    color: var(--text-muted, #555);
}
.ch-dashboard-item-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ch-dashboard-item-meta {
    font-size: 11px;
    color: var(--text-muted, #555);
    flex-shrink: 0;
}
.ch-dashboard-item.done .ch-dashboard-item-title {
    text-decoration: line-through;
    opacity: 0.6;
}

/* ── List table (for the Lists card) ─────────────────── */
.ch-dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.ch-dashboard-table th {
    text-align: left;
    font-weight: 500;
    color: var(--text-muted, #555);
    padding: 4px 6px;
    border-bottom: 1px solid var(--border, #2e2e2e);
    white-space: nowrap;
}
.ch-dashboard-table td {
    padding: 5px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}
.ch-dashboard-table tr:hover td {
    background: var(--bg-hover, #2a2a2a);
}
.ch-dashboard-color-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.ch-dashboard-progress-bar {
    width: 60px;
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}
.ch-dashboard-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent, #00B4EA);
}
.ch-dashboard-more {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted, #555);
    padding: 6px 0 2px;
}
