.reid-ca {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.25rem;
    background: #fff;
}

/* Header */
.reid-ca-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.reid-ca-header h2 {
    margin: 0;
    font-size: 1.1rem;
}
.reid-ca-company-name {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #e6f4ea;
    color: #188038;
}

/* Current user role */
.reid-ca-current-role {
    font-size: 0.82rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

/* Role badges */
.reid-ca-role-badge {
    display: inline-block;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.reid-ca-role-admin {
    background: #ede9fe;
    color: #7c3aed;
}
.reid-ca-role-pm {
    background: #dbeafe;
    color: #2563eb;
}
.reid-ca-role-agent {
    background: #d1fae5;
    color: #059669;
}
.reid-ca-role-readonly {
    background: #f3f4f6;
    color: #6b7280;
}
.reid-ca-role-none {
    background: #f3f4f6;
    color: #9ca3af;
}

/* Self badge */
.reid-ca-self-badge {
    display: inline-block;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 6px;
    font-weight: 700;
    background: #fef3c7;
    color: #92400e;
    margin-left: 4px;
    vertical-align: middle;
}

/* Status dot */
.reid-ca-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.reid-ca-dot-on {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.reid-ca-dot-off {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Status message */
.reid-ca-status-msg {
    font-size: 0.78rem;
    padding: 0;
    min-height: 0;
    transition: all 0.2s;
}
.reid-ca-status-msg:not(:empty) {
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
}
.reid-ca-status-msg.ok {
    background: #d1fae5;
    color: #065f46;
}
.reid-ca-status-msg.err {
    background: #fee2e2;
    color: #991b1b;
}

/* Roster */
.reid-ca-roster {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Agent card */
.reid-ca-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color 0.15s;
}
.reid-ca-card:hover {
    border-color: #10b981;
}
.reid-ca-card-disabled {
    opacity: 0.6;
}

.reid-ca-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.reid-ca-card-info {
    flex: 1;
    min-width: 0;
}

.reid-ca-card-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reid-ca-card-email,
.reid-ca-card-phone {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reid-ca-card-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Meta line (property count) */
.reid-ca-card-meta {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #9ca3af;
}
.reid-ca-prop-count {
    font-weight: 600;
}

/* Card actions */
.reid-ca-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
    flex-wrap: wrap;
}
.reid-ca-action-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

/* Role select dropdown */
.reid-ca-role-select {
    padding: 3px 8px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 0.75rem;
    background: #fff;
    color: #374151;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}
.reid-ca-role-select:focus {
    border-color: #7c3aed;
}
.reid-ca-role-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Buttons */
.reid-ca-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: #374151;
    transition: all 0.15s;
}
.reid-ca-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}
.reid-ca-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reid-ca-btn-enable {
    background: #059669;
    border-color: #059669;
    color: #fff;
}
.reid-ca-btn-enable:hover {
    background: #047857;
}

.reid-ca-btn-disable {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}
.reid-ca-btn-disable:hover {
    background: #dc2626;
}

/* Empty / guest states */
.reid-ca-guest,
.reid-ca-empty,
.reid-ca-empty-team {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.25rem;
    background: #fff;
    text-align: center;
    color: #666;
    font-size: 13px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ===== Accordion section ===== */
.reid-ca-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 0.6rem;
}

.reid-ca-section > summary {
    cursor: pointer;
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    list-style: none;
    color: #333;
    background: #fafafa;
    border-left: 4px solid #059669;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s;
}
.reid-ca-section > summary:hover { background: #f0f3f5; }
.reid-ca-section > summary::-webkit-details-marker { display: none; }

.reid-ca-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.reid-ca-section-body {
    padding: 0.75rem 1rem;
    background: #f7f8fa;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .reid-ca-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .reid-ca-card-top {
        flex-direction: column;
    }
    .reid-ca-card-right {
        margin-top: 4px;
    }
    .reid-ca-card-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Dark Mode ===== */
[data-bs-theme="dark"] .reid-ca,
[data-theme="dark"] .reid-ca,
.dark-mode .reid-ca {
    background: #1e1e1e;
    border-color: #444;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .reid-ca-company-name,
[data-theme="dark"] .reid-ca-company-name,
.dark-mode .reid-ca-company-name {
    background: #0d3320;
    color: #34d399;
}

[data-bs-theme="dark"] .reid-ca-current-role,
[data-theme="dark"] .reid-ca-current-role,
.dark-mode .reid-ca-current-role {
    color: #999;
}

[data-bs-theme="dark"] .reid-ca-role-admin,
[data-theme="dark"] .reid-ca-role-admin,
.dark-mode .reid-ca-role-admin {
    background: #2e1065;
    color: #a78bfa;
}

[data-bs-theme="dark"] .reid-ca-role-pm,
[data-theme="dark"] .reid-ca-role-pm,
.dark-mode .reid-ca-role-pm {
    background: #1e3a5f;
    color: #60a5fa;
}

[data-bs-theme="dark"] .reid-ca-role-agent,
[data-theme="dark"] .reid-ca-role-agent,
.dark-mode .reid-ca-role-agent {
    background: #0d3320;
    color: #34d399;
}

[data-bs-theme="dark"] .reid-ca-role-readonly,
[data-theme="dark"] .reid-ca-role-readonly,
.dark-mode .reid-ca-role-readonly {
    background: #333;
    color: #888;
}

[data-bs-theme="dark"] .reid-ca-role-none,
[data-theme="dark"] .reid-ca-role-none,
.dark-mode .reid-ca-role-none {
    background: #333;
    color: #666;
}

[data-bs-theme="dark"] .reid-ca-self-badge,
[data-theme="dark"] .reid-ca-self-badge,
.dark-mode .reid-ca-self-badge {
    background: #3d2e0a;
    color: #fbbf24;
}

[data-bs-theme="dark"] .reid-ca-status-msg.ok,
[data-theme="dark"] .reid-ca-status-msg.ok,
.dark-mode .reid-ca-status-msg.ok {
    background: #0d3320;
    color: #34d399;
}

[data-bs-theme="dark"] .reid-ca-status-msg.err,
[data-theme="dark"] .reid-ca-status-msg.err,
.dark-mode .reid-ca-status-msg.err {
    background: #3b1111;
    color: #fca5a5;
}

[data-bs-theme="dark"] .reid-ca-card,
[data-theme="dark"] .reid-ca-card,
.dark-mode .reid-ca-card {
    background: #2a2a2a;
    border-color: #444;
}

[data-bs-theme="dark"] .reid-ca-card:hover,
[data-theme="dark"] .reid-ca-card:hover,
.dark-mode .reid-ca-card:hover {
    border-color: #10b981;
}

[data-bs-theme="dark"] .reid-ca-card-name,
[data-theme="dark"] .reid-ca-card-name,
.dark-mode .reid-ca-card-name {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .reid-ca-card-email,
[data-theme="dark"] .reid-ca-card-email,
.dark-mode .reid-ca-card-email,
[data-bs-theme="dark"] .reid-ca-card-phone,
[data-theme="dark"] .reid-ca-card-phone,
.dark-mode .reid-ca-card-phone {
    color: #888;
}

[data-bs-theme="dark"] .reid-ca-card-meta,
[data-theme="dark"] .reid-ca-card-meta,
.dark-mode .reid-ca-card-meta {
    color: #666;
}

[data-bs-theme="dark"] .reid-ca-card-actions,
[data-theme="dark"] .reid-ca-card-actions,
.dark-mode .reid-ca-card-actions {
    border-top-color: #444;
}

[data-bs-theme="dark"] .reid-ca-action-label,
[data-theme="dark"] .reid-ca-action-label,
.dark-mode .reid-ca-action-label {
    color: #888;
}

[data-bs-theme="dark"] .reid-ca-role-select,
[data-theme="dark"] .reid-ca-role-select,
.dark-mode .reid-ca-role-select {
    border-color: #555;
    background: #1e1e1e;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .reid-ca-btn,
[data-theme="dark"] .reid-ca-btn,
.dark-mode .reid-ca-btn {
    background: #2a2a2a;
    color: #ccc;
    border-color: #555;
}

[data-bs-theme="dark"] .reid-ca-btn:hover,
[data-theme="dark"] .reid-ca-btn:hover,
.dark-mode .reid-ca-btn:hover {
    background: #333;
}

[data-bs-theme="dark"] .reid-ca-btn-enable,
[data-theme="dark"] .reid-ca-btn-enable,
.dark-mode .reid-ca-btn-enable {
    background: #059669;
    border-color: #059669;
    color: #fff;
}

[data-bs-theme="dark"] .reid-ca-btn-disable,
[data-theme="dark"] .reid-ca-btn-disable,
.dark-mode .reid-ca-btn-disable {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

[data-bs-theme="dark"] .reid-ca-guest,
[data-theme="dark"] .reid-ca-guest,
.dark-mode .reid-ca-guest,
[data-bs-theme="dark"] .reid-ca-empty,
[data-theme="dark"] .reid-ca-empty,
.dark-mode .reid-ca-empty,
[data-bs-theme="dark"] .reid-ca-empty-team,
[data-theme="dark"] .reid-ca-empty-team,
.dark-mode .reid-ca-empty-team {
    color: #999;
    background: #2a2a2a;
    border-color: #444;
}

[data-bs-theme="dark"] .reid-ca-dot-on,
[data-theme="dark"] .reid-ca-dot-on,
.dark-mode .reid-ca-dot-on {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

[data-bs-theme="dark"] .reid-ca-dot-off,
[data-theme="dark"] .reid-ca-dot-off,
.dark-mode .reid-ca-dot-off {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

[data-bs-theme="dark"] .reid-ca-section,
[data-theme="dark"] .reid-ca-section,
.dark-mode .reid-ca-section { border-color: #444; }

[data-bs-theme="dark"] .reid-ca-section > summary,
[data-theme="dark"] .reid-ca-section > summary,
.dark-mode .reid-ca-section > summary { color: #f0f0f0; background: #2a2a2a; }

[data-bs-theme="dark"] .reid-ca-section > summary:hover,
[data-theme="dark"] .reid-ca-section > summary:hover,
.dark-mode .reid-ca-section > summary:hover { background: #353535; }

[data-bs-theme="dark"] .reid-ca-section-body,
[data-theme="dark"] .reid-ca-section-body,
.dark-mode .reid-ca-section-body { background: #1e1e1e; }
