/* ============================================
   ADMIN/BROKER PAGE STYLES
   ============================================ */

.admin-container {
    max-width: 1600px;
    margin: 0 auto;
}

/* Admin Header */
.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header-title {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.admin-header-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-top: 5px;
}

.admin-header-actions {
    display: flex;
    gap: 12px;
}

.admin-action-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.admin-action-btn.primary {
    background: white;
    color: #667eea;
    border-color: white;
}

.admin-action-btn.primary:hover {
    background: #f0f0f0;
}

/* ============================================
   ADMIN STATS GRID
   ============================================ */

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.admin-stat-card {
    background: #3a3a3a;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.admin-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.admin-stat-card.green { border-left-color: #4ade80; }
.admin-stat-card.blue { border-left-color: #3b82f6; }
.admin-stat-card.orange { border-left-color: #fb923c; }
.admin-stat-card.purple { border-left-color: #a855f7; }
.admin-stat-card.red { border-left-color: #ef4444; }

.admin-stat-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.admin-stat-label {
    color: #b0b0b0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.admin-stat-value {
    color: #e0e0e0;
    font-size: 32px;
    font-weight: 700;
}

.admin-stat-change {
    color: #4ade80;
    font-size: 12px;
    font-weight: 600;
    margin-top: 5px;
}

.admin-stat-change.negative {
    color: #ef4444;
}

/* ============================================
   ADMIN CONTENT LAYOUT
   ============================================ */

.admin-content-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.admin-section {
    background: #3a3a3a;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.team-performance-overview {
    position: relative;
    padding-bottom: 70px;
}

.team-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.team-overview-card {
    background: #2e2e2e;
    border-radius: 14px;
    padding: 18px;
    border: 1px solid #3e3e3e;
    border-top: 3px solid #4a4a4a;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.team-overview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.team-overview-card.accent-blue {
    border-top-color: #3b82f6;
}

.team-overview-card.accent-green {
    border-top-color: #22c55e;
}

.team-overview-card.accent-orange {
    border-top-color: #f97316;
}

.team-overview-card.accent-purple {
    border-top-color: #a855f7;
}

.team-overview-icon {
    font-size: 22px;
    margin-bottom: 2px;
    line-height: 1;
}

.team-overview-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #8a8f96;
    font-weight: 600;
}

.team-overview-value {
    font-size: 28px;
    font-weight: 800;
    color: #f5f5f5;
    letter-spacing: -0.5px;
}

.team-overview-meta {
    color: #a0a5ab;
    font-size: 12px;
}

.team-overview-bar {
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: #1e1e1e;
    overflow: hidden;
    margin-top: 10px;
}

.team-overview-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.team-overview-fill.blue {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.team-overview-fill.green {
    background: linear-gradient(90deg, #22c55e, #86efac);
}

.team-overview-fill.orange {
    background: linear-gradient(90deg, #f97316, #fdba74);
}

.team-overview-fill.purple {
    background: linear-gradient(90deg, #a855f7, #c084fc);
}

.team-overview-footer {
    position: absolute;
    right: 24px;
    bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.team-overview-footnote {
    color: #7a7f86;
    font-size: 12px;
    font-style: italic;
}

.admin-section-action.primary-glow {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.admin-section-action.primary-glow:hover {
    box-shadow: 0 4px 18px rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
}

.team-performance-modal {
    max-width: 980px;
}

.team-performance-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.team-performance-controls input,
.team-performance-controls select {
    background: #2f2f2f;
    border: 1px solid #4a4a4a;
    color: #e0e0e0;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
    transition: border-color 0.2s ease;
}

.team-performance-controls input:focus,
.team-performance-controls select:focus {
    outline: none;
    border-color: #667eea;
}

.team-performance-controls input {
    flex: 1 1 240px;
    min-width: 200px;
}

.team-performance-controls select {
    flex: 0 0 180px;
}

.team-performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
}

.team-performance-grid::-webkit-scrollbar {
    width: 5px;
}

.team-performance-grid::-webkit-scrollbar-track {
    background: transparent;
}

.team-performance-grid::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 999px;
}

.team-performance-card {
    background: #2e2e2e;
    border: 1px solid #404040;
    border-left: 3px solid #667eea;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-performance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.team-performance-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.team-performance-name {
    color: #f1f1f1;
    font-weight: 700;
    font-size: 16px;
}

.team-performance-leader {
    color: #9aa0a6;
    font-size: 12px;
    margin-top: 4px;
}

.team-performance-pill {
    background: rgba(102, 126, 234, 0.18);
    color: #cdd6ff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.team-performance-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.team-performance-metric {
    background: #252525;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid #363636;
    transition: background 0.2s ease;
}

.team-performance-card:hover .team-performance-metric {
    background: #2a2a2a;
}

.team-performance-metric-label {
    color: #8a8f96;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.team-performance-metric-value {
    color: #f1f1f1;
    font-size: 15px;
    font-weight: 700;
}

.team-performance-meta {
    color: #7a7f86;
    font-size: 12px;
    padding-top: 4px;
    border-top: 1px solid #363636;
}

.team-performance-empty {
    color: #9a9a9a;
    font-size: 13px;
    padding: 24px 16px;
    text-align: center;
}

@media (max-width: 720px) {
    .team-overview-footer {
        position: static;
        justify-content: space-between;
        margin-top: 16px;
    }

    .team-performance-controls {
        flex-direction: column;
    }

    .team-performance-controls input,
    .team-performance-controls select {
        width: 100%;
    }

    .team-performance-grid {
        grid-template-columns: 1fr;
    }
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #555;
}

.admin-section-title {
    color: #e0e0e0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-section-action {
    padding: 8px 16px;
    background: #4a5568;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-section-action:hover {
    background: #667eea;
}

.admin-section-action.secondary {
    background: transparent;
    border: 1px solid #4a5568;
    color: #e0e0e0;
}

.admin-section-action.secondary:hover {
    border-color: #667eea;
    color: #667eea;
}

.admin-section-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-agent-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.admin-agent-filter {
    padding: 6px 14px;
    background: #2f2f2f;
    border: 1px solid #444;
    border-radius: 8px;
    color: #b0b0b0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-agent-filter:hover {
    border-color: #667eea;
    color: #e0e0e0;
}

.admin-agent-filter.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
}

/* ============================================
   AGENTS TABLE
   ============================================ */

.agents-table-container {
    overflow-x: auto;
}

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

.agents-table th,
.agents-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #4a4a4a;
}

.agents-table th {
    color: #b0b0b0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    background: #2a2a2a;
}

.agents-table th:first-child {
    border-radius: 10px 0 0 0;
}

.agents-table th:last-child {
    border-radius: 0 10px 0 0;
}

.agents-table tr:hover {
    background: #4a4a4a;
}

.agents-table td {
    color: #e0e0e0;
    font-size: 14px;
}

.agent-logins-modal {
    max-width: 720px;
}

.agent-logins-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 70vh;
}

.agent-logins-title {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 700;
}

.agent-logins-subtitle {
    color: #9ca3af;
    font-size: 12px;
    margin: 8px 0 12px;
}

.agent-logins-controls {
    display: grid;
    grid-template-columns: 1.6fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.agent-logins-search input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #3a3a3a;
    background: #2f2f2f;
    color: #e0e0e0;
    font-size: 13px;
}

.agent-logins-search input:focus {
    outline: none;
    border-color: #667eea;
}

.agent-logins-sort label {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.agent-logins-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    max-height: 55vh;
    min-height: 240px;
    overflow-y: auto;
    margin-top: 6px;
}

.agent-login-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 12px;
    align-items: center;
    background: #3a3a3a;
    border-radius: 10px;
    padding: 10px 12px;
}

.agent-login-name {
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 600;
}

.agent-login-username,
.agent-login-password {
    color: #cbd5f5;
    font-size: 12px;
    font-family: "Courier New", monospace;
}

.agent-details-actions {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0 16px;
}

@media (max-width: 720px) {
    .agent-logins-controls {
        grid-template-columns: 1fr;
    }
}

/* Agent Info Cell */
.agent-info-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.agent-name {
    font-weight: 600;
    color: #e0e0e0;
}

.agent-email {
    font-size: 12px;
    color: #888;
}

/* ============================================
   BROKER-ONLY AGENT PROFILE
   ============================================ */

.broker-only-section {
    margin-bottom: 30px;
}

.agent-profile-header {
    background: #3a3a3a;
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agent-profile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================
   BROKER OPERATIONAL CONTROLS
   ============================================ */

.broker-content-layout {
    margin-top: 20px;
}

.broker-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.broker-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.broker-select {
    width: 100%;
    padding: 12px 14px;
    background: #4a4a4a;
    border: 2px solid #555;
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.broker-select:focus {
    outline: none;
    border-color: #667eea;
}

.broker-readonly {
    background: #2f2f2f;
    border-radius: 10px;
    padding: 12px 14px;
    color: #e0e0e0;
    font-size: 14px;
    border: 1px solid #3a3a3a;
}

.broker-notes {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.broker-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    background: #2f2f2f;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    color: #e0e0e0;
    font-size: 14px;
    resize: vertical;
}

.broker-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.broker-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.broker-agent-search-field {
    min-width: 260px;
}

.broker-ops-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #3a3a3a;
}

.broker-risk-panel {
    margin-top: 20px;
}

.admin-section-header.compact {
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.broker-risk-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.broker-risk-item {
    background: #2f2f2f;
    border-radius: 10px;
    padding: 12px 14px;
    border-left: 3px solid #667eea;
    color: #e0e0e0;
    font-size: 13px;
}

.broker-risk-item.high { border-left-color: #ef4444; }
.broker-risk-item.medium { border-left-color: #f59e0b; }
.broker-risk-item.low { border-left-color: #3b82f6; }

.broker-audit-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.broker-audit-filter-select {
    flex: 1;
    padding: 8px 10px;
    background: #2f2f2f;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
}

.broker-audit-filter-select:focus {
    outline: none;
    border-color: #667eea;
}

.broker-audit-log {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
}

.broker-audit-item {
    background: #2f2f2f;
    border-radius: 10px;
    padding: 12px 14px;
    border-left: 3px solid #667eea;
}

.broker-audit-title {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.broker-audit-meta {
    color: #9ca3af;
    font-size: 12px;
}

.broker-audit-item.audit-status {
    border-left-color: #f59e0b;
}

.broker-audit-item.audit-client {
    border-left-color: #4ade80;
}

.broker-audit-item.audit-contract {
    border-left-color: #a855f7;
}

.broker-audit-item.audit-access {
    border-left-color: #ef4444;
}

.broker-audit-item.audit-note {
    border-left-color: #60a5fa;
}

/* Broker Saved Notes Panel */
.broker-saved-notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.broker-saved-note-item {
    background: #2f2f2f;
    border-radius: 10px;
    padding: 12px 14px;
    border-left: 3px solid #a855f7;
    cursor: pointer;
    transition: background 0.2s ease;
}

.broker-saved-note-item:hover {
    background: #3a3a3a;
}

.broker-saved-note-agent {
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.broker-saved-note-preview {
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.broker-saved-note-date {
    color: #6b7280;
    font-size: 11px;
}

/* Broker Note View Popup */
.broker-note-view-modal {
    max-width: 480px;
}

.broker-note-view-date {
    color: #9ca3af;
    font-size: 12px;
    margin-bottom: 12px;
}

.broker-note-view-text {
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
    background: #2f2f2f;
    padding: 16px;
    border-radius: 10px;
    border-left: 3px solid #a855f7;
}

.agent-selector-wrapper {
    flex: 1;
    max-width: 420px;
}

.agent-selector-wrapper .searchable-dropdown-list,
#brokerAgentDropdown .searchable-dropdown-list {
    max-height: 260px;
}

.agent-selector-label {
    color: #b0b0b0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: block;
}

.agent-profile-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.agent-profile-card {
    background: #3a3a3a;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
}

.agent-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.agent-profile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #555;
}

.agent-info-card .agent-profile-card-header {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.agent-profile-card-header h3 {
    margin: 0;
    color: inherit;
    font-size: 16px;
    font-weight: 700;
}

.agent-status-badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.agent-status-badge.active {
    background: rgba(74, 222, 128, 0.2);
    color: #d1fae5;
}

.agent-status-badge.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

.agent-profile-info {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.agent-profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.agent-profile-details {
    flex: 1;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.agent-profile-name {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 700;
    text-align: left;
}

.agent-profile-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    margin-bottom: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.contact-icon {
    font-size: 16px;
}

.agent-license-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    font-size: 13px;
}

.license-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    margin-right: 6px;
}

.license-value {
    color: white;
    font-weight: 600;
}

.agent-profile-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.agent-profile-stat-card {
    background: #2f2f2f;
    border-radius: 12px;
    padding: 18px;
    border-left: 4px solid #667eea;
    text-align: left;
    transition: all 0.3s ease;
}

.agent-profile-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.agent-profile-stat-card .stat-icon {
    font-size: 20px;
    margin-bottom: 8px;
}

.agent-profile-stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #e0e0e0;
}

.agent-profile-stat-card .stat-label {
    font-size: 12px;
    color: #b0b0b0;
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 600;
}

/* Commission Split Card */
.agent-profile-stat-card.commission-card {
    position: relative;
}

.commission-split-value {
    font-size: 0;
    letter-spacing: 0;
    height: 0;
    overflow: hidden;
}

.view-contract-link {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s ease;
}

.view-contract-link:hover {
    color: #667eea;
}

.commission-split-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.commission-split-part {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.commission-split-number {
    font-size: 32px;
    font-weight: 800;
    color: #e0e0e0;
    letter-spacing: 1px;
}

.commission-split-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #9ca3af;
}

.commission-split-divider {
    font-size: 26px;
    font-weight: 300;
    color: #667eea;
    margin-top: -2px;
}

/* Agent Contract Popup */
.agent-contract-modal {
    max-width: 520px;
}

.contract-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #3a3a3a;
}

.contract-logo {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 4px;
}

.contract-subtitle {
    font-size: 13px;
    color: #9ca3af;
}

.contract-split-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px;
    background: #2a2a2a;
    border-radius: 12px;
}

.contract-split-agent,
.contract-split-broker {
    text-align: center;
}

.contract-split-number {
    font-size: 36px;
    font-weight: 700;
    color: #e0e0e0;
}

.contract-split-agent .contract-split-number {
    color: #4ade80;
}

.contract-split-broker .contract-split-number {
    color: #667eea;
}

.contract-split-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 4px;
}

.contract-split-divider {
    font-size: 32px;
    color: #4a5568;
    font-weight: 300;
}

.contract-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.contract-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #2a2a2a;
}

.contract-field-label {
    font-size: 13px;
    color: #9ca3af;
}

.contract-field-value {
    font-size: 13px;
    color: #e0e0e0;
    font-weight: 600;
}

.contract-footer {
    padding-top: 16px;
    border-top: 1px solid #3a3a3a;
}

.contract-footer-note {
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    line-height: 1.5;
    font-style: italic;
}

.agent-profile-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.deals-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.deal-status-item {
    background: #2f2f2f;
    padding: 12px;
    border-radius: 10px;
    border-left: 3px solid #667eea;
}

.deal-status-item.draft { border-left-color: #94a3b8; }
.deal-status-item.under-contract { border-left-color: #3b82f6; }
.deal-status-item.pending { border-left-color: #f59e0b; }
.deal-status-item.closed { border-left-color: #22c55e; }

.deal-status-count {
    font-size: 20px;
    font-weight: 700;
    color: #e0e0e0;
}

.deal-status-label {
    font-size: 12px;
    color: #b0b0b0;
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 600;
}

.compliance-count {
    background: #4a5568;
    color: #e0e0e0;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.compliance-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compliance-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #b0b0b0;
    font-size: 14px;
    background: #2f2f2f;
    padding: 12px;
    border-radius: 10px;
}

.compliance-check {
    color: #22c55e;
    font-weight: 700;
}

.compliance-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2f2f2f;
    padding: 12px;
    border-radius: 10px;
    border-left: 3px solid #667eea;
}

.compliance-alert.critical { border-left-color: #ef4444; }
.compliance-alert.warning { border-left-color: #f59e0b; }
.compliance-alert.info { border-left-color: #3b82f6; }

.compliance-alert-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #e0e0e0;
}

.compliance-alert-text {
    color: #e0e0e0;
    font-size: 13px;
    line-height: 1.4;
}

.activity-subtitle {
    font-size: 12px;
    color: #b0b0b0;
    text-transform: uppercase;
    font-weight: 600;
}

.agent-activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agent-activity-item {
    background: #2f2f2f;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.agent-activity-text {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 600;
}

.agent-activity-time {
    color: #9ca3af;
    font-size: 12px;
    white-space: nowrap;
}

.agent-crm-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
}

.agent-crm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #2f2f2f;
    border-radius: 10px;
    padding: 10px 12px;
    border-left: 3px solid #667eea;
}

.agent-crm-client {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.agent-crm-name {
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 600;
}

.agent-crm-meta {
    color: #9ca3af;
    font-size: 11px;
}

.agent-crm-open-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: #4a5568;
    color: #e0e0e0;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.agent-crm-open-btn:hover {
    background: #667eea;
    color: #fff;
}

/* ============================================
   SUPER ADMIN
   ============================================ */

.super-admin-container {
    gap: 24px;
}

.super-admin-header {
    align-items: flex-end;
}

.super-admin-header-actions .admin-action-btn {
    min-width: 140px;
}

.super-admin-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.super-admin-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
}

.super-admin-search {
    position: relative;
}

.super-admin-search input {
    width: 100%;
    padding: 12px 42px 12px 16px;
    border-radius: 12px;
    border: 1px solid #454545;
    background: #2f2f2f;
    color: #e0e0e0;
    font-size: 14px;
}

.super-admin-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.super-admin-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
}

.super-admin-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.super-admin-filter {
    border: 1px solid #4a4a4a;
    background: #333;
    color: #d6d6d6;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.super-admin-filter.active,
.super-admin-filter:hover {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.super-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
}

.super-admin-ops {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.super-admin-main,
.super-admin-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.super-admin-card {
    background: #3a3a3a;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.super-admin-card.split {
    padding: 18px 22px;
}

.super-admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.super-admin-card-header h2 {
    color: #f1f1f1;
    font-size: 18px;
    font-weight: 700;
}

.super-admin-card-actions {
    display: flex;
    gap: 10px;
}

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

.super-admin-agent-table {
    table-layout: fixed;
}

.super-admin-agent-table th:nth-child(5),
.super-admin-agent-table th:nth-child(6),
.super-admin-agent-table th:nth-child(7),
.super-admin-agent-table td:nth-child(5),
.super-admin-agent-table td:nth-child(6),
.super-admin-agent-table td:nth-child(7) {
    padding-left: 6px;
    padding-right: 8px;
}

.super-admin-agent-table th:nth-child(2),
.super-admin-agent-table th:nth-child(3),
.super-admin-agent-table th:nth-child(4),
.super-admin-agent-table td:nth-child(2),
.super-admin-agent-table td:nth-child(3),
.super-admin-agent-table td:nth-child(4) {
    padding-left: 6px;
    padding-right: 8px;
}

.super-admin-agent-table th:nth-child(6),
.super-admin-agent-table td:nth-child(6) {
    text-align: right;
}

.super-admin-agent-table th:nth-child(7),
.super-admin-agent-table td:nth-child(7) {
    text-align: right;
}

.super-admin-agent-table td:nth-child(7) .super-admin-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
}

.super-admin-agent-table .super-admin-actions {
    width: 100%;
    margin-top: 0;
}

.super-admin-agent-table td:nth-child(6) .super-admin-toggle {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.super-admin-eye-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #4a4a4a;
    background: #2f2f2f;
    color: #e5e7eb;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.super-admin-eye-btn:hover {
    border-color: #667eea;
    color: #cbd5f5;
}

.super-admin-agent-details-modal {
    max-width: 520px;
}

.super-admin-agent-details-body {
    display: grid;
    gap: 12px;
}

.super-admin-agent-details-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #2f2f2f;
}

.super-admin-agent-details-label {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.super-admin-agent-details-value {
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 600;
}

.super-admin-show-all-btn {
    margin-top: 10px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #a5b4fc;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.super-admin-show-all-btn:hover {
    color: #c7d2fe;
}

.super-admin-agent-table .super-admin-actions .admin-section-action {
    min-width: auto;
    padding: 6px 12px;
    font-size: 12px;
}

.super-admin-agent-table .super-admin-eye-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.super-admin-agents-modal {
    max-width: 1100px;
}

.super-admin-agents-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 75vh;
}

.super-admin-agents-controls {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1fr;
    gap: 12px;
    align-items: center;
}

.super-admin-agents-table-wrap {
    overflow: auto;
    border-radius: 16px;
    border: 1px solid #2f2f2f;
}

@media (max-width: 900px) {
    .super-admin-agents-controls {
        grid-template-columns: 1fr;
    }
}

.super-admin-table th {
    text-align: left;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    padding-bottom: 10px;
}

.super-admin-table td {
    padding: 10px 8px;
    border-top: 1px solid #4a4a4a;
    color: #e5e7eb;
    font-size: 13px;
}

.super-admin-client {
    display: flex;
    gap: 12px;
    align-items: center;
}

.super-admin-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

.super-admin-client-name {
    font-weight: 700;
    color: #f3f4f6;
    font-size: 14px;
}

.super-admin-client-meta {
    color: #9ca3af;
    font-size: 12px;
}

.super-admin-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.super-admin-pill.active,
.super-admin-pill.paid {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.super-admin-pill.trial,
.super-admin-pill.pending {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.super-admin-pill.paused {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.super-admin-pill.failed,
.super-admin-pill.canceled {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.super-admin-pill.connected,
.super-admin-pill.ok {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.super-admin-pill.action {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.super-admin-pill.warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.super-admin-pill.high {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.super-admin-pill.medium {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.super-admin-pill.low {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.super-admin-pill.open {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.super-admin-pill.in-progress {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.super-admin-pill.waiting {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.super-admin-pill.closed {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.super-admin-pill.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.super-admin-pill.invited {
    background: rgba(167, 139, 250, 0.2);
    color: #a78bfa;
}

.super-admin-pill.info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.super-admin-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.super-admin-panel {
    background: #2f2f2f;
    border-radius: 14px;
    padding: 16px;
}

.super-admin-panel-title {
    color: #cbd5f5;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.super-admin-feature,
.super-admin-role-row,
.super-admin-integration,
.super-admin-audit-item,
.super-admin-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #3f3f3f;
}

.super-admin-feature:last-child,
.super-admin-role-row:last-child,
.super-admin-integration:last-child,
.super-admin-audit-item:last-child,
.super-admin-control:last-child {
    border-bottom: none;
}

.super-admin-feature-name {
    font-weight: 600;
    color: #f1f1f1;
    font-size: 13px;
}

.super-admin-feature-meta {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 4px;
}

.super-admin-role-chip {
    background: #4a5568;
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.super-admin-billing {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.super-admin-billing-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: #e5e7eb;
}

.super-admin-billing-label {
    color: #9ca3af;
}

.super-admin-support {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.super-admin-ticket {
    background: #2f2f2f;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.super-admin-ticket-title {
    color: #f1f1f1;
    font-weight: 600;
    font-size: 13px;
}

.super-admin-ticket-meta {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 4px;
}

.super-admin-notes textarea {
    width: 100%;
    min-height: 90px;
    border-radius: 12px;
    border: 1px solid #4a4a4a;
    background: #2f2f2f;
    color: #e5e7eb;
    padding: 10px 12px;
    font-size: 12px;
    resize: vertical;
}

.super-admin-integrations {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.super-admin-integration {
    border-left: 3px solid #4a4a4a;
    padding-left: 12px;
    border-radius: 0;
}

.super-admin-integration.int-connected {
    border-left-color: #4ade80;
}

.super-admin-integration.int-warning {
    border-left-color: #fbbf24;
}

.super-admin-integration.int-action {
    border-left-color: #ef4444;
}

.super-admin-audit {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.super-admin-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.super-admin-usage {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.super-admin-usage-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.super-admin-progress {
    width: 100%;
    height: 8px;
    background: #2f2f2f;
    border-radius: 999px;
    overflow: hidden;
}

.super-admin-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.super-admin-progress-fill.warn {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.super-admin-progress-fill.good {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.super-admin-emergency {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 1100px) {
    .super-admin-toolbar {
        grid-template-columns: 1fr;
    }

    .super-admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .super-admin-card {
        padding: 18px;
    }

    .super-admin-table {
        display: block;
        overflow-x: auto;
    }
}

/* Super Admin Tabs and Utilities */
.super-admin-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #3a3a3a;
}

.super-admin-tab {
    background: #2f2f2f;
    border: 1px solid #444;
    color: #d6d6d6;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.super-admin-tab.active,
.super-admin-tab:hover {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.super-admin-section.hidden {
    display: none;
}

.super-admin-impersonation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #fca5a5;
    font-weight: 600;
    font-size: 13px;
}

.super-admin-impersonation.hidden {
    display: none;
}

.super-admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.super-admin-input,
.super-admin-select,
.super-admin-textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #4a4a4a;
    background: #2f2f2f;
    color: #e5e7eb;
    font-size: 13px;
}

.super-admin-input-small {
    max-width: 200px;
}

.super-admin-textarea {
    resize: vertical;
}

.super-admin-bulk {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.super-admin-actions,
.super-admin-seat-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.super-admin-alerts,
.super-admin-status-list,
.super-admin-log-list,
.super-admin-template-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.super-admin-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    background: #2f2f2f;
    color: #e5e7eb;
    font-size: 12px;
    border-left: 3px solid #4a4a4a;
}

.super-admin-alert.warning {
    border-left-color: #fbbf24;
}

.super-admin-alert.info {
    border-left-color: #60a5fa;
}

.super-admin-alert.error {
    border-left-color: #ef4444;
}

.super-admin-status-row,
.super-admin-log-row,
.super-admin-template-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #2f2f2f;
    border-radius: 10px;
    font-size: 12px;
    color: #e5e7eb;
}

.super-admin-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.super-admin-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #d6d6d6;
}

.super-admin-toggle input[type=\"checkbox\"] {
    accent-color: #667eea;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.super-admin-toggle span {
    min-width: 0;
    line-height: 1.2;
}

.super-admin-actions .admin-section-action,
.super-admin-seat-actions .admin-section-action {
    min-width: 120px;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 8px;
}

.table-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #4a5568;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.table-action-btn:hover {
    background: #667eea;
}

.table-action-btn.danger:hover {
    background: #ef4444;
}

/* ============================================
   ACTIVITY FEED
   ============================================ */

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #4a4a4a;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: #555;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.activity-icon.deal_closed {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

.activity-icon.offer_submitted {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.activity-icon.viewing_scheduled {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.activity-icon.client_added {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.activity-content {
    flex: 1;
}

.activity-title {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.activity-agent {
    color: #667eea;
    font-size: 13px;
    font-weight: 500;
}

.activity-time {
    color: #888;
    font-size: 12px;
    margin-top: 4px;
}

/* ============================================
   CLIENT ASSIGNMENT PANEL
   ============================================ */

.assignment-panel {
    background: #3a3a3a;
    border-radius: 15px;
    padding: 25px;
}

.assignment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.assignment-title {
    color: #e0e0e0;
    font-size: 18px;
    font-weight: 700;
}

.assignment-select {
    width: 100%;
    padding: 10px 38px 10px 12px;
    background-color: #3a3a3a;
    border: 1px solid #555;
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    cursor: pointer;
    height: 38px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #9aa0a6 50%),
        linear-gradient(135deg, #9aa0a6 50%, transparent 50%),
        linear-gradient(to right, #3a3a3a, #3a3a3a);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%,
        0 0;
    background-size: 6px 6px, 6px 6px, 100% 100%;
    background-repeat: no-repeat;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.broker-select-hidden {
    display: none;
}

.broker-dropdown {
    position: relative;
    width: 100%;
}

.broker-dropdown.is-empty .coordinator-tool-btn {
    color: #b0b0b0;
}

.broker-dropdown .coordinator-tool-btn {
    width: 100%;
    justify-content: space-between;
    background: #3a3a3a;
    border: 1px solid #555;
}

.broker-dropdown .coordinator-tool-btn:hover {
    border-color: #667eea;
    background: #4a4a4a;
}

.broker-dropdown .coordinator-toolbar-dropdown {
    width: 100%;
    min-width: 0;
    max-height: 240px;
    overflow-y: auto;
}

.broker-dropdown .coordinator-toolbar-dropdown::-webkit-scrollbar {
    width: 6px;
}

.broker-dropdown .coordinator-toolbar-dropdown::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.broker-dropdown .coordinator-toolbar-dropdown::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

.broker-audit-filters .broker-audit-dropdown {
    flex: 1 1 180px;
}

.broker-audit-filters .broker-audit-dropdown .coordinator-toolbar-dropdown {
    min-width: 180px;
}

.assignment-dropdown {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.assignment-dropdown .coordinator-tool-btn {
    width: 100%;
    justify-content: space-between;
}

.assignment-dropdown .coordinator-toolbar-dropdown {
    width: 100%;
    min-width: 0;
    max-height: 230px;
    overflow-y: auto;
}

.assignment-dropdown .coordinator-toolbar-dropdown::-webkit-scrollbar {
    width: 6px;
}

.assignment-dropdown .coordinator-toolbar-dropdown::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.assignment-dropdown .coordinator-toolbar-dropdown::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

.assignment-select:hover {
    background-color: #4a4a4a;
    border-color: #667eea;
}

.assignment-select:focus {
    outline: none;
    border-color: #667eea;
}

.assignment-select option {
    background: #3a3a3a;
    color: #e0e0e0;
}

.unassigned-clients {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.unassigned-client-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #4a4a4a;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.unassigned-client-item:hover {
    background: #555;
}

.unassigned-client-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.unassigned-client-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.unassigned-client-name {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 14px;
}

.assign-btn {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.assign-btn:hover {
    background: #5568d3;
}

.no-unassigned {
    text-align: center;
    color: #888;
    padding: 20px;
    font-size: 14px;
}

/* ============================================
   PERFORMANCE METRICS
   ============================================ */

.performance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.performance-card {
    background: #4a4a4a;
    padding: 20px;
    border-radius: 12px;
}

.performance-label {
    color: #b0b0b0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.performance-value {
    color: #e0e0e0;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.performance-bar {
    height: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
}

.performance-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.performance-fill.green {
    background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
}

/* ============================================
   ADD AGENT MODAL
   ============================================ */

.add-agent-modal {
    max-width: 680px;
}

.add-agent-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section-title {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 600;
}

.form-group input {
    padding: 12px 15px;
    background: #2a2a2a;
    border: 2px solid #555;
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input::placeholder {
    color: #888;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 10px;
}

@media (max-width: 680px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   AGENT DETAILS MODAL
   ============================================ */

.agent-details-modal {
    max-width: 700px;
}

.agent-details-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #555;
    margin-bottom: 25px;
}

.agent-details-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: 700;
}

.agent-details-info h3 {
    color: #e0e0e0;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.agent-details-info p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.agent-details-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.agent-detail-stat {
    background: #4a4a4a;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.agent-detail-stat-value {
    color: #e0e0e0;
    font-size: 24px;
    font-weight: 700;
}

.agent-detail-stat-label {
    color: #888;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 5px;
}

.agent-clients-section h4 {
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.agent-clients-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.agent-client-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #4a4a4a;
    border-radius: 8px;
}

.agent-client-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.agent-client-name {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   SCROLLBARS
   ============================================ */

.activity-feed::-webkit-scrollbar,
.unassigned-clients::-webkit-scrollbar,
.agent-clients-list::-webkit-scrollbar {
    width: 6px;
}

.activity-feed::-webkit-scrollbar-track,
.unassigned-clients::-webkit-scrollbar-track,
.agent-clients-list::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 10px;
}

.activity-feed::-webkit-scrollbar-thumb,
.unassigned-clients::-webkit-scrollbar-thumb,
.agent-clients-list::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

.activity-feed::-webkit-scrollbar-thumb:hover,
.unassigned-clients::-webkit-scrollbar-thumb:hover,
.agent-clients-list::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .admin-content-layout {
        grid-template-columns: 1fr;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .agent-profile-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .agent-profile-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .agent-profile-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .agent-profile-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .deals-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .agent-activity-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .agent-details-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .performance-grid {
        grid-template-columns: 1fr;
    }

    .broker-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   OFFICE CLASSIC - Admin Dark Card Overrides
   =========================================== */

body[data-theme="luxury"] .team-overview-card,
body[data-theme="luxury"] .team-performance-card,
body[data-theme="luxury"] .team-performance-metric,
body[data-theme="luxury"] .activity-item,
body[data-theme="luxury"] .agent-activity-item,
body[data-theme="luxury"] .performance-card,
body[data-theme="luxury"] .agent-profile-header,
body[data-theme="luxury"] .assignment-panel,
body[data-theme="luxury"] .assignment-select,
body[data-theme="luxury"] .unassigned-client-item,
body[data-theme="luxury"] .broker-audit-filter-select,
body[data-theme="luxury"] .broker-audit-item,
body[data-theme="luxury"] .broker-saved-note-item,
body[data-theme="luxury"] .broker-risk-item {
    background: var(--header-bg);
}

body[data-theme="luxury"] .admin-section-title,
body[data-theme="luxury"] .team-overview-label,
body[data-theme="luxury"] .team-overview-value,
body[data-theme="luxury"] .team-overview-meta,
body[data-theme="luxury"] .team-performance-name,
body[data-theme="luxury"] .team-performance-leader,
body[data-theme="luxury"] .team-performance-metric-label,
body[data-theme="luxury"] .team-performance-metric-value,
body[data-theme="luxury"] .team-performance-meta,
body[data-theme="luxury"] .team-performance-pill,
body[data-theme="luxury"] .performance-label,
body[data-theme="luxury"] .performance-value,
body[data-theme="luxury"] .activity-title,
body[data-theme="luxury"] .activity-agent,
body[data-theme="luxury"] .activity-time,
body[data-theme="luxury"] .agent-selector-label,
body[data-theme="luxury"] .assignment-title,
body[data-theme="luxury"] .assignment-select,
body[data-theme="luxury"] .unassigned-client-item,
body[data-theme="luxury"] .broker-audit-title,
body[data-theme="luxury"] .broker-audit-meta,
body[data-theme="luxury"] .broker-audit-filter-select,
body[data-theme="luxury"] .broker-saved-note-item,
body[data-theme="luxury"] .broker-risk-item {
    color: var(--header-text);
}

body[data-theme="luxury"] .performance-bar {
    background: rgba(255, 255, 255, 0.2);
}

body[data-theme="luxury"] .broker-audit-filter-select,
body[data-theme="luxury"] .assignment-select {
    border-color: var(--border-strong);
}

body[data-theme="luxury"] .agent-profile-actions .admin-section-action {
    background: var(--header-bg);
    color: var(--header-text);
    border-color: var(--border-strong);
}

body[data-theme="luxury"] .agent-profile-actions .admin-section-action:hover {
    background: var(--btn-primary-bg);
}

/* Office Classic - Broker Ops widget should match default layout */
body[data-theme="luxury"] #brokerClientOpsSection .broker-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 16px;
    align-items: center;
}

body[data-theme="luxury"] #brokerClientOpsSection .broker-actions .admin-section-action {
    background: #4a5568;
    color: #ffffff;
    border: none;
}

body[data-theme="luxury"] #brokerClientOpsSection .broker-actions .admin-section-action:hover {
    background: #667eea;
}

body[data-theme="luxury"] #brokerClientOpsSection .broker-risk-item {
    background: #2f2f2f;
    color: #e0e0e0;
}

body[data-theme="luxury"] #brokerClientOpsSection .broker-risk-panel {
    margin-top: 16px;
    width: 100%;
    clear: both;
}

body[data-theme="luxury"] #brokerClientOpsSection .broker-risk-panel .admin-section-header {
    margin: 0 0 12px;
    padding: 0 0 10px;
    background: transparent;
    border-radius: 0;
    border-bottom: 2px solid #555;
}

body[data-theme="luxury"] #brokerClientOpsSection .broker-risk-panel .admin-section-title {
    color: #000000;
}

body[data-theme="luxury"] .assignment-panel .admin-stat-label,
body[data-theme="luxury"] .assignment-dropdown .coordinator-tool-btn,
body[data-theme="luxury"] .assignment-dropdown .coordinator-tool-btn::placeholder,
body[data-theme="luxury"] #unassignedClientsList .no-unassigned {
    color: #ffffff;
}

body[data-theme="luxury"] .assignment-dropdown .coordinator-toolbar-dropdown {
    background: #ffffff;
    border: 1px solid #4F6B85;
}

body[data-theme="luxury"] .assignment-dropdown .coordinator-toolbar-dropdown-item {
    background: var(--header-bg);
    color: #ffffff;
    border: 1px solid rgba(79, 107, 133, 0.55);
}

body[data-theme="luxury"] .assignment-dropdown .coordinator-toolbar-dropdown-item:hover,
body[data-theme="luxury"] .assignment-dropdown .coordinator-toolbar-dropdown-item.active {
    background: var(--btn-primary-bg);
    color: #ffffff;
}

/* ===========================================
   OFFICE CLASSIC - White Widget Consistency
   =========================================== */

body[data-theme="luxury"] .admin-stat-card,
body[data-theme="luxury"] .admin-section,
body[data-theme="luxury"] .super-admin-card,
body[data-theme="luxury"] .super-admin-panel,
body[data-theme="luxury"] .super-admin-status-row,
body[data-theme="luxury"] .team-overview-card,
body[data-theme="luxury"] .team-performance-card,
body[data-theme="luxury"] .team-performance-metric,
body[data-theme="luxury"] .activity-item,
body[data-theme="luxury"] .agent-activity-item,
body[data-theme="luxury"] .performance-card,
body[data-theme="luxury"] .agent-profile-header,
body[data-theme="luxury"] .assignment-panel,
body[data-theme="luxury"] .assignment-select,
body[data-theme="luxury"] .unassigned-client-item,
body[data-theme="luxury"] .broker-audit-filter-select,
body[data-theme="luxury"] .broker-audit-item,
body[data-theme="luxury"] .broker-saved-note-item,
body[data-theme="luxury"] .broker-risk-item {
    background: #ffffff;
    border: 1px solid rgba(62, 85, 107, 0.26);
    box-shadow: var(--widget-shadow);
}

body[data-theme="luxury"] .admin-section-title,
body[data-theme="luxury"] .team-overview-label,
body[data-theme="luxury"] .team-overview-value,
body[data-theme="luxury"] .team-overview-meta,
body[data-theme="luxury"] .team-performance-name,
body[data-theme="luxury"] .team-performance-leader,
body[data-theme="luxury"] .team-performance-metric-label,
body[data-theme="luxury"] .team-performance-metric-value,
body[data-theme="luxury"] .team-performance-meta,
body[data-theme="luxury"] .team-performance-pill,
body[data-theme="luxury"] .performance-label,
body[data-theme="luxury"] .performance-value,
body[data-theme="luxury"] .activity-title,
body[data-theme="luxury"] .activity-agent,
body[data-theme="luxury"] .activity-time,
body[data-theme="luxury"] .agent-selector-label,
body[data-theme="luxury"] .assignment-title,
body[data-theme="luxury"] .assignment-select,
body[data-theme="luxury"] .unassigned-client-item,
body[data-theme="luxury"] .broker-audit-title,
body[data-theme="luxury"] .broker-audit-meta,
body[data-theme="luxury"] .broker-audit-filter-select,
body[data-theme="luxury"] .broker-saved-note-item,
body[data-theme="luxury"] .broker-risk-item,
body[data-theme="luxury"] .super-admin-table th,
body[data-theme="luxury"] .super-admin-table td,
body[data-theme="luxury"] #unassignedClientsList .no-unassigned {
    color: #1f2d3a;
}

body[data-theme="luxury"] .admin-section-action,
body[data-theme="luxury"] .agent-profile-actions .admin-section-action,
body[data-theme="luxury"] #brokerClientOpsSection .broker-actions .admin-section-action {
    background: #ffffff;
    color: #1f2d3a;
    border: 1px solid rgba(62, 85, 107, 0.28);
    box-shadow: var(--widget-shadow);
}

body[data-theme="luxury"] .admin-section-action:hover,
body[data-theme="luxury"] .agent-profile-actions .admin-section-action:hover,
body[data-theme="luxury"] #brokerClientOpsSection .broker-actions .admin-section-action:hover {
    background: #f5f9fd;
    border-color: rgba(62, 85, 107, 0.36);
    color: #1f2d3a;
}

body[data-theme="luxury"] .assignment-panel .admin-stat-label,
body[data-theme="luxury"] .assignment-dropdown .coordinator-tool-btn,
body[data-theme="luxury"] .assignment-dropdown .coordinator-tool-btn::placeholder {
    color: #1f2d3a;
}

body[data-theme="luxury"] .assignment-dropdown .coordinator-toolbar-dropdown {
    background: #ffffff;
    border: 1px solid rgba(62, 85, 107, 0.28);
    box-shadow: var(--widget-shadow);
}

body[data-theme="luxury"] .assignment-dropdown .coordinator-toolbar-dropdown-item {
    background: #ffffff;
    color: #1f2d3a;
    border: none;
    border-bottom: 1px solid rgba(62, 85, 107, 0.2);
}

body[data-theme="luxury"] .assignment-dropdown .coordinator-toolbar-dropdown-item:last-child {
    border-bottom: none;
}

body[data-theme="luxury"] .assignment-dropdown .coordinator-toolbar-dropdown-item:hover,
body[data-theme="luxury"] .assignment-dropdown .coordinator-toolbar-dropdown-item.active {
    background: #edf4fb;
    color: #1f2d3a;
}
