/* ============================================
   AGENT TEAM
   Team Management (US-094), Team Collaboration
   (US-220) — Shared Listings, Lead Assignment,
   Team Calendar
   ============================================ */

/* ===== Team Management Page (US-094) ===== */
.team-page {
}

.team-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.team-page .header-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
}

.team-page .page-subtitle {
    color: var(--text-gray);
    font-size: 0.9375rem;
}

.team-page .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.team-page .stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.team-page .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.team-page .stat-icon svg {
    width: 28px;
    height: 28px;
}

.team-page .stat-icon.blue {
    background: #DBEAFE;
    color: #2563EB;
}

.team-page .stat-icon.green {
    background: #DCFCE7;
    color: #16A34A;
}

.team-page .stat-icon.purple {
    background: #EDE9FE;
    color: #7C3AED;
}

.team-page .stat-icon.gold {
    background: #FEF3C7;
    color: #D97706;
}

.team-page .stat-content {
    display: flex;
    flex-direction: column;
}

.team-page .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.team-page .stat-label {
    font-size: 0.875rem;
    color: var(--text-gray);
}

.team-page .toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.team-page .search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.team-page .search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-gray);
}

.team-page .search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
}

.team-page .filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.team-page .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    cursor: pointer;
}

.team-page .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-blue);
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.member-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.member-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.member-card.inactive {
    opacity: 0.7;
}

.member-header {
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.member-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
    flex-shrink: 0;
    overflow: hidden;
}

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

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

.member-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-role {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.member-role.agent {
    background: #DBEAFE;
    color: #2563EB;
}

.member-role.broker {
    background: #DCFCE7;
    color: #16A34A;
}

.member-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    color: var(--text-gray);
}

.icon-btn:hover {
    background: var(--bg-light);
}

.icon-btn.danger:hover {
    background: #FEE2E2;
    border-color: #EF4444;
}

.icon-btn.danger:hover svg {
    color: #EF4444;
}

.member-contact {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-gray);
    font-size: 0.875rem;
    text-decoration: none;
}

.contact-item:hover {
    color: var(--primary-blue);
}

.contact-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.member-stats {
    padding: 1rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-text {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.member-footer {
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.join-date {
    font-size: 0.8125rem;
    color: var(--text-gray);
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.inactive {
    background: #FEE2E2;
    color: #EF4444;
}

/* Access Denied */
.team-page .access-denied {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius-lg);
}

.team-page .access-denied svg {
    width: 80px;
    height: 80px;
    color: #EF4444;
    margin-bottom: 1.5rem;
}

.team-page .access-denied h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.team-page .access-denied p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

/* Empty State */
.team-page .empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius-lg);
}

.team-page .empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.team-page .empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.team-page .empty-state p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

/* Pagination */
.team-page .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.team-page .page-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.team-page .page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.team-page .page-btn:not(:disabled):hover {
    background: var(--bg-light);
}

.team-page .page-btn svg {
    width: 18px;
    height: 18px;
}

.team-page .page-info {
    font-size: 0.9375rem;
    color: var(--text-gray);
}

/* Modals */
.team-page .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.team-page .modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
}

.team-page .modal-small {
    max-width: 400px;
}

.team-page .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.team-page .modal-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.team-page .close-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.team-page .close-btn:hover {
    background: var(--bg-light);
}

.team-page .close-btn svg {
    width: 20px;
    height: 20px;
}

.team-page .modal-body {
    padding: 1.5rem;
}

.team-page .member-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.team-page .member-preview .member-avatar {
    width: 48px;
    height: 48px;
    font-size: 1rem;
}

.team-page .member-preview h3 {
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
}

.team-page .member-preview span {
    font-size: 0.875rem;
    color: var(--text-gray);
}

.team-page .form-group {
    margin-bottom: 1.25rem;
}

.team-page .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.team-page .form-group input,
.team-page .form-group select,
.team-page .form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
}

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

.team-page .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.team-page .error-message {
    padding: 0.75rem 1rem;
    background: #FEE2E2;
    color: #DC2626;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.team-page .confirm-message {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.team-page .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.team-page .spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
}

/* Team Page Responsive */
@media (max-width: 1200px) {
    .team-page .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .team-page .page-header {
        flex-direction: column;
        gap: 1rem;
    }

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

    .team-page .toolbar {
        flex-direction: column;
    }

    .team-page .search-box {
        max-width: none;
    }

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

    .team-page .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Team Collaboration (US-220) ===== */
.team-tabs {
    display: flex;
    gap: 0.25rem;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}
.team-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s;
}
.team-tab.active {
    background: white;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.team-tab:hover:not(.active) { color: #334155; }
.team-tab svg { flex-shrink: 0; }

.team-page .filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    background: white;
}

/* ===== Shared Listings Tab (US-220) ===== */
.listings-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
}
.listings-total-value {
    font-weight: 600;
    color: #1e293b;
}
.team-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.team-listing-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
}
.team-listing-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.team-listing-card .listing-thumb {
    position: relative;
    height: 140px;
    background: #f1f5f9;
    overflow: hidden;
}
.team-listing-card .listing-thumb img { width: 100%; height: 100%; object-fit: cover; }
.team-listing-card .listing-thumb-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}
.team-listing-card .listing-status {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #3b82f6;
    color: white;
    text-transform: capitalize;
}
.team-listing-card .listing-status.active { background: #3b82f6; }
.team-listing-card .listing-status.sold { background: #16a34a; }
.team-listing-card .listing-status.pending { background: #f59e0b; }
.team-listing-card .listing-details { padding: 0.85rem; }
.team-listing-card .listing-details h4 {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.team-listing-card .listing-price {
    margin: 0 0 0.15rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}
.team-listing-card .listing-address {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.listing-specs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.spec-item {
    font-size: 0.75rem;
    color: #475569;
    padding: 0.1rem 0.4rem;
    background: #f1f5f9;
    border-radius: 4px;
}
.listing-agent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.agent-chip {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    background: #eff6ff;
    color: #3b82f6;
    border-radius: 999px;
    font-weight: 500;
}
.listing-date { font-size: 0.75rem; color: #94a3b8; }

/* ===== Lead Assignment Tab (US-220) ===== */
.action-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}
.action-message.success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.action-message.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.dismiss-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.15rem;
    display: flex;
    align-items: center;
    opacity: 0.7;
}
.dismiss-btn:hover { opacity: 1; }
.leads-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
}
.leads-unassigned-count { color: #f59e0b; font-weight: 600; }
.leads-table {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.leads-header {
    display: grid;
    grid-template-columns: 2fr 0.8fr 0.8fr 2fr 1fr 1fr;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.leads-row {
    display: grid;
    grid-template-columns: 2fr 0.8fr 0.8fr 2fr 1fr 1fr;
    padding: 0.75rem 1rem;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.leads-row:last-child { border-bottom: none; }
.leads-row:hover { background: #f8fafc; }
.leads-row.assigning { opacity: 0.6; pointer-events: none; }
.col-name strong { display: block; font-size: 0.88rem; color: #1e293b; }
.lead-email { display: block; font-size: 0.78rem; color: #64748b; }
.lead-phone { display: block; font-size: 0.75rem; color: #94a3b8; }
.status-chip {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-chip.new { background: #dbeafe; color: #1d4ed8; }
.status-chip.contacted { background: #fef3c7; color: #92400e; }
.status-chip.qualified { background: #d1fae5; color: #065f46; }
.status-chip.showing { background: #ede9fe; color: #5b21b6; }
.status-chip.negotiating { background: #fce7f3; color: #9d174d; }
.status-chip.closed { background: #d1fae5; color: #065f46; }
.status-chip.lost { background: #fee2e2; color: #991b1b; }
.priority-chip {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}
.priority-chip.low { background: #f1f5f9; color: #64748b; }
.priority-chip.medium { background: #dbeafe; color: #1d4ed8; }
.priority-chip.high { background: #fef3c7; color: #92400e; }
.priority-chip.urgent { background: #fee2e2; color: #991b1b; }
.assign-select {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    background: white;
    cursor: pointer;
}
.assign-select:disabled { opacity: 0.5; cursor: not-allowed; }
.col-date { font-size: 0.82rem; color: #475569; }
.last-contact { display: block; font-size: 0.72rem; color: #94a3b8; margin-top: 0.1rem; }
.lead-budget {
    font-size: 0.72rem;
    padding: 0.15rem 0.4rem;
    background: #ecfdf5;
    color: #065f46;
    border-radius: 4px;
    font-weight: 600;
    margin-right: 0.3rem;
}
.icon-btn.small {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.col-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ===== Team Calendar Tab (US-220) - Monthly View ===== */
.team-calendar-section { }
.calendar-header-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.calendar-header-bar h3 { margin: 0; font-size: 1.1rem; font-weight: 600; color: #1e293b; min-width: 180px; text-align: center; }
.btn.btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.btn.btn-sm:hover { background: #f1f5f9; }

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    padding: 0.5rem 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}
.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.calendar-cell {
    background: white;
    min-height: 80px;
    padding: 0.4rem;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.calendar-cell:hover { background: #f8fafc; }
.calendar-cell.empty {
    background: #fafafa;
    cursor: default;
}
.calendar-cell.today { background: #f0f7ff; }
.calendar-cell.selected { background: #eff6ff; box-shadow: inset 0 0 0 2px #3b82f6; }
.calendar-cell.has-events { }
.cell-day-num {
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.3rem;
}
.cell-day-num.today-num {
    background: #3b82f6;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}
.cell-dots {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    align-items: center;
}
.event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    flex-shrink: 0;
}
.event-dot.showing { background: #10b981; }
.event-dot.openhouse { background: #f59e0b; }
.event-dot-more {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
}

/* Day Detail Panel */
.day-detail-panel {
    margin-top: 1.25rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.day-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.day-detail-header h4 { margin: 0; font-size: 0.95rem; font-weight: 600; color: #1e293b; flex: 1; }
.event-count {
    font-size: 0.78rem;
    color: #64748b;
    padding: 0.15rem 0.5rem;
    background: #e2e8f0;
    border-radius: 999px;
}
.close-btn-sm {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    color: #94a3b8;
    border-radius: 4px;
}
.close-btn-sm:hover { background: #e2e8f0; color: #475569; }
.day-events-list {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.day-event-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    background: #fafbfc;
    transition: background 0.15s;
}
.day-event-card:hover { background: #f1f5f9; }
.event-type-badge {
    writing-mode: vertical-lr;
    text-orientation: mixed;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
}
.event-type-badge.showing { background: #ecfdf5; color: #059669; }
.event-type-badge.openhouse { background: #fffbeb; color: #d97706; }
.event-card-content { flex: 1; min-width: 0; }
.event-card-content h5 {
    margin: 0 0 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}
.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}
.event-time-range,
.event-location {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #475569;
}
.event-time-range svg,
.event-location svg { color: #94a3b8; flex-shrink: 0; }
.event-details-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.event-agent-name {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: #3b82f6;
    font-weight: 500;
}
.event-agent-name svg { color: #3b82f6; flex-shrink: 0; }
.event-client {
    font-size: 0.78rem;
    color: #64748b;
}
.event-status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}
.event-status-badge.scheduled { background: #dbeafe; color: #1d4ed8; }
.event-status-badge.confirmed { background: #d1fae5; color: #065f46; }
.event-status-badge.completed { background: #f1f5f9; color: #475569; }
.event-status-badge.cancelled { background: #fee2e2; color: #991b1b; }
.event-status-badge.noshow { background: #fef3c7; color: #92400e; }
.event-status-badge.rescheduled { background: #ede9fe; color: #5b21b6; }
.no-events-msg {
    padding: 1.5rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
}
.calendar-legend {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    padding: 0.75rem 0;
    margin-top: 0.5rem;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #64748b;
}
.legend-item .event-dot { width: 10px; height: 10px; }

/* ===== US-220 Responsive ===== */
@media (max-width: 768px) {
    .team-tabs { flex-wrap: wrap; }
    .team-tab { flex: 1; min-width: 0; justify-content: center; font-size: 0.78rem; padding: 0.4rem 0.5rem; }
    .team-listings-grid { grid-template-columns: 1fr; }
    .leads-header { display: none; }
    .leads-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 1rem;
    }
    .leads-row .col-priority::before { content: "Priority: "; font-weight: 400; color: #94a3b8; }
    .leads-row .col-assigned::before { content: "Assign: "; font-weight: 400; color: #94a3b8; font-size: 0.78rem; }
    .leads-row .col-date::before { content: "Created: "; font-weight: 400; color: #94a3b8; }
    .calendar-month-grid {
        gap: 0;
    }
    .calendar-cell { min-height: 52px; padding: 0.25rem; }
    .cell-day-num { font-size: 0.75rem; }
    .cell-day-num.today-num { width: 22px; height: 22px; font-size: 0.7rem; }
    .event-dot { width: 6px; height: 6px; }
    .day-detail-panel { margin-top: 0.75rem; }
    .day-event-card { flex-direction: column; }
    .event-type-badge { writing-mode: horizontal-tb; padding: 0.2rem 0.5rem; min-width: auto; }
    .event-meta { flex-direction: column; gap: 0.25rem; }
    .listings-summary, .leads-summary { flex-direction: column; gap: 0.25rem; align-items: flex-start; }
}
