/* ==============================
 * PicViaI User - Dashboard
 * ============================== */

/* Welcome */
.pv-welcome {
    margin-bottom: 28px;
}

.pv-welcome h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--pv-text);
}

.pv-welcome p {
    font-size: 14px;
    color: var(--pv-text-muted);
    margin: 0;
}

/* Dashboard container */
.pv-dashboard {
    min-height: calc(100vh - 64px - 65px);
    padding: 32px 0 60px;
}

.pv-dashboard-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Stats Grid */
.pv-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.pv-stat-card {
    background: #fff;
    border-radius: var(--pv-radius);
    padding: 24px;
    border: 1px solid var(--pv-border);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--pv-transition);
}

.pv-stat-card:hover {
    box-shadow: var(--pv-shadow-md);
    transform: translateY(-2px);
}

.pv-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pv-stat-icon svg {
    width: 24px;
    height: 24px;
}

.pv-stat-icon.bg-indigo { background: var(--pv-primary-100); color: var(--pv-primary); }
.pv-stat-icon.bg-emerald { background: #d1fae5; color: var(--pv-success); }
.pv-stat-icon.bg-amber { background: #fef3c7; color: var(--pv-warning); }
.pv-stat-icon.bg-rose { background: #fee2e2; color: var(--pv-danger); }

.pv-stat-info {
    display: flex;
    flex-direction: column;
}

.pv-stat-label {
    font-size: 13px;
    color: var(--pv-text-muted);
    margin-bottom: 2px;
}

.pv-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--pv-text);
}

/* Two Column Grid */
.pv-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

/* Panel */
.pv-panel {
    background: #fff;
    border-radius: var(--pv-radius);
    border: 1px solid var(--pv-border);
    overflow: hidden;
}

.pv-panel + .pv-panel {
    margin-top: 20px;
}

.pv-panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--pv-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pv-panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--pv-text);
}

.pv-panel-badge {
    font-size: 12px;
    color: var(--pv-text-muted);
    background: var(--pv-bg);
    padding: 4px 10px;
    border-radius: 20px;
}

.pv-panel-body {
    padding: 20px 24px;
}

/* Empty State */
.pv-empty {
    text-align: center;
    padding: 32px 16px;
}

.pv-empty svg {
    width: 48px;
    height: 48px;
    color: var(--pv-text-muted);
    margin-bottom: 12px;
}

.pv-empty p {
    color: var(--pv-text-muted);
    font-size: 14px;
    margin: 0;
}

/* Model List */
.pv-model-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pv-model-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--pv-radius-sm);
    border: 1px solid var(--pv-border);
    transition: var(--pv-transition);
}

.pv-model-card:hover {
    border-color: var(--pv-primary-light);
    box-shadow: var(--pv-shadow);
}

.pv-model-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pv-model-icon svg {
    width: 22px;
    height: 22px;
}

.pv-model-icon.bg-indigo { background: var(--pv-primary-100); color: var(--pv-primary); }
.pv-model-icon.bg-emerald { background: #d1fae5; color: var(--pv-success); }

.pv-model-info {
    flex: 1;
    min-width: 0;
}

.pv-model-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--pv-text);
}

.pv-model-info p {
    font-size: 13px;
    color: var(--pv-text-muted);
    margin: 0 0 6px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pv-model-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pv-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--pv-bg);
    color: var(--pv-text-muted);
}

.pv-cost {
    font-size: 12px;
    color: var(--pv-primary);
    font-weight: 500;
}

/* Small Button */
.pv-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
}

/* Right Column */
.pv-right-col {
    display: flex;
    flex-direction: column;
}

/* Task Stats */
.pv-task-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.pv-task-stat-item {
    text-align: center;
    padding: 16px;
    border-radius: var(--pv-radius-sm);
    background: var(--pv-bg);
}

.pv-task-stat-num {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--pv-text);
    margin-bottom: 4px;
}

.pv-task-stat-num.text-success { color: var(--pv-success); }
.pv-task-stat-num.text-warning { color: var(--pv-warning); }
.pv-task-stat-num.text-danger { color: var(--pv-danger); }

.pv-task-stat-label {
    font-size: 13px;
    color: var(--pv-text-muted);
}

/* Task List */
.pv-task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pv-task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--pv-radius-sm);
    border: 1px solid var(--pv-border);
    transition: var(--pv-transition);
}

.pv-task-item:hover {
    border-color: var(--pv-primary-light);
}

.pv-task-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pv-task-status.status-success { background: var(--pv-success); }
.pv-task-status.status-failed { background: var(--pv-danger); }
.pv-task-status.status-pending { background: var(--pv-warning); }

.pv-task-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.pv-task-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--pv-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pv-task-time {
    font-size: 12px;
    color: var(--pv-text-muted);
}

.pv-task-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
    flex-shrink: 0;
}

.pv-task-badge.status-0,
.pv-task-badge.status-1 { background: #fef3c7; color: var(--pv-warning); }
.pv-task-badge.status-2 { background: #dbeafe; color: #3b82f6; }
.pv-task-badge.status-3 { background: #d1fae5; color: var(--pv-success); }
.pv-task-badge.status-4 { background: #fee2e2; color: var(--pv-danger); }
.pv-task-badge.status-5 { background: #f3f4f6; color: var(--pv-text-muted); }

/* Panel Header h5 (task list etc.) */
.pv-panel-header h5 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--pv-text);
}

/* Table */
.pv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pv-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--pv-text-muted);
    border-bottom: 1px solid var(--pv-border);
    background: var(--pv-bg);
    white-space: nowrap;
}

.pv-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--pv-border);
    vertical-align: middle;
}

.pv-table tbody tr:last-child td { border-bottom: none; }
.pv-table tbody tr { transition: var(--pv-transition); }
.pv-table tbody tr:hover { background: var(--pv-primary-50); }

/* Badges */
.pv-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.pv-badge-success { background: #d1fae5; color: #065f46; }
.pv-badge-warning { background: #fef3c7; color: #92400e; }
.pv-badge-danger  { background: #fee2e2; color: #991b1b; }
.pv-badge-info    { background: var(--pv-primary-100); color: var(--pv-primary-dark); }

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

@media (max-width: 768px) {
    .pv-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pv-welcome h2 { font-size: 20px; }
    .pv-stat-card { padding: 16px; }
    .pv-stat-value { font-size: 18px; }
    .pv-navbar-nav a { padding: 6px 10px; font-size: 13px; }
}
