/**
 * Dashboard — Active Accounts cards + Your Accounts table
 * Matches portal-shell / premium-design-system
 */

.dash-accounts-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.dash-accounts-section__title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.dash-accounts-section__desc {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #64748b;
    margin-bottom: 1.5rem;
    max-width: 52rem;
}

.dash-accounts-section__desc strong {
    color: #334155;
    font-weight: 600;
}

/* Card grid */
.dash-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
    gap: 1.25rem;
}

/* Account card */
.dash-acct-card {
    position: relative;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1rem;
    padding: 1.35rem 1.5rem;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 24px -6px rgba(79, 70, 229, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.dash-acct-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    opacity: 0.85;
}

.dash-acct-card--admin::before {
    background: linear-gradient(90deg, #dc2626, #f97316);
}

.dash-acct-card--passed::before {
    background: linear-gradient(90deg, #059669, #10b981);
}

.dash-acct-card.subscription-card-clickable {
    cursor: pointer;
}

.dash-acct-card.subscription-card-clickable:hover {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 16px 32px -8px rgba(79, 70, 229, 0.18);
    transform: translateY(-2px);
}

.dash-acct-card--admin {
    background: linear-gradient(145deg, #fff 0%, #fef2f2 100%);
    border-color: rgba(248, 113, 113, 0.35);
}

.dash-acct-card--passed {
    background: linear-gradient(145deg, #fff 0%, #ecfdf5 100%);
    border-color: rgba(52, 211, 153, 0.35);
}

.dash-acct-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dash-acct-card__plan {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.3;
    margin: 0;
}

.dash-acct-card__cta {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #4f46e5;
    white-space: nowrap;
}

.dash-acct-card__id-block {
    margin-bottom: 1.15rem;
}

.dash-acct-card__id-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.dash-acct-card__id-value {
    display: inline-flex;
    align-items: center;
    font-family: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #312e81;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 0.625rem;
    padding: 0.5rem 0.875rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Status block — single Rithmic account status */
.dash-status-block {
    margin-bottom: 1rem;
}

.dash-status-block__label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.dash-status-block--inline {
    margin-bottom: 0.75rem;
}

/* Status badges (legacy row — kept for eval inline) */
.dash-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dash-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    letter-spacing: 0.01em;
}

.dash-badge__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-badge--rithmic-active {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.dash-badge--rithmic-active .dash-badge__dot { background: #10b981; }

.dash-badge--rithmic-admin {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.28);
}
.dash-badge--rithmic-admin .dash-badge__dot { background: #ef4444; }

.dash-badge--rithmic-danger {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
    border: 1px solid rgba(220, 38, 38, 0.35);
}
.dash-badge--rithmic-danger .dash-badge__dot { background: #dc2626; }

.dash-badge--rithmic-neutral {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.dash-badge--rithmic-neutral .dash-badge__dot { background: #94a3b8; }

.dash-badge--portal {
    background: rgba(79, 70, 229, 0.08);
    color: #4338ca;
    border: 1px solid rgba(79, 70, 229, 0.15);
}
.dash-badge--portal .dash-badge__dot { background: #6366f1; }

.dash-badge--eval {
    background: rgba(6, 182, 212, 0.1);
    color: #0e7490;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.dash-badge--drawdown-eod {
    display: inline-block;
    margin-top: 0.35rem;
    background: rgba(20, 184, 166, 0.12);
    color: #0f766e;
    border: 1px solid rgba(20, 184, 166, 0.25);
    font-size: 0.6875rem;
}

.dash-badge--drawdown-trail {
    display: inline-block;
    margin-top: 0.35rem;
    background: rgba(99, 102, 241, 0.1);
    color: #4338ca;
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 0.6875rem;
}

.dash-acct-card__header > div:first-child {
    min-width: 0;
}

/* Meta grid */
.dash-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1.25rem;
    margin-bottom: 1.15rem;
}

@media (max-width: 480px) {
    .dash-meta-grid { grid-template-columns: 1fr; }
}

.dash-meta-item__label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

.dash-meta-item__value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
}

.dash-meta-item--wide {
    grid-column: 1 / -1;
}

/* PA passed banner */
.dash-pa-banner {
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(52, 211, 153, 0.06) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.dash-pa-banner:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(52, 211, 153, 0.1) 100%);
    border-color: rgba(16, 185, 129, 0.45);
}

.dash-pa-banner__title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #065f46;
    margin: 0 0 0.35rem;
}

.dash-pa-banner__text {
    font-size: 0.875rem;
    color: #047857;
    margin: 0 0 0.5rem;
    line-height: 1.5;
}

.dash-pa-banner__link {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Actions */
.dash-acct-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding-top: 0.25rem;
}

.dash-btn-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 0.75rem 1.25rem;
    min-height: 2.75rem;
    border-radius: 0.625rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.dash-btn-reset:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.dash-btn-reset:active {
    transform: translateY(0);
}

.dash-btn-reset--manual {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.dash-btn-reset--blown {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #78350f;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.dash-btn-reset--table {
    font-size: 0.8125rem;
    padding: 0.5rem 0.875rem;
    min-height: 2.25rem;
    width: 100%;
    max-width: 11rem;
}

.dash-acct-card__note {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0.5rem 0 0;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
}

.dash-acct-card__note--success {
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.dash-acct-card__note--danger {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.dash-acct-card__note--sync {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* Table wrapper */
.dash-table-wrap {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: #fff;
    box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.06);
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.dash-table thead {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.dash-table th {
    text-align: left;
    padding: 0.875rem 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.dash-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

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

.dash-table tbody tr.account-row-clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.dash-table tbody tr.account-row-clickable:hover {
    background: rgba(238, 242, 255, 0.7);
}

.dash-table tbody tr.account-row-admin-only {
    background: rgba(254, 242, 242, 0.5);
}

.dash-table tbody tr.account-row-admin-only:hover {
    background: rgba(254, 226, 226, 0.65);
}

.dash-table__account-id {
    font-family: ui-monospace, monospace;
    font-weight: 800;
    font-size: 0.9375rem;
    color: #3730a3;
    background: #eef2ff;
    padding: 0.35rem 0.6rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.dash-table__actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
}

.dash-ui-version {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.75rem;
}

.dash-loading {
    font-size: 0.9375rem;
    color: #64748b;
    padding: 1rem 0;
}

.dash-empty {
    font-size: 0.9375rem;
    color: #64748b;
    padding: 1.5rem;
    text-align: center;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1px dashed #e2e8f0;
}
