/* File: static/css/main.css */
/* Modular CSS Architecture - Phase 1 */

/* =================================================================== */
/* BASE STYLES - Load First (Foundation)                              */
/* =================================================================== */
@import 'base/variables.css';  /* CSS Custom Properties */
@import 'base/reset.css';      /* CSS Reset */
@import 'base/typography.css'; /* Typography & Font Styles */

/* =================================================================== */
/* LAYOUT STYLES - Structure & Sidebar                                */
/* =================================================================== */
@import 'layouts/layout.css';  /* Main Layout & Content Areas */
@import 'layouts/sidebar.css'; /* Sidebar Component (Complete) */

/* =================================================================== */
/* COMPONENTS                                                          */
/* =================================================================== */
@import 'components/search.css'; /* Global Search Component */
@import 'components/notifications.css'; /* Unified Notification System */
@import 'components/forms.css'; /* Form Elements & Validation */
@import 'components/buttons.css'; /* Button Styles & Variants */
@import 'components/tables.css'; /* Base Table Styles */

/* =================================================================== */
/* PAGE-SPECIFIC STYLES                                                */
/* =================================================================== */
@import 'pages/properties.css'; /* Properties Page & Table */
@import 'pages/residents.css'; /* Residents Page & Table */
@import 'pages/tickets.css'; /* Tickets Page & Table */
@import 'pages/payments.css'; /* Payments Page & Table */
@import 'pages/dashboard.css'; /* Dashboard Page & Charts */

/* Page Header */
.page-header {
    margin-bottom: var(--spacing-2xl);
}

.page-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.page-description {
    font-size: 15px;
    color: var(--muted-foreground);
    line-height: 1.6;
    font-weight: 400;
}

/* Content Sections */
.content-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

/* Search Section */
.search-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-section:hover {
    box-shadow: var(--shadow-md);
}

.search-container {
    position: relative;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--background);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    color: var(--primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
    background: rgba(255, 255, 255, 0.9);
}

.search-input::placeholder {
    color: var(--muted);
}

/* Filters Section */
.filters-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filters-section:hover {
    box-shadow: var(--shadow-md);
}

.filters-container {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
    flex-wrap: wrap;
}



/* Date cell styling for created date with age underneath */
.date-primary {
    font-size: var(--font-size-sm);
    color: var(--primary);
    margin-bottom: 2px;
}

.date-secondary {
    font-size: var(--font-size-xs);
    color: var(--muted-foreground);
    font-style: italic;
}

/* Status container with third-party indicator */
.status-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Third-party communication indicator */
.third-party-wrapper {
    position: relative;
    display: inline-block;
    margin-left: 6px;
}

.third-party-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(107, 114, 128, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.2);
    border-radius: var(--radius-sm);
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.third-party-indicator:hover {
    background: rgba(107, 114, 128, 0.15);
    border-color: rgba(107, 114, 128, 0.4);
    color: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.1);
}

.third-party-indicator i {
    font-size: 14px;
}

/* Third-party tooltip - shadcn style */
.third-party-tooltip {
    position: fixed;
    width: 280px;
    background: #09090b;
    border: 1px solid #27272a;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out;
    z-index: 10002;
    pointer-events: none;
    color: #fafafa;
}

.third-party-tooltip-header {
    padding: 12px 12px 8px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #fafafa;
    border-bottom: 1px solid #27272a;
}

.third-party-tooltip-content {
    padding: 8px 12px 12px;
    font-size: var(--font-size-sm);
    line-height: 1.4;
    color: #d4d4d8;
}

/* =================================================================== */
/* Screening Criteria Styling - Clean & Lightweight                  */
/* =================================================================== */

.screening-criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.screening-criterion {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--background);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    position: relative;
}

.screening-criterion:hover {
    border-color: var(--border);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.criterion-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: rgba(17, 24, 39, 0.04);
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: var(--radius-sm);
}

.criterion-icon i {
    font-size: 16px;
    opacity: 0.8;
}

.criterion-content {
    flex: 1;
    min-width: 0;
}

.criterion-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 6px;
}

.criterion-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--primary);
    margin: 0;
    line-height: var(--leading-tight);
    flex-shrink: 0;
}

.criterion-value {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--primary);
    margin: 0;
    line-height: var(--leading-tight);
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    min-width: 0;
}

.criterion-description {
    font-size: var(--font-size-xs);
    color: var(--muted);
    line-height: var(--leading-normal);
    margin: 0;
}

/* Responsive adjustments for screening criteria */
@media (max-width: 768px) {
    .screening-criteria-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .screening-criterion {
        padding: 12px;
        gap: 10px;
    }
    
    .criterion-icon {
        width: 32px;
        height: 32px;
    }
    
    .criterion-icon i {
        font-size: 14px;
    }
    
    .criterion-header {
        gap: 3px;
    }
    
    .criterion-value {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

/* =================================================================== */
/* Unit Cards - Clean & Lightweight Design                           */
/* =================================================================== */

.unit-card {
    background: var(--background);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Future-ready: Subtle visual distinction for managed listings */
.unit-card[data-listing-source="managed"] {
    /* Could add subtle styling differences for internally managed listings */
    /* border-left: 3px solid var(--accent); */
}

/* Future-ready: Styling for unit management actions */
.unit-card[data-listing-source="managed"]:hover .unit-actions {
    /* Could show additional management options on hover */
}

.unit-card:hover {
    border-color: var(--border);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.unit-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.unit-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.unit-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.unit-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--primary);
    margin: 0;
    line-height: var(--leading-tight);
}

.unit-subtitle {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    margin: 0;
    line-height: var(--leading-normal);
}

.unit-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.unit-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.unit-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.detail-row .detail-label {
    font-size: var(--font-size-xs);
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.detail-row .detail-value {
    font-size: var(--font-size-sm);
    color: var(--primary);
    font-weight: 500;
    text-align: right;
    margin: 0;
}

.detail-value-primary {
    color: var(--accent) !important;
    font-weight: 600 !important;
}

.unit-actions {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.unit-action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

.unit-action-link:hover {
    color: var(--accent-hover);
}

.unit-action-link i {
    font-size: 12px;
}

/* Status badges - refined versions */
.status-badge.status-available {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-badge.status-inactive {
    background: var(--secondary-dark);
    color: var(--muted-foreground);
    border: 1px solid var(--border);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .unit-card {
        margin-bottom: 12px;
    }
    
    .unit-header,
    .unit-content {
        padding: 12px;
    }
    
    .unit-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .unit-badges {
        align-self: flex-start;
    }
    
    .detail-row {
        gap: 6px;
    }
}

/* External link styling for units */
.external-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.external-link:hover {
    color: var(--accent-hover);
    background: var(--secondary);
    border-color: var(--border);
    transform: translateY(-1px);
}

.external-link svg {
    width: 14px;
    height: 14px;
}

.detail-action {
    grid-column: 1 / -1;
}

/* Status badge variations for units */
.status-exclusive {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.status-inactive {
    background: var(--muted);
    color: white;
    opacity: 0.8;
}

/* Modern Table Content Styles */
.amount {
    font-weight: 600;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-moved-out {
    background: #f3f4f6;
    color: #374151;
}

.status-new {
    background: #dbeafe;
    color: #1e40af;
}

.status-in-progress {
    background: #fef3c7;
    color: #92400e;
}

.status-waiting-for {
    background: #fed7d7;
    color: #991b1b;
}

.status-closed {
    background: #f3f4f6;
    color: #374151;
}

.status-on-hold {
    background: #fef3c7;
    color: #92400e;
}

/* Table Loading States */
.table-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
}

.table-loading .loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Card Actions */
.card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
    color: var(--primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 164, 153, 0.1);
}

/* Property Detail Table Enhancements */
.detail-card .table-container {
    border: none;
    box-shadow: none;
    border-radius: 0;
}


/* Priority Badges */
.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
    max-width: max-content;
}

.priority-high {
    background: #fef2f2;
    color: #991b1b;
}

.priority-medium {
    background: #fef3c7;
    color: #92400e;
}

.priority-low {
    background: #f0fdf4;
    color: #166534;
}

.priority-normal {
    background: #f3f4f6;
    color: #374151;
}

/* Case Number Styling */
.case-number {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--accent);
}

.child-number {
    color: var(--muted-foreground);
    font-weight: 500;
}

.child-subject {
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.child-subject:hover {
    color: var(--accent);
}

.parent-reference {
    font-size: var(--font-size-xs);
    color: var(--muted);
    margin-top: 4px;
    font-style: italic;
}

.parent-ticket.has-children {
    border-left: 3px solid var(--accent);
    background: rgba(0, 164, 153, 0.02);
}

.hierarchy-controls {
    text-align: center;
    width: 60px;
}

.hierarchy-controls .expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    color: var(--muted-foreground);
    margin: 0 auto;
}

.hierarchy-controls .expand-btn:hover {
    background: var(--secondary-dark);
    color: var(--primary);
}

.hierarchy-controls .expand-btn svg {
    width: 16px;
    height: 16px;
}

.child-count {
    background: var(--accent);
    color: white;
    font-size: var(--font-size-xs);
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

/* Search mode styles */
.hierarchy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.hierarchy-icon svg {
    width: 16px;
    height: 16px;
}

.parent-icon {
    color: var(--accent);
}

.child-icon {
    color: var(--muted-foreground);
}

.parent-reference-search {
    font-size: var(--font-size-xs);
    color: var(--accent);
    margin-top: 4px;
    font-weight: 500;
}

.search-child-indicator {
    background: var(--secondary-dark);
    color: var(--muted-foreground);
    font-size: var(--font-size-xs);
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

/* Resident Name in Tables */
.resident-name {
    font-weight: 500;
    color: var(--primary);
}

.status-closed {
    background: #dcfce7;
    color: #166534;
}

/* Priority Colors */
.priority-high {
    color: var(--error);
    font-weight: 600;
}

.priority-medium {
    color: var(--warning);
    font-weight: 500;
}

.priority-low {
    color: var(--muted);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xl);
    border-top: 1px solid var(--border);
    background: var(--background);
}

.pagination-info {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--secondary);
    color: var(--primary);
    border-color: var(--muted);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
}

.pagination-numbers {
    display: flex;
    gap: var(--spacing-xs);
}

.pagination-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.pagination-number:hover {
    background: var(--secondary);
    color: var(--primary);
    border-color: var(--muted);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pagination-number.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.pagination-number.active:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-lg);
}

.loading-text {
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    color: var(--muted-foreground);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}


/* Map Components */
.view-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--border-light);
    border-radius: var(--radius-md);
    padding: 2px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-toggle-btn svg {
    width: 16px;
    height: 16px;
}

.view-toggle-btn:hover {
    color: var(--primary);
    background: rgba(0, 164, 153, 0.08);
}

.view-toggle-btn.active {
    background: var(--background);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.map-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border);
    background: var(--secondary);
}

.map-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

.map-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.properties-map {
    width: 100%;
    height: 500px;
    border: none;
    display: block;
}


/* Map Info Window Styles */
.map-info-window {
    max-width: 280px;
    padding: 12px;
    font-family: var(--font-family);
}

.info-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.info-address {
    font-size: 14px;
    color: var(--muted-foreground);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.info-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.info-tag {
    display: inline-block;
    padding: 3px 8px;
    background: var(--border-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    white-space: nowrap;
}

.info-manager {
    font-size: 13px;
    color: var(--muted-foreground);
    margin: 0 0 12px 0;
    font-style: italic;
}

.info-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
}

.info-btn:hover {
    background: var(--accent-hover);
}

/* Map responsive styles */
@media (max-width: 768px) {
    .view-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .view-toggle-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 16px;
    }
    
    .map-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
        padding: var(--spacing-lg);
    }
    
    .map-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .properties-map {
        height: 400px;
    }

    .map-info-window {
        max-width: 240px;
        padding: 10px;
    }
    
    .info-title {
        font-size: 15px;
    }
    
    .info-address {
        font-size: 13px;
    }
}

/* =================================================================== */
/* Enhanced Resident Cards & Ticket Tooltips                         */
/* =================================================================== */

/* Resident Cards Container */
.residents-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

/* Enhanced Card Structure */
.resident-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: visible;
    cursor: pointer;
    height: fit-content;
}

.resident-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Card Header */
.card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
}

.card-icon {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.card-icon svg {
    width: 18px;
    height: 18px;
    color: white;
}

.resident-card:hover .card-icon {
    background: var(--accent-hover);
    transform: scale(1.05);
}

/* Gray icon for moved out residents */
.resident-card.moved-out .card-icon {
    background: #6b7280;
}

.resident-card.moved-out:hover .card-icon {
    background: #4b5563;
    transform: scale(1.05);
}

.card-title-section {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--primary);
    margin: 0;
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    margin-top: 2px;
    font-weight: 500;
}

.card-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

/* Card Details */
.card-details {
    padding: var(--spacing-md);
}

/* Detail Information Layout - Single Row with Better Flow */
.detail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    align-items: baseline;
}

.detail-grid:last-child {
    margin-bottom: 0;
}

.detail-item {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
    text-align: left !important;
    align-items: flex-start !important;
}

.detail-label {
    font-size: var(--font-size-xs);
    color: var(--muted-foreground);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.detail-value {
    font-size: var(--font-size-sm);
    color: var(--primary);
    font-weight: 500;
    line-height: var(--leading-tight);
    text-align: left !important;
}


/* Status Badge Enhancements */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-active {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.status-moved-out {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* =================================================================== */
/* Enhanced Clickable Card States                                     */
/* =================================================================== */

.clickable-card {
    cursor: pointer;
    user-select: none;
}

.clickable-card:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.clickable-card:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* =================================================================== */
/* Related List Component                                              */
/* =================================================================== */

.related-list-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: visible;
}

/* Header */
.related-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-light);
    background: var(--secondary);
}

.header-title-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-list-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

.record-count {
    font-size: var(--font-size-sm);
    color: var(--muted);
    font-weight: 500;
    background: var(--secondary);
    padding: 2px 8px;
    border-radius: 12px;
}

.related-list-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Controls */
.related-list-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-xl);
    border-bottom: 1px solid var(--border-light);
    background: var(--background);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.related-list-controls-left,
.related-list-controls-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Search */
.search-input-container {
    position: relative;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background: var(--background);
    transition: all 0.15s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted-foreground);
    pointer-events: none;
}

/* Filters and Sort */
.filter-group,
.sort-group {
    display: flex;
    align-items: center;
}

.filter-select,
.sort-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 140px;
}

.filter-select:focus,
.sort-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

/* View Toggle */
.view-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--border-light);
    border-radius: var(--radius-md);
    padding: 2px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-toggle-btn svg {
    width: 16px;
    height: 16px;
}

.view-toggle-btn:hover {
    color: var(--primary);
    background: rgba(0, 164, 153, 0.08);
}

.view-toggle-btn.active {
    background: var(--background);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Content Area */
.related-list-content {
    min-height: 200px;
    /* Removed max-height and overflow-y to prevent nested scrolling */
}

/* Records Grid (Card View) */
.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
}

.records-single-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-xl);
}

/* Smooth pagination transitions */
.related-list-content {
    transition: opacity 0.15s ease-in-out;
}

.pagination-loading {
    animation: fadeIn 0.15s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Records Table */
.records-table {
    width: 100%;
}

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

.records-table th,
.records-table td {
    text-align: left;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
}

.records-table th {
    background: var(--secondary);
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.records-table td {
    font-size: var(--font-size-sm);
    color: var(--primary);
}

.records-table tbody tr:hover {
    background: var(--secondary);
}

/* States */
.loading-state,
.error-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
    text-align: center;
}

.loading-state {
    gap: var(--spacing-lg);
}

.error-state svg,
.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-lg);
}

.error-state p,
.empty-state p {
    color: var(--muted-foreground);
    font-size: var(--font-size-base);
    margin: 0 0 var(--spacing-lg) 0;
}

.retry-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.retry-btn:hover {
    background: var(--secondary);
    border-color: var(--accent);
}

/* Pagination */
.related-list-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--border-light);
    background: var(--secondary);
}

.pagination-info {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--secondary);
    color: var(--primary);
    border-color: var(--muted);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn svg {
    width: 14px;
    height: 14px;
}

.pagination-numbers {
    display: flex;
    gap: var(--spacing-xs);
    margin: 0 var(--spacing-sm);
}

.pagination-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.pagination-number:hover {
    background: var(--secondary);
    color: var(--primary);
    border-color: var(--muted);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pagination-number.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.pagination-number.active:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--muted-foreground);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .related-list-controls {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .related-list-controls-left,
    .related-list-controls-right {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .search-input-container {
        min-width: 200px;
        flex: 1;
    }
    
    .records-grid {
        grid-template-columns: 1fr;
        padding: var(--spacing-md);
    }
    
    .related-list-pagination {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
        text-align: center;
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination-numbers {
        order: -1;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Detail Pages */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--muted-foreground);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.breadcrumb-item:hover {
    background: var(--secondary);
    color: var(--primary);
}

.breadcrumb-item svg {
    width: 14px;
    height: 14px;
}

.breadcrumb-separator {
    color: var(--muted);
    font-weight: 400;
}

.breadcrumb-current {
    font-weight: 600;
    color: var(--primary);
}

.detail-header {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
}

.detail-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xl);
}

.detail-title-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.detail-icon {
    width: 48px;
    height: 48px;
    background: rgba(0, 164, 153, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.detail-icon svg {
    width: 24px;
    height: 24px;
}

.detail-title-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
}

.detail-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0;
    line-height: var(--leading-tight);
}

.detail-subtitle {
    font-size: var(--font-size-base);
    color: var(--muted-foreground);
    font-weight: 500;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex-shrink: 0;
}


/* Section Navigation */
.section-nav {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: var(--spacing-lg);
    z-index: 40;
}

.section-nav-container {
    padding: var(--spacing-md);
}

.section-nav-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.section-nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 16px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    font-weight: 500;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
}

.section-nav-item:hover {
    background: rgba(0, 164, 153, 0.08);
    color: var(--accent);
    transform: translateY(-1px);
}

.section-nav-item.active {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-sm);
}

.section-nav-item.active:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

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


/* Tab Content Styles */
.detail-section {
    display: none; /* Hide all sections by default */
    margin-bottom: var(--spacing-xl);
}

.detail-section.active {
    display: block; /* Show active section */
}

.detail-content {
    display: grid;
    gap: var(--spacing-xl);
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.detail-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 1rem 0rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-card:hover {
    box-shadow: var(--shadow-md);
}

.detail-card-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border);
    background: rgba(248, 250, 252, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

.detail-card-content {
    padding: var(--spacing-xl);
}

.detail-grid {
    display: grid;
    gap: var(--spacing-lg);
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.detail-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: var(--font-size-base);
    color: var(--primary);
    font-weight: 500;
    word-break: break-word;
}

.detail-value.detail-id {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    background: rgba(107, 114, 128, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.detail-value.detail-currency {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-weight: 700;
    color: var(--success);
    font-size: var(--font-size-lg);
}

.stats-grid {
    display: grid;
    gap: var(--spacing-xl);
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-item {
    text-align: center;
    padding: var(--spacing-lg);
    background: rgba(248, 250, 252, 0.5);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--accent);
    margin-bottom: var(--spacing-xs);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.description-content,
.notes-content {
    line-height: var(--leading-relaxed);
}

.description-content p,
.notes-content p {
    margin-bottom: var(--spacing-lg);
    color: var(--primary);
}

.description-content p:last-child,
.notes-content p:last-child {
    margin-bottom: 0;
}

.no-content {
    color: var(--muted-foreground);
    font-style: italic;
}

.detail-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
}

.loading-content .loading-spinner {
    margin: 0 auto var(--spacing-lg) auto;
}

.loading-content p {
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
    font-weight: 500;
}


/* Detail Page Mobile Responsive */
@media (max-width: 1024px) {
    .detail-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .detail-header-content {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-lg);
    }
    
    .detail-title-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--spacing-lg);
    }
    
    .detail-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
}

@media (max-width: 768px) {
    .detail-header {
        padding: var(--spacing-xl);
    }
    
    .detail-card-content,
    .detail-card-header {
        padding: var(--spacing-lg);
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: var(--spacing-lg);
    }
    
    .stat-item {
        padding: var(--spacing-md);
        min-height: 80px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .stat-value {
        font-size: var(--font-size-xl);
    }
    
    .detail-title {
        font-size: var(--font-size-2xl);
    }
    
    .detail-icon {
        width: 40px;
        height: 40px;
    }
    
    .detail-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .breadcrumb {
        flex-wrap: wrap;
    }
    
    /* Ensure detail content uses single column on small screens */
    .detail-content {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .detail-header {
        padding: var(--spacing-lg);
    }
    
    .detail-card-content,
    .detail-card-header {
        padding: var(--spacing-md);
    }
    
    .detail-content {
        gap: var(--spacing-md);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .stat-item {
        padding: var(--spacing-sm);
        min-height: 70px;
    }
    
    .stat-value {
        font-size: var(--font-size-lg);
    }
    
    .stat-label {
        font-size: 10px;
    }
}

/* Related Records Components */
.cases-list, .residents-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.case-item, .resident-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.case-item:hover, .resident-item:hover {
    background: var(--secondary);
    border-color: var(--border);
    transform: translateY(-1px);
}

.case-info, .resident-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.case-subject, .resident-name {
    font-weight: 600;
    color: var(--primary);
    font-size: var(--font-size-base);
}

.case-details, .resident-details {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
}

.case-date, .resident-unit, .resident-rent, .resident-move-in {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
}

.case-status, .case-priority, .resident-status {
    font-size: var(--font-size-xs);
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.case-status, .resident-status {
    background: var(--border);
    color: var(--primary);
}

.status-new { background: #e0f2fe; color: #0277bd; }
.status-in-progress, .status-working { background: #fff3e0; color: #f57c00; }
.status-closed, .status-resolved { background: #e8f5e8; color: #2e7d32; }
.status-escalated { background: #ffebee; color: #c62828; }
.status-active { background: #e8f5e8; color: #2e7d32; }
.status-moved-out { background: #f5f5f5; color: #666666; }

.case-priority {
    background: var(--secondary);
    color: var(--muted-foreground);
}

#priority {
    padding: 0.5rem;
    text-align: center;
    border-radius: 2rem;
}

.priority-high { background: #ffebee; color: #c62828; }
.priority-medium { background: #fff3e0; color: #f57c00; }
.priority-low { background: #e8f5e8; color: #2e7d32; }

.case-arrow, .resident-arrow {
    color: var(--muted-foreground);
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-left: var(--spacing-md);
    transition: transform 0.15s ease;
}

.case-item:hover .case-arrow,
.resident-item:hover .resident-arrow {
    transform: translateX(2px);
    color: var(--accent);
}

/* Mobile optimizations for related lists */
@media (max-width: 768px) {
    .case-item, .resident-item {
        padding: var(--spacing-lg);
        min-height: 44px; /* Touch target minimum */
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
        position: relative;
        padding-right: calc(var(--spacing-xl) + 20px); /* Space for arrow */
    }

    .case-info, .resident-info {
        gap: var(--spacing-sm);
    }

    .case-details, .resident-details {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }

    .case-subject, .resident-name {
        font-size: var(--font-size-lg);
        margin-bottom: var(--spacing-xs);
    }

    .case-arrow, .resident-arrow {
        position: absolute;
        right: var(--spacing-lg);
        top: 50%;
        transform: translateY(-50%);
        font-size: var(--font-size-xl);
    }
}

@media (max-width: 480px) {
    .case-item, .resident-item {
        padding: var(--spacing-md);
        padding-right: calc(var(--spacing-lg) + 20px);
    }

    .case-details, .resident-details {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    .case-status, .case-priority, .resident-status {
        font-size: 10px;
        padding: 1px 4px;
    }

    .case-arrow, .resident-arrow {
        right: var(--spacing-md);
        font-size: var(--font-size-lg);
    }
}

/* Touch target optimization for detail pages */
@media (max-width: 768px) {
    /* Ensure all clickable elements meet 44px minimum */
    .detail-link,
    .breadcrumb-item {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 12px 16px;
    }
    
    /* Detail grid items that are clickable */
    .detail-field[onclick],
    .detail-value[onclick],
    .detail-item[onclick] {
        min-height: 44px;
        padding: 12px;
        border-radius: var(--radius-sm);
        transition: background 0.15s ease;
    }
    
    .detail-field[onclick]:hover,
    .detail-value[onclick]:hover,
    .detail-item[onclick]:hover {
        background: var(--secondary);
    }
    
    /* Breadcrumb touch targets */
    .breadcrumb-item {
        padding: 12px 16px;
        border-radius: var(--radius-md);
    }
    
    /* Detail grid mobile improvements */
    .detail-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-md);
    }
    
    .detail-field {
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--border-light);
        margin-bottom: var(--spacing-sm);
    }
    
    .detail-field:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .detail-label {
        font-size: var(--font-size-sm);
        font-weight: 600;
        color: var(--muted-foreground);
        margin-bottom: var(--spacing-xs);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .detail-value {
        font-size: var(--font-size-base);
        color: var(--primary);
        line-height: var(--leading-relaxed);
        word-break: break-word;
    }
    
    /* Specific detail value types */
    .detail-value.detail-currency {
        font-size: var(--font-size-lg);
        font-weight: 700;
    }
    
    .detail-value.detail-id {
        font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
        font-size: var(--font-size-sm);
        background: var(--border-light);
        padding: var(--spacing-xs) var(--spacing-sm);
        border-radius: var(--radius-sm);
        display: inline-block;
    }
}

.no-data-message {
    text-align: center;
    color: var(--muted-foreground);
    font-style: italic;
    padding: var(--spacing-xl);
    background: var(--border-light);
    border-radius: var(--radius-md);
}

/* Health Metrics */
.health-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.health-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--border-light);
    border-radius: var(--radius-md);
    position: relative;
}

.metric-label {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.metric-value {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}

.metric-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--muted);
}

.metric-indicator.good { background: var(--success); }
.metric-indicator.warning { background: var(--warning); }
.metric-indicator.poor { background: var(--error); }

/* Card Actions */
.card-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Email Timeline */
.timeline-container {
    position: relative;
    padding-left: var(--spacing-xl);
}

.timeline-line {
    position: absolute;
    left: 18px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: linear-gradient(180deg, var(--border) 0%, var(--border-light) 100%);
}

.timeline-item {
    position: relative;
    margin: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--card);
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 4px var(--card);
    z-index: 10;
}

.timeline-item.incoming::before {
    border-color: var(--success);
}

.timeline-item.outgoing::before {
    border-color: var(--accent);
}

.timeline-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border);
    background: rgba(248, 250, 252, 0.5);
}

.timeline-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.timeline-direction {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timeline-direction.incoming {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.timeline-direction.outgoing {
    background: rgba(0, 164, 153, 0.1);
    color: var(--accent);
}

.timeline-direction i {
    font-size: 12px;
}

.timeline-date {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    font-weight: 500;
}

.timeline-subject {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--spacing-xs);
    line-height: var(--leading-tight);
}

.timeline-participants {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
}

.participant-label {
    font-weight: 600;
}

.participant-email {
    color: var(--primary);
}

.timeline-content {
    padding: var(--spacing-xl);
}

.timeline-body {
    line-height: var(--leading-relaxed);
    color: var(--primary);
}

.timeline-body p {
    margin-bottom: var(--spacing-md);
}

.timeline-body p:last-child {
    margin-bottom: 0;
}

.timeline-body blockquote {
    border-left: 4px solid var(--border);
    margin: var(--spacing-lg) 0;
    padding-left: var(--spacing-lg);
    color: var(--muted-foreground);
    font-style: italic;
}

.timeline-empty {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    color: var(--muted-foreground);
}

.timeline-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

/* Link styling for ticket detail navigation */
.detail-link {
    color: var(--accent);
    text-decoration: none !important;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.detail-link:hover {
    color: var(--accent-hover);
    text-decoration: none !important;
}

.detail-link:visited {
    text-decoration: none !important;
}

.detail-link:focus {
    text-decoration: none !important;
}

.detail-link:active {
    text-decoration: none !important;
}

/* Prevent text-decoration inheritance */
.detail-link * {
    text-decoration: none !important;
}

/* Global reset for any potential link inheritance issues */
.sidebar a,
.nav-item a,
.menu-item a,
.breadcrumb a {
    text-decoration: none !important;
}

/* Mobile Responsive for Related Records */
@media (max-width: 768px) {
    .case-details, .resident-details {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .health-metrics {
        grid-template-columns: 1fr;
    }
    
    .health-metric {
        padding: var(--spacing-md);
    }
    
    .metric-value {
        font-size: var(--font-size-xl);
    }

    .case-item, .resident-item {
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

/* Maps */
.map-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-container:hover {
    box-shadow: var(--shadow-md);
}

.map-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--background);
}

.map-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary);
}

.map-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.map-toggle-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-toggle-btn:hover {
    background: var(--secondary);
    color: var(--primary);
    border-color: var(--muted);
}

.map-toggle-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.map-toggle-btn svg {
    width: 16px;
    height: 16px;
}

.properties-map {
    width: 100%;
    height: 500px;
    border: none;
}

.map-info-window {
    max-width: 250px;
}

.map-info-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
    font-size: 14px;
}

.map-info-address {
    color: var(--muted-foreground);
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.map-info-details {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.map-info-detail {
    font-size: 11px;
    color: var(--muted);
}

.map-info-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.map-info-link:hover {
    background: var(--accent-hover);
}

.map-info-link svg {
    width: 12px;
    height: 12px;
}

/* Map View Toggle */
.view-toggle {
    display: flex;
    background: var(--secondary);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--border);
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-toggle-btn:hover {
    color: var(--primary);
}

.view-toggle-btn.active {
    background: var(--background);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.view-toggle-btn svg {
    width: 16px;
    height: 16px;
}

/* Map responsive */
@media (max-width: 768px) {
    .properties-map {
        height: 350px;
    }

    .map-header {
        padding: var(--spacing-lg);
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }
    
    .map-actions {
        justify-content: center;
    }
    
    .view-toggle {
        width: 100%;
        justify-content: center;
    }
}

/* Timeline Styles */
.timeline-card {
    max-width: none;
    width: 100%;
}

.timeline-content {
    padding: 0;
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.timeline-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-toggle:hover {
    background: var(--secondary-dark);
    color: var(--primary);
}

.timeline-toggle svg {
    width: 14px;
    height: 14px;
}

.timeline-container {
    position: relative;
    padding: var(--spacing-xl);
    overflow-x: auto;
    overflow-y: visible;
}

/* Horizontal Timeline (Desktop) */
.timeline {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-2xl);
    min-width: fit-content;
    padding: var(--spacing-2xl) 0;
    padding-bottom: var(--spacing-xl);
}

.timeline::before {
    content: '';
    position: absolute;
    top: 52px; /* Half of icon height (40px) + border (3px) + some padding */
    left: 20px; /* Half of first icon width */
    right: 20px; /* Half of last icon width */
    height: 3px;
    background: linear-gradient(to right, var(--border), var(--accent), var(--border));
    border-radius: 2px;
    z-index: 1;
}

.timeline-event {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    position: relative;
    min-width: 200px;
    max-width: 280px;
    flex-shrink: 0;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--background);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 4;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-icon:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.timeline-icon svg {
    width: 18px;
    height: 18px;
}

/* Horizontal Timeline Content */
.timeline-content {
    text-align: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.timeline-content:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.timeline-header {
    margin-bottom: var(--spacing-md);
}

.timeline-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: var(--leading-tight);
    margin: 0 0 var(--spacing-xs) 0;
    color: var(--primary);
}

.timeline-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: var(--spacing-sm);
}

.timeline-date-primary {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--accent);
}

.timeline-time {
    font-size: var(--font-size-xs);
    color: var(--muted);
}

.timeline-description {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Horizontal Timeline Details */
.timeline-details {
    background: var(--secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-light);
    text-align: left;
}

/* Timeline-specific detail items */
.timeline-details .detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
    font-size: var(--font-size-xs);
}

.timeline-details .detail-item:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
}

.timeline-details .detail-label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--muted-foreground);
}

.timeline-details .detail-value {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--primary);
}

.timeline-action {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--accent);
    color: var(--background);
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-top: var(--spacing-xs);
}

.timeline-action:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Timeline Event Types */
.timeline-event-success .timeline-icon {
    background: var(--success);
    color: white;
}

.timeline-event-warning .timeline-icon {
    background: var(--warning);
    color: white;
}

.timeline-event-danger .timeline-icon {
    background: var(--error);
    color: white;
}

.timeline-event-primary .timeline-icon {
    background: var(--accent);
    color: white;
}

.timeline-event-default .timeline-icon {
    background: var(--muted);
    color: white;
}

/* Compact Timeline View - Smaller cards on horizontal */
.timeline-compact .timeline-event {
    min-width: 160px;
    max-width: 200px;
}

.timeline-compact .timeline-icon {
    width: 32px;
    height: 32px;
}

.timeline-compact .timeline-icon svg {
    width: 14px;
    height: 14px;
}

.timeline-compact .timeline-title {
    font-size: var(--font-size-sm);
}

.timeline-compact .timeline-description {
    font-size: var(--font-size-xs);
    margin-bottom: var(--spacing-sm);
    -webkit-line-clamp: 1;
}

.timeline-compact .timeline-content {
    padding: var(--spacing-md);
}

.timeline-compact .timeline::before {
    top: 44px; /* Adjust for smaller icons */
}

/* Timeline Loading and Error States */
.timeline-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
    color: var(--muted-foreground);
}

.timeline-loading .loading-spinner {
    width: 32px;
    height: 32px;
    margin-bottom: var(--spacing-lg);
}

.timeline-empty {
    text-align: center;
    padding: var(--spacing-3xl);
    color: var(--muted-foreground);
    font-style: italic;
}


/* Status and Priority Badges in Timeline */
.timeline .status-badge,
.timeline .priority-high,
.timeline .priority-medium,
.timeline .priority-low {
    font-size: var(--font-size-xs);
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.timeline .priority-high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.timeline .priority-medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.timeline .priority-low {
    background: rgba(107, 114, 128, 0.1);
    color: var(--muted-foreground);
}


/* Mobile Timeline - Switch to Vertical Layout */
@media (max-width: 768px) {
    .timeline-container {
        padding: var(--spacing-lg);
        overflow-x: visible;
    }
    
    /* Switch to vertical layout on mobile */
    .timeline {
        display: block;
        padding: 0;
        padding-left: var(--spacing-lg);
    }
    
    .timeline::before {
        display: none;
    }
    
    .timeline-event {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: var(--spacing-lg);
        margin-bottom: var(--spacing-2xl);
        min-width: auto;
        max-width: none;
    }
    
    .timeline-event:last-child {
        margin-bottom: 0;
    }
    
    .timeline-marker {
        flex-shrink: 0;
    }
    
    .timeline-icon {
        width: 36px;
        height: 36px;
    }
    
    .timeline-icon svg {
        width: 16px;
        height: 16px;
    }
    
    /* Restore timeline line for mobile vertical layout */
    .timeline-line {
        display: block;
        width: 2px;
        flex: 1;
        min-height: 50px;
        margin-top: var(--spacing-xs);
        position: relative;
    }
    
    .timeline-line:not(.timeline-line-last)::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 2px;
        height: 100%;
        background: var(--border);
    }
    
    .timeline-content {
        flex: 1;
        text-align: left;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: var(--spacing-lg);
        box-shadow: var(--shadow-sm);
        transform: none;
    }
    
    .timeline-content:hover {
        transform: none;
    }
    
    .timeline-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: var(--spacing-lg);
        margin-bottom: var(--spacing-sm);
    }
    
    .timeline-title {
        font-size: var(--font-size-lg);
    }
    
    .timeline-date {
        align-items: flex-end;
        text-align: right;
    }
    
    .timeline-description {
        font-size: var(--font-size-base);
        display: block;
        -webkit-line-clamp: none;
        overflow: visible;
    }
    
    .timeline-action {
        width: auto;
        margin-top: var(--spacing-md);
        align-self: flex-start;
        font-size: var(--font-size-sm);
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    /* Compact mode adjustments for mobile */
    .timeline-compact .timeline-event {
        margin-bottom: var(--spacing-xl);
    }
    
    .timeline-compact .timeline-icon {
        width: 28px;
        height: 28px;
    }
    
    .timeline-compact .timeline-icon svg {
        width: 12px;
        height: 12px;
    }
    
    .timeline-compact .timeline-title {
        font-size: var(--font-size-base);
    }
    
    .timeline-compact .timeline-description {
        font-size: var(--font-size-sm);
        -webkit-line-clamp: none;
    }
    
    .timeline-compact .timeline-content {
        padding: var(--spacing-md);
    }
    
    .timeline-compact .timeline-line {
        min-height: 30px;
    }
    
    .timeline-controls {
        justify-content: center;
    }
    
    .timeline-toggle {
        font-size: var(--font-size-xs);
        padding: var(--spacing-xs);
    }
}

/* ========================================
   Skeleton Loading Styles
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading var(--skeleton-animation-duration) ease-in-out infinite;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-block {
    height: 2rem;
    margin-bottom: 1rem;
}

.skeleton-card {
    height: 10rem;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.skeleton-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.skeleton-field .field-label {
    margin-bottom: 0.25rem;
}

.skeleton-field .field-value {
    margin-bottom: 0;
}

.skeleton-row {
    opacity: 0.7;
}

.skeleton-row td {
    padding: 0.75rem;
}

.skeleton-loading {
    pointer-events: none;
}

/* Skeleton variations */
.skeleton-pulse {
    animation: skeleton-pulse 2s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.skeleton-wave {
    position: relative;
    overflow: hidden;
}

.skeleton-wave::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skeleton-wave 1.5s ease-in-out infinite;
}

@keyframes skeleton-wave {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Error state for async sections */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    min-height: 200px;
}

.error-state .error-icon {
    width: 48px;
    height: 48px;
    color: var(--error);
    margin-bottom: 1rem;
}

.error-state .error-icon svg {
    width: 100%;
    height: 100%;
}

.error-state p {
    margin-bottom: 1rem;
    font-size: var(--font-size-sm);
}

.error-state .retry-btn {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: background-color 0.15s ease;
}

.error-state .retry-btn:hover {
    background: var(--accent-hover);
}

/* Instant loading states */
.instant-loading {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.instant-loaded {
    opacity: 1;
}

/* Enhanced table rows for instant loading */
.table-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.table-row:hover {
    background-color: var(--overlay);
}

.table-row:active {
    background-color: var(--border-light);
}

/* Loading indicators */
.loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--muted);
}

.loading-indicator::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive skeleton loading */
@media (max-width: 768px) {
    .skeleton-card {
        height: 8rem;
    }
    
    .skeleton-field {
        margin-bottom: 0.75rem;
    }
    
    .error-state {
        padding: 1.5rem;
        min-height: 150px;
    }
    
    .error-state .error-icon {
        width: 36px;
        height: 36px;
    }
}

/* Enhanced Cards */
.resident-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.clickable-card {
    cursor: pointer;
}

.clickable-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--accent);
}

.clickable-card:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

/* Card Header Layout */
.card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: var(--radius-md);
    color: white;
}

.card-icon svg {
    width: 18px;
    height: 18px;
}

.card-title-section {
    flex: 1;
    min-width: 0;
}

.card-title {
    margin: 0 0 0.25rem 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary);
    line-height: var(--leading-tight);
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    font-weight: 500;
}

/* Badge Styling */
.card-badges {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
}

/* Enhanced Card Details Layout */
.card-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: var(--font-size-xs);
    color: var(--muted-foreground);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.detail-value {
    font-size: var(--font-size-sm);
    color: var(--primary);
    font-weight: 600;
}

.detail-value.rent-amount {
    color: var(--accent);
    font-weight: 700;
    font-size: var(--font-size-base);
}

/* Ensure consistent card height */
.resident-card {
    min-height: 140px;
    display: flex;
    flex-direction: column;
}


.status-badge, .priority-badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Status Badges */
.status-active, .status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-inactive, .status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-open, .status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-closed {
    background: #e5e7eb;
    color: #374151;
}

.status-progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-neutral {
    background: var(--secondary-dark);
    color: var(--muted-foreground);
}

/* Priority Badges */
.priority-high {
    background: #fee2e2;
    color: #991b1b;
}

.priority-medium {
    background: #fef3c7;
    color: #92400e;
}

.priority-low {
    background: #dcfce7;
    color: #166534;
}

.priority-neutral {
    background: var(--secondary-dark);
    color: var(--muted-foreground);
}

/* Card Details */
.card-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item {
    display: flex;
    align-items: center;
    font-size: var(--font-size-sm);
}

.detail-label {
    font-weight: 500;
    color: var(--muted-foreground);
    margin-right: 0.5rem;
    min-width: 0;
}

.detail-item:not(.detail-label) {
    color: var(--primary);
}

/* No Data State */
.no-data {
    text-align: center;
    color: var(--muted-foreground);
    font-style: italic;
    padding: 2rem;
}

/* Location section styling */
.location-info-grid {
    margin-bottom: 1rem;
}

.location-address-title {
    margin: 0 0 0.5rem 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.location-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.location-detail {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Base Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s ease-out;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    background: var(--background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.3s ease-out;
    z-index: 10000;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--background);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: var(--secondary-dark);
    color: var(--primary);
}

.modal-close svg {
    width: 1.25rem;
    height: 1.25rem;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Move-In Workflow Modal Styles */
.move-in-modal {
    max-width: 700px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.move-in-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    position: relative;
    z-index: 1;
}

.move-in-modal .modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--background);
    flex-shrink: 0;
}

.footer-spacer {
    flex: 1;
}

/* Progress Indicator */
.progress-indicator {
    margin-bottom: 2rem;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    position: relative;
}

.step-circle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--secondary-dark);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
    border: 2px solid var(--border);
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.step-label {
    font-size: var(--font-size-xs);
    color: var(--muted);
    font-weight: 500;
    transition: color 0.2s ease;
}

.progress-step.active .step-circle {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.progress-step.active .step-label {
    color: var(--accent);
    font-weight: 600;
}

.progress-step.completed .step-circle {
    background: var(--success);
    color: white;
    border-color: var(--success);
}


.progress-step.completed .step-label {
    color: var(--success);
}

.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
    border-radius: 2px;
}


/* File Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background);
    position: relative;
}

.upload-area:hover {
    border-color: var(--accent-light);
    background: rgba(0, 164, 153, 0.02);
}

.upload-area.dragover {
    border-color: var(--accent);
    background: rgba(0, 164, 153, 0.05);
    transform: scale(1.01);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.upload-content h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

.upload-content p {
    color: var(--muted);
    margin: 0;
    font-size: var(--font-size-sm);
}

.upload-note {
    font-size: var(--font-size-xs) !important;
    color: var(--muted-foreground) !important;
    margin-top: 0.5rem !important;
}

.upload-status {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.status-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-icon.processing {
    background: rgba(0, 164, 153, 0.1);
    color: var(--accent);
}

.status-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.status-text h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--primary);
}

.status-text p {
    font-size: var(--font-size-sm);
    color: var(--muted);
    margin: 0;
}

.extraction-results {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.extraction-results h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
}

.extracted-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.extracted-field {
    padding: 0.75rem;
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.extracted-field-label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.extracted-field-value {
    font-size: var(--font-size-sm);
    color: var(--primary);
    font-weight: 500;
}

.extraction-note {
    font-size: var(--font-size-xs);
    color: var(--muted-foreground);
    margin: 0;
    font-style: italic;
}

/* Upload States */
.upload-area.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.upload-area.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.02);
}

.upload-area.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.02);
}

/* Mobile responsiveness for upload section */
@media (max-width: 768px) {
    .upload-area {
        padding: 1.5rem;
    }
    
    .upload-icon {
        width: 40px;
        height: 40px;
    }
    
    .upload-content h4 {
        font-size: var(--font-size-base);
    }
    
    .extracted-fields {
        grid-template-columns: 1fr;
    }
    
    .status-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .status-icon {
        width: 48px;
        height: 48px;
    }
}

/* Ticket Workflow styles moved to ticket-workflow.css */

.modal-footer-left,
.modal-footer-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.optional-label {
    font-weight: 400;
    color: var(--muted);
    font-size: var(--font-size-sm);
}

/* Search containers for resident/property selection */
.search-container {
    position: relative;
}

.search-container .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted);
    z-index: 1;
}

.resident-search,
.property-search {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.resident-search:focus,
.property-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

.resident-list,
.property-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    font-style: italic;
}

.error-state {
    padding: 2rem;
    text-align: center;
    color: var(--error);
    font-style: italic;
}

/* Property Actions */


/* Resident and Property Items */
.resident-item,
.property-item {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--background);
}

.resident-item:hover,
.property-item:hover {
    border-color: var(--accent-light);
    background: rgba(0, 164, 153, 0.02);
}

.resident-item:last-child,
.property-item:last-child {
    margin-bottom: 0;
}

.resident-info,
.property-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.resident-name,
.property-name {
    font-weight: 600;
    color: var(--primary);
    font-size: var(--font-size-base);
}

.resident-details,
.property-details {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
}

/* Selected Resident Display */
.selected-resident {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(0, 164, 153, 0.1);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.clear-selection {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.clear-selection:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Property Residents Header */
.property-residents-header {
    padding: 0.75rem;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.select-all-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
}

.select-all-checkbox input[type="checkbox"] {
    margin: 0;
}

/* Resident Checkbox Styling */
.resident-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    width: 100%;
}

.resident-checkbox input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

/* Loading States */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
}

.loading-text {
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
}


/* Review Summary */
.review-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-section {
    background: var(--secondary);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.review-section h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* Error Display */
.error-container {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.error-icon {
    font-size: var(--font-size-lg);
    color: var(--error);
}

.error-content h4 {
    color: var(--error);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.error-content ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--error);
    font-size: var(--font-size-sm);
}

/* Multi-Resident Batch Processing UI moved to ticket-workflow.css */

/* All ticket workflow styles moved to ticket-workflow.css */

.hint-existing-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success);
    font-weight: 500;
}

.hint-existing-contact svg {
    width: 16px;
    height: 16px;
}

.hint-new-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-weight: 500;
}

.hint-new-contact svg {
    width: 16px;
    height: 16px;
}

/* Review Section */
.review-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-section {
    background: var(--secondary);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.review-section h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.review-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.review-item label {
    font-weight: 500;
    color: var(--muted);
    font-size: var(--font-size-sm);
}

.review-item span {
    font-weight: 500;
    color: var(--primary);
    text-align: right;
}

.contact-status {
    margin-top: 1.5rem;
    background: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-status .status-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-status .status-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

.contact-status .status-text {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--primary);
}

/* Error Display */
.error-display {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.error-display .error-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background: var(--error);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-display .error-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

.error-display .error-content {
    flex: 1;
}

.error-display .error-content strong {
    color: var(--error);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.error-display ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}

.error-display li {
    color: var(--error);
    font-size: var(--font-size-sm);
    margin-bottom: 0.25rem;
}


.loading-spinner {
    width: 1rem;
    height: 1rem;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
    vertical-align: middle;
    margin: 0;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Success Modal */
.success-modal {
    max-width: 500px;
    text-align: center;
}

.success-content {
    padding: 2rem;
}

.success-icon {
    width: 4rem;
    height: 4rem;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.success-icon svg {
    width: 2rem;
    height: 2rem;
    color: white;
}

.success-content h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
}

.success-content p {
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: var(--leading-relaxed);
}

.success-details {
    background: var(--secondary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-item .label {
    font-weight: 500;
    color: var(--muted);
}

.detail-item .value {
    font-weight: 600;
    color: var(--primary);
}

/* Base Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
    white-space: nowrap;
    user-select: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn svg {
    width: 1rem;
    height: 1rem;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Secondary Button */
.btn-secondary {
    background: var(--background);
    color: var(--primary);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary);
    border-color: var(--muted);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Danger Button */
.btn-danger {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Move-In Launch Buttons */
.move-in-launch-btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.move-in-launch-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.move-in-launch-btn svg {
    width: 1rem;
    height: 1rem;
}

button.skip-btn {
    border: none;
    background: none;
    color: #00a499;
    font-weight: 600;
    padding: 1rem;
    font-size: 1rem;
    cursor: pointer;
}

button.skip-btn:hover {
    color: #00746c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .move-in-modal {
        width: 95vw;
        max-height: 95vh;
    }
    
    .move-in-modal .modal-body {
        padding: 1rem;
    }
    
    .move-in-modal .modal-footer {
        padding: 1rem;
    }
    
    
    .review-grid {
        grid-template-columns: 1fr;
    }
    
    .progress-steps {
        gap: 0.5rem;
    }
    
    .step-circle {
        width: 2rem;
        height: 2rem;
        font-size: var(--font-size-xs);
    }
    
    .step-label {
        font-size: 10px;
    }
}

/* ==========================================================================
   Dropdown Menu Component - shadcn style
   ========================================================================== */

.actions-column {
    width: 80px;
    text-align: center;
}

.dropdown-container {
    position: relative;
    display: inline-block;
}

.more-actions-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.15s ease;
}

.more-actions-btn:hover {
    background: var(--secondary-dark);
    color: var(--primary);
    border-color: var(--border);
}

.more-actions-btn:focus {
    outline: none;
    ring: 2px;
    ring-color: var(--accent);
    ring-opacity: 0.2;
}

.action-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1001;
    min-width: 200px;
    margin-top: 4px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
    animation: dropdown-enter 0.15s ease-out;
}

@keyframes dropdown-enter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dropdown-content {
    padding: 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: var(--font-size-sm);
    font-weight: 400;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: var(--secondary-dark);
    color: var(--primary);
}

.dropdown-item:focus {
    outline: none;
    background: var(--secondary-dark);
}

.dropdown-item svg {
    flex-shrink: 0;
    color: var(--muted-foreground);
}

/* ==========================================================================
   Modal Component - shadcn style
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: modal-overlay-enter 0.2s ease-out;
}

@keyframes modal-overlay-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}

.move-out-modal {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    animation: modal-content-enter 0.2s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modal-content-enter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: var(--secondary-dark);
    color: var(--primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0; /* Enables flexbox shrinking */
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 24px 24px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

/* Enhanced modal form styling */
.resident-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--secondary) 0%, rgba(248, 250, 252, 0.8) 100%);
    border: 2px solid var(--border-light);
    border-radius: 16px;
    margin-bottom: 32px;
    position: relative;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04);
}

.resident-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 2px 0 0 2px;
}

.info-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--muted-foreground);
    min-width: 90px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.01em;
}




/* ==========================================================================
   Standardized Record Card Component System
   ========================================================================== */

/* Base record card - used across all workflows and components */
.record-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Record card states */
.record-card.selectable {
    cursor: pointer;
}

.record-card.selectable:hover {
    background: rgba(0, 164, 153, 0.05);
    border-color: rgba(0, 164, 153, 0.2);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.record-card.selected {
    background: rgba(0, 164, 153, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 164, 153, 0.15);
}

.record-card.current {
    background: rgba(0, 164, 153, 0.15);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 164, 153, 0.2);
    transform: scale(1.02);
    animation: pulse-current 2s infinite;
}

/* Record card icon */
.record-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.record-card-icon.resident {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.record-card-icon.property {
    background: rgba(0, 164, 153, 0.1);
    color: var(--accent);
}

.record-card-icon svg {
    width: 24px;
    height: 24px;
}

/* Record card content */
.record-card-content {
    flex: 1;
    min-width: 0; /* Prevents flex overflow */
}

.record-card-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 0.25rem 0;
    line-height: var(--leading-tight);
}

.record-card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    margin: 0 0 0.25rem 0;
    line-height: var(--leading-normal);
}

.record-card-details {
    font-size: var(--font-size-xs);
    color: var(--muted);
    margin: 0;
    line-height: var(--leading-normal);
}

/* Record card actions */
.record-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.record-card-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    opacity: 0.7;
}

.record-card-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    opacity: 1;
    transform: scale(1.1);
}

.record-card-remove svg {
    width: 16px;
    height: 16px;
}

/* Status badges for record cards */
.record-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    margin-left: 0.5rem;
}

.record-card-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.record-card-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.record-card-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Compact version for smaller spaces */
.record-card.compact {
    padding: 0.75rem;
}

.record-card.compact .record-card-icon {
    width: 32px;
    height: 32px;
}

.record-card.compact .record-card-icon svg {
    width: 16px;
    height: 16px;
}

.record-card.compact .record-card-title {
    font-size: var(--font-size-sm);
}

.record-card.compact .record-card-subtitle {
    font-size: var(--font-size-xs);
}

/* List layout for record cards */
.record-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.record-card-list .record-card {
    border-radius: var(--radius-md);
}

.record-card-list .record-card:first-child {
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.record-card-list .record-card:last-child {
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Selected record display pattern */
.selected-record-display {
    background: rgba(0, 164, 153, 0.08);
    border: 1px solid rgba(0, 164, 153, 0.2);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 1rem 0;
    position: relative;
}

.selected-record-display::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
    border-radius: 2px 0 0 2px;
}

.selected-record-display .record-card {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.selected-record-display .record-card:hover {
    background: transparent;
    transform: none;
}

/* Progress indicator for record cards */
.record-card-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(0, 164, 153, 0.2);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}

.record-card-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
    animation: progress-indeterminate 1.5s infinite linear;
}

/* Animation for current state */
@keyframes pulse-current {
    0%, 100% { 
        box-shadow: 0 0 0 2px rgba(0, 164, 153, 0.2); 
    }
    50% { 
        box-shadow: 0 0 0 2px rgba(0, 164, 153, 0.4); 
    }
}

@keyframes progress-indeterminate {
    0% { 
        transform: translateX(-100%); 
        width: 100%; 
    }
    50% { 
        width: 100%; 
    }
    100% { 
        transform: translateX(100%); 
        width: 100%; 
    }
}

/* ==========================================================================
   Clean Tickets Datatable - shadcn/Notion Inspired
   ========================================================================== */

/* Property cell styling */
.property-cell {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    font-weight: 400;
}

.property-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    flex-shrink: 0;
}

/* Category cell styling */
.category-cell {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
}

/* Hierarchy indicators styling consolidated below */

/* Ticket Hierarchy Context Dialog - Thread-Style Design */
.hierarchy-context-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    min-width: 500px;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    animation: dialogSlideIn 0.2s ease-out;
}

.hierarchy-context-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.hierarchy-dialog-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--secondary);
}

.hierarchy-dialog-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.hierarchy-dialog-title svg {
    color: var(--muted-foreground);
}

.hierarchy-dialog-close {
    background: none;
    border: none;
    padding: var(--spacing-sm);
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--muted-foreground);
    transition: all 0.2s ease;
}

.hierarchy-dialog-close:hover {
    background: var(--background);
    color: var(--primary);
}

.hierarchy-dialog-body {
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Status badges - shadcn inspired */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 6px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.status-new {
    background: rgba(0, 164, 153, 0.1);
    color: var(--accent);
}

.status-badge.status-in-progress {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-badge.status-waiting {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.status-badge.status-closed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* Property status badges */
.status-badge.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
    transition: all 0.15s ease;
    cursor: help;
}

.status-badge.status-inactive {
    background: rgba(107, 114, 128, 0.1);
    color: var(--muted-foreground);
    border: 1px solid rgba(107, 114, 128, 0.2);
    transition: all 0.15s ease;
    cursor: help;
}

.status-badge.status-active:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.status-badge.status-inactive:hover {
    background: rgba(107, 114, 128, 0.15);
    border-color: rgba(107, 114, 128, 0.3);
    transform: translateY(-1px);
}

/* Unit listing status badges */
.status-badge.status-available {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-weight: 500;
}

.status-badge.status-past {
    background: rgba(107, 114, 128, 0.1);
    color: var(--muted-foreground);
    border: 1px solid rgba(107, 114, 128, 0.2);
    font-weight: 500;
}

/* Listing type badge for managed listings */
.listing-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 6px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-transform: capitalize;
    background: rgba(0, 164, 153, 0.1);
    color: var(--accent);
    border: 1px solid rgba(0, 164, 153, 0.2);
}

/* Priority indicators */
.priority-indicator {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-high .priority-dot {
    background: var(--error);
}

.priority-medium .priority-dot {
    background: var(--warning);
}

.priority-low .priority-dot {
    background: var(--muted);
}

.priority-high {
    color: var(--error);
}

.priority-medium {
    color: var(--warning);
}

.priority-low {
    color: var(--muted);
}

/* Priority chips - rounded design */
.priority-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: 50px;
    text-transform: capitalize;
    letter-spacing: 0.025em;
}

.priority-chip.priority-high {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.priority-chip.priority-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.priority-chip.priority-low {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Status chips - unified with priority chip design */
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: 50px;
    text-transform: capitalize;
    letter-spacing: 0.025em;
}

.status-chip.status-new {
    background: rgba(0, 164, 153, 0.1);
    color: var(--accent);
    border: 1px solid rgba(0, 164, 153, 0.2);
}

.status-chip.status-in-progress {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-chip.status-waiting {
    background: rgba(168, 85, 247, 0.1);
    color: #7c3aed;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.status-chip.status-waiting-for-response {
    background: rgba(168, 85, 247, 0.1);
    color: #7c3aed;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.status-chip.status-closed {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Age cell styling */
.age-cell {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* Date formatting */
.date-cell {
    font-size: var(--font-size-sm);
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}

/* Hierarchy indicator (enhanced visibility) */
.hierarchy-indicator {
    width: 16px;
    height: 16px;
    opacity: 0.8;
    margin-right: 0.5rem;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hierarchy-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

.hierarchy-indicator.parent {
    color: var(--accent);
}

.hierarchy-indicator.child {
    color: var(--warning);
}

/* Empty state */
.table-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted-foreground);
}

.table-empty svg {
    width: 48px;
    height: 48px;
    color: var(--muted);
    margin-bottom: 1rem;
}

.table-empty h3 {
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 500;
}

/* =================================================================== */
/* Mobile Card Layout Transformations                                  */
/* =================================================================== */

/* Mobile Card Layout - Transform tables to cards on mobile */
@media (max-width: 767px) {
    /* Hide table headers on mobile */
    .data-table thead {
        display: none;
    }
    
    /* Transform table structure */
    .data-table,
    .data-table tbody {
        display: block;
        width: 100%;
        padding-top: 0.5rem;
    }
    
    /* Transform rows into cards */
    .data-table tr {
        display: block;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        margin-bottom: 16px;
        padding: 20px;
        box-shadow: var(--shadow-sm);
        transition: all 0.2s ease;
        position: relative;
        cursor: pointer;
    }
    
    /* Mobile card-level clicking */
    .data-table tr {
        position: relative;
        cursor: pointer;
    }
    
    /* Make card content areas clickable, but allow actions to override */
    .data-table tr td:not(.actions-column) {
        pointer-events: auto;
    }
    
    /* Ensure action buttons remain functional */
    .data-table tr td.actions-column,
    .data-table tr td.actions-column * {
        pointer-events: auto;
    }
    
    .data-table tr:hover {
        box-shadow: var(--shadow-md);
        border-color: var(--border-light);
        transform: translateY(-1px);
    }
    
    /* Transform cells into block elements */
    .data-table td {
        display: block;
        width: 100%;
        text-align: left;
        border: none;
        padding: 0;
        margin-bottom: 12px;
        position: relative;
    }
    
    .data-table td:last-child {
        margin-bottom: 0;
    }
    
    /* Base card header and content styling */
    .data-table td:before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        font-size: var(--font-size-xs);
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.025em;
        margin-bottom: 4px;
    }
    
    .data-table td[data-label=""] {
        display: none;
    }

    /* Mobile-specific loading states */
    .table-loading {
        padding: 60px 20px;
        font-size: var(--font-size-base);
    }

    /* Better mobile empty states */
    .table-empty {
        padding: 60px 20px;
    }

    .table-empty svg {
        width: 64px;
        height: 64px;
        margin-bottom: 20px;
    }

    /* Enhanced accessibility for mobile */
    .data-table tr:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

    /* Better mobile dropdown menus */
    .action-dropdown {
        min-width: 200px;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-xl);
    }

    .dropdown-item {
        min-height: 44px;
        padding: 12px 16px;
        font-size: var(--font-size-sm);
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .dropdown-item:active {
        background: var(--accent);
        color: white;
        transform: scale(0.98);
    }
}

/* ==========================================================================
   Enhanced Move-Out Modal Components - Modern UI/UX Design
   ========================================================================== */

.section-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}


/* Case Summary with Tooltip */
.detail-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.info-icon {
    font-size: 16px;
    color: var(--muted-foreground);
    cursor: help;
    transition: color 0.2s ease;
}

.info-icon:hover {
    color: var(--accent);
}

.tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--primary);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 12px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--primary);
}

.tooltip-container:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.case-summary-content p {
    margin: 0 0 var(--spacing-md) 0;
    line-height: var(--leading-relaxed);
    color: var(--primary);
}

/* Detail page clickable links */
.detail-link {
    color: var(--accent) !important;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.detail-link:hover {
    color: var(--accent-hover) !important;
    text-decoration: underline;
}

.case-summary-content p:last-child {
    margin-bottom: 0;
}

/* Description Truncation */
.show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-more-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.show-more-btn:active {
    transform: translateY(0);
}

.description-text {
    line-height: var(--leading-relaxed);
    color: var(--primary);
}

/* Financial Information Components */
.service-outcome-card {
    /* Uses existing card styling from .resident-card, .payment-card */
}

/* Financial-specific styling for amount values */
.amount-requested {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-weight: 600;
    color: var(--warning);
}

.amount-approved {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-weight: 600;
    color: var(--success);
}

/* Status badge for financial states */
.status-paid {
    background: var(--success);
    color: white;
}

.status-pending {
    background: var(--warning);
    color: white;
}

.financial-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
    text-align: center;
    color: var(--error);
}

.financial-error svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.6;
}

.financial-error p {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: 500;
}

.financial-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
    text-align: center;
    color: var(--muted-foreground);
}

.financial-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.4;
}

.financial-empty p {
    margin: 0;
    font-size: var(--font-size-base);
    font-style: italic;
}