/* WizBoard — Wiz View */

/* ── Layout ── */

#app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
}

.wiz-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Header ── */

.wiz-header {
    flex-shrink: 0;
    padding: 14px 20px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.wiz-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.wiz-title {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #8b5cf6, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wiz-refresh-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.wiz-refresh-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

/* ── Stats Strip ── */

.wiz-stats-strip {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wiz-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.wiz-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.wiz-stat-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

.wiz-stat-review .wiz-stat-value { color: var(--review-amber); }
.wiz-stat-auto .wiz-stat-value { color: #22c55e; }

.wiz-stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
    flex-shrink: 0;
    margin: 0 4px;
}

/* ── Tabs ── */

.wiz-tabs {
    display: flex;
    gap: 0;
    border-bottom: none;
}

.wiz-tab {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.wiz-tab:hover {
    color: var(--text);
}

.wiz-tab.active {
    color: var(--wiz-purple);
    border-bottom-color: var(--wiz-purple);
}

/* ── Sections ── */

.wiz-section {
    display: none;
    padding: 16px 20px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.wiz-section.active {
    display: block;
}

.wiz-loading {
    color: var(--text-muted);
    font-size: 13px;
    padding: 20px 0;
    text-align: center;
}

.wiz-empty {
    color: var(--text-dim);
    font-size: 13px;
    padding: 32px 0;
    text-align: center;
}

/* ── Task Groups ── */

.wiz-task-group {
    margin-bottom: 20px;
}

.wiz-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.wiz-group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wiz-group-name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.wiz-group-count {
    font-size: 11px;
    color: var(--text-dim);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1px 7px;
}

/* ── Task Cards ── */

.wiz-task-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wiz-task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.wiz-task-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--wiz-purple);
    transform: translateX(2px);
}

.wiz-task-review {
    border-left: 3px solid var(--review-amber);
}

.wiz-task-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 6px;
}

.wiz-task-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.prio-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.prio-critical { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.prio-high     { background: rgba(249, 115, 18, 0.15); color: #f97316; }
.prio-medium   { background: rgba(234, 179, 8, 0.12); color: #eab308; }
.prio-low      { background: rgba(107, 114, 128, 0.12); color: #9ca3af; }

.task-area {
    font-size: 11px;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
}

.task-type-badge {
    font-size: 10px;
    color: var(--wiz-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 4px;
    padding: 1px 6px;
    text-transform: capitalize;
}

.review-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--review-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 4px;
    padding: 1px 6px;
}

.due-overdue { font-size: 11px; color: #ef4444; }
.due-today   { font-size: 11px; color: var(--review-amber); }
.due-soon    { font-size: 11px; color: #22c55e; }
.due-normal  { font-size: 11px; color: var(--text-dim); }

/* ── Projects Grid ── */

.wiz-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.wiz-project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--wiz-purple);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.wiz-project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.wiz-project-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.wiz-project-status {
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: capitalize;
}

.wiz-project-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wiz-project-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.wiz-project-area {
    font-size: 11px;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 7px;
}

.wiz-project-continuous {
    font-size: 11px;
    color: var(--wiz-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 4px;
    padding: 1px 7px;
}

/* ── Automations List ── */

.wiz-autos-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wiz-auto-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.wiz-auto-disabled {
    opacity: 0.55;
}

.wiz-auto-indicator {
    flex-shrink: 0;
    padding-top: 2px;
}

.auto-dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.auto-dot-on  { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); }
.auto-dot-off { background: var(--backlog); }

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

.wiz-auto-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wiz-auto-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.4;
}

.wiz-auto-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.auto-cat {
    font-size: 11px;
    color: var(--wiz-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 4px;
    padding: 1px 6px;
    text-transform: capitalize;
}

.auto-schedule {
    font-size: 11px;
    color: var(--text-dim);
    font-family: monospace;
}

.auto-last-run {
    font-size: 11px;
    color: var(--text-dim);
    margin-left: auto;
}

.auto-last-run-never {
    color: var(--backlog);
}

/* ── Mobile adjustments ── */

@media (max-width: 600px) {
    .wiz-header {
        padding: 12px 14px 0;
    }

    .wiz-section {
        padding: 12px 14px;
    }

    .wiz-projects-grid {
        grid-template-columns: 1fr;
    }

    .wiz-stat-item {
        min-width: 46px;
        padding: 7px 8px;
    }
}
