/* =============================================
   ToolszAI — User Dashboard
   ============================================= */

.dashboard {
    padding: 120px 0 80px;
    position: relative;
    z-index: 1;
    min-height: 80vh;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    align-items: start;
}

/* === Sidebar === */
.dash-sidebar {
    position: sticky;
    top: 90px;
}

.dash-user-card {
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: center;
    margin-bottom: 16px;
}

.dash-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    border-radius: 50%;
    overflow: hidden;
}

.dash-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dash-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    font-size: 24px;
    font-weight: 800;
    color: white;
    font-family: 'Space Grotesk', sans-serif;
}

.dash-user-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.dash-user-card p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    word-break: break-all;
}

.dash-member-since {
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 20px;
}

/* Nav */
.dash-nav {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.dash-nav-item:hover {
    background: rgba(124, 58, 237, 0.06);
    color: var(--text-primary);
}

.dash-nav-item.active {
    background: rgba(124, 58, 237, 0.1);
    color: var(--primary-light);
}

.dash-nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.dash-nav-item.active svg,
.dash-nav-item:hover svg {
    color: var(--primary-light);
}

.dash-nav-badge {
    margin-left: auto;
    padding: 2px 7px;
    background: var(--primary);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    color: white;
}

.dash-nav-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.dash-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 8px;
}

.dash-nav-logout {
    color: #ef4444;
}
.dash-nav-logout:hover {
    background: rgba(239, 68, 68, 0.06);
    color: #ef4444;
}
.dash-nav-logout svg { color: #ef4444; }

/* === Main Content === */
.dash-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.dash-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.dash-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 36px 0 16px;
}

.dash-tab-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

/* Stats */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.dash-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: all 0.2s;
}

.dash-stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

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

.dash-stat-icon svg {
    width: 20px;
    height: 20px;
}

.dash-stat-num {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

.dash-stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Quick Actions */
.dash-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.dash-action-card {
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-align: center;
    transition: all 0.2s;
}

.dash-action-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.dash-action-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.dash-action-card strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.dash-action-card span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Table */
.dash-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
}

.dash-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
}

.dash-table tr:last-child td {
    border-bottom: none;
}

.dash-table tr:hover td {
    background: rgba(124, 58, 237, 0.02);
}

.dash-tool-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-tool-mini-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    flex-shrink: 0;
}

.dash-tool-cell a {
    color: var(--text-primary);
    font-weight: 600;
}
.dash-tool-cell a:hover { color: var(--primary-light); }

.dash-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-live    { background: rgba(16, 185, 129, 0.1); color: var(--neon-green); border: 1px solid rgba(16, 185, 129, 0.2); }
.status-pending { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.status-draft   { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); border: 1px solid var(--border); }

.dash-plan-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.dash-plan-free    { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); border: 1px solid var(--border); }
.dash-plan-premium { background: rgba(124, 58, 237, 0.1); color: var(--primary-light); border: 1px solid rgba(124, 58, 237, 0.2); }

/* Empty state */
.dash-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-top: 16px;
}

.dash-empty-icon { font-size: 48px; margin-bottom: 16px; }
.dash-empty h3 { font-family: 'Space Grotesk', sans-serif; font-size: 20px; margin-bottom: 8px; }
.dash-empty p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }

/* Notice */
.dash-notice {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.dash-notice-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--neon-green);
}

/* Form */
.dash-form { max-width: 600px; margin-top: 20px; }
.dash-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-form-group { margin-bottom: 20px; }
.dash-form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }

/* Inputs — dark theme */
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.06);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-input:disabled,
.form-input[readonly] {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: rgba(148, 163, 184, 0.08);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Settings */
.dash-settings-section {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.dash-settings-section h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
}

.dash-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    cursor: pointer;
    gap: 16px;
}

.dash-toggle-row strong { display: block; font-size: 14px; color: var(--text-primary); }
.dash-toggle-row span { font-size: 12px; color: var(--text-muted); }

.dash-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.dash-toggle input { opacity: 0; width: 0; height: 0; }

.dash-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 24px;
    cursor: pointer;
    transition: 0.3s;
}

.dash-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.dash-toggle input:checked + .dash-toggle-slider { background: var(--primary); }
.dash-toggle input:checked + .dash-toggle-slider::before { transform: translateX(20px); }

/* === Responsive === */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 220px 1fr;
        gap: 24px;
    }
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dash-sidebar {
        position: static;
    }

    .dash-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
        padding: 6px;
    }

    .dash-nav-item {
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 12px;
    }

    .dash-nav-divider { display: none; }
    .dash-nav-logout { display: none; }
    .dash-user-card { display: none; }

    .dash-stats { grid-template-columns: repeat(2, 1fr); }
    .dash-quick-actions { grid-template-columns: 1fr; }
    .dash-form-row { grid-template-columns: 1fr; }
    .dash-tab-header { flex-direction: column; }
}
