/* LandlordPro - Core Styles */
/* Professional, clean, uncluttered design with mobile-first approach */

/* Google Fonts - Poppins for everything */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Brand Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --neutral: #6b7280;
    
    /* Grayscale */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Typography */
    --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-main);
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.125rem; font-weight: 600; }

p { margin-bottom: 1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover { color: var(--primary-dark); }

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--gray-50);
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
}

.logo {
    padding: var(--space-3) var(--space-4);
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-menu {
    flex: 1;
    padding: var(--space-4);
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-1) var(--space-3);
    margin-bottom: var(--space-1);
    border-radius: var(--border-radius-sm);
    color: var(--gray-700);
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.nav-item .icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: var(--space-4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-900);
}

.user-plan {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.top-bar {
    height: var(--topbar-height);
    background: white;
    padding: 0 var(--space-8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.breadcrumb {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.credit-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--gray-100);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Content Area */
.dashboard-content {
    padding: var(--space-8);
    max-width: 1400px;
    width: 100%;
}

/* Buttons */
.btn, .btn-primary, .btn-secondary, .btn-success, .btn-warning, .btn-error {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-main);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-error { background: var(--error); color: white; }

.btn-small {
    padding: var(--space-1) var(--space-3);
    font-size: 0.75rem;
}

.btn-sell {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-sell:hover {
    background: #fee2e2;
    border-color: #f87171;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.15);
}

.btn-logout {
    width: 100%;
    padding: var(--space-3);
    background: var(--gray-100);
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--gray-700);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--gray-200);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-10);
}

.summary-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow);
    display: flex;
    gap: var(--space-4);
    transition: all 0.2s;
}

.summary-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.summary-card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.summary-card.highlight .card-label,
.summary-card.highlight .card-value {
    color: white;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
}

.card-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: var(--space-1);
}

.card-value {
    font-size: clamp(1.1rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.section-header h2 {
    margin: 0;
}

.link-text {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
}

.empty-state h3 {
    margin-bottom: var(--space-2);
    color: var(--gray-700);
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: var(--space-6);
}

/* Properties Grid */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-10);
    row-gap: 4rem;
    margin-bottom: var(--space-10);
}

.property-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    cursor: pointer;
}

.property-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

/* Monopoly-style Property Card - Flip Card Container */
.property-card-container {
    perspective: 1000px;
    width: 100%;
    max-width: 380px;
}

.property-card-flipper {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 7;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
    will-change: transform;
}

/* Only flip when .flipped class is added via click */
.property-card-container.flipped .property-card-flipper {
    transform: rotateY(180deg);
}

.property-card-front,
.property-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
}

.property-card-back {
    transform: rotateY(180deg) translateZ(1px);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Flip icon */
.flip-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.9);
    border: 2px solid #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.flip-icon:hover {
    background: #fff;
    transform: scale(1.1);
}

/* Property photo button - separate from flip icon */
.property-photo-btn {
    position: absolute;
    top: 44px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.9);
    border: 2px solid #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.property-photo-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

/* Monopoly-style Property Card */
.property-card.monopoly-style {
    background: #f5f0e6;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 3px solid #1a1a1a;
    overflow: hidden;
    width: 100%;
    height: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
}

.property-card.monopoly-style:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* Back of card - Units browser */
.property-card-back .card-back-content {
    background: #f5f0e6;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 3px solid #1a1a1a;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Note: ignored in preserve-3d context; border-radius on back-header handles corners */
    transform-style: flat;
}

.property-card-back .back-header {
    padding: 17px 16px;
    text-align: center;
    /* margin creates the same 6px beige frame as the front's inner-frame, without relying on
       overflow:hidden (which preserve-3d ancestors break). border-radius clips the top corners
       to match the card's inner corner curve (8px outer - 3px border = 5px ≈ 4px). */
    margin: 6px 6px 8px 6px;
    border-radius: 4px;
}

.property-card-back .back-header .back-title {
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.property-card-back .back-header .property-name {
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Unit Browser */
.property-card-back .unit-browser {
    flex: 1;
    display: flex;
    align-items: stretch;
    background: #f5f0e6;
    border: 2px solid #1a1a1a;
    border-radius: 4px;
    margin: 0 8px 8px 8px;
    overflow: visible;
}

.property-card-back .unit-nav-arrow {
    width: 36px;
    background: rgba(0,0,0,0.05);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #1a1a1a;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-card-back .unit-nav-arrow:hover {
    background: rgba(0,0,0,0.1);
}

.property-card-back .unit-nav-arrow:active {
    background: rgba(0,0,0,0.15);
}

.property-card-back .unit-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: visible;
    min-height: 0;
}

.property-card-back .unit-loading,
.property-card-back .unit-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    text-align: center;
    padding: 20px;
}

/* Unit Info Section (top half) */
.property-card-back .unit-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-bottom: 2px solid #1a1a1a;
    background: white;
}

.property-card-back .unit-number-large {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.property-card-back .unit-details {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.property-card-back .unit-status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.property-card-back .unit-status-badge.occupied {
    background: #d1fae5;
    color: #059669;
}

.property-card-back .unit-status-badge.vacant {
    background: #fff3e0;
    color: #e65100;
}

.property-card-back .unit-edit-btn {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 0.7rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.property-card-back .unit-edit-btn:hover {
    background: #e5e7eb;
}

/* Tenant Section (bottom half) */
.property-card-back .tenant-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 12px;
    background: #fafafa;
    overflow: visible;
    min-height: 0;
}

.property-card-back .tenant-section.vacant {
    background: #fffbf5;
}

.property-card-back .tenant-empty {
    text-align: center;
}

.property-card-back .add-tenant-btn {
    margin-top: 10px;
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.property-card-back .add-tenant-btn:hover {
    background: #059669;
}

.property-card-back .tenant-label {
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 2px;
}

.property-card-back .tenant-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.property-card-back .tenant-lease-dates {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 4px;
}

.property-card-back .tenant-contact {
    font-size: 0.7rem;
    margin-bottom: 2px;
}

.property-card-back .tenant-contact a {
    color: #3b82f6;
    text-decoration: none;
}

.property-card-back .tenant-contact a:hover {
    text-decoration: underline;
}

.property-card-back .tenant-edit-btn {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 0.7rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.property-card-back .tenant-edit-btn:hover {
    background: #e5e7eb;
}

/* Rent Status Badge with Tooltip */
.rent-status-container {
    position: relative;
    display: inline-block;
}

.rent-status-container .rent-stats-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.rent-status-container .rent-stats-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.rent-status-container:hover .rent-stats-tooltip {
    display: block;
}

.rent-stats-tooltip .rent-stats-header {
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #374151;
}

.rent-stats-tooltip .rent-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 0;
}

.rent-stats-tooltip .rent-stats-row span:first-child {
    color: #9ca3af;
}

.rent-stats-tooltip .rent-stats-row span:last-child {
    font-weight: 600;
}

.rent-stats-tooltip .rent-stats-divider {
    height: 1px;
    background: #374151;
    margin: 6px 0;
}

/* Unit Dots */
.property-card-back .unit-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    background: #f5f0e6;
}

.property-card-back .unit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}

.property-card-back .unit-dot.active {
    background: #1a1a1a;
    transform: scale(1.2);
}

.property-card-back .unit-dot:hover {
    background: #888;
}

.property-card-back .back-footer {
    padding: 10px 12px;
    background: #f5f0e6;
    display: flex;
    gap: 8px;
}

.property-card-back .back-footer button {
    flex: 1;
}

.property-card.monopoly-style .inner-frame {
    border-radius: 4px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.property-card.monopoly-style .title-banner {
    color: white;
    padding: 24px 16px 20px 16px;
    text-align: center;
    border: 2px solid #1a1a1a;
    border-radius: 4px;
    margin: 0 0 8px 0;
    flex-shrink: 0; /* Prevent squishing when card is small */
}

.property-card.monopoly-style .title-banner .deed-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 6px;
}

.property-card.monopoly-style .title-banner .property-name {
    font-family: var(--font-main);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin: 0;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.property-card.monopoly-style .card-body {
    padding: 8px 16px 12px 16px;
    text-align: center;
}

.property-card.monopoly-style .property-address {
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-style: normal;
    color: #4a4a4a;
    text-align: center;
    margin-bottom: 8px;
}

.property-card.monopoly-style .rent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    font-size: 0.9rem;
    color: #1a1a1a;
}

.property-card.monopoly-style .rent-row.main-rent {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid #d4c9b5;
    margin-bottom: 6px;
    text-align: center;
    justify-content: center;
    gap: 12px;
}

.property-card.monopoly-style .rent-row .label {
    font-weight: 500;
}

.property-card.monopoly-style .rent-row .value {
    font-family: var(--font-main);
    font-weight: 600;
}

.property-card.monopoly-style .mortgage-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 2px solid #1a1a1a;
    text-align: center;
    font-size: 0.8rem;
    color: #1a1a1a;
}

.property-card.monopoly-style .mortgage-section .mortgage-value {
    font-weight: 700;
    color: #1a1a1a;
    display: block;
    font-size: 0.95rem;
    margin-top: 2px;
}

.property-card.monopoly-style .property-buttons-section {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 2px solid #1a1a1a;
}

.property-card.monopoly-style .property-buttons-section .property-sections {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Units Preview on Front of Card */
.property-card.monopoly-style .units-preview {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #1a1a1a;
}

.property-card.monopoly-style .units-preview-loading,
.property-card.monopoly-style .units-preview-empty {
    text-align: center;
    font-size: 0.75rem;
    color: #888;
    padding: 8px;
}

.property-card.monopoly-style .units-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.property-card.monopoly-style .unit-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.property-card.monopoly-style .unit-preview-item:hover {
    background: #f0f9ff;
    border-color: #3b82f6;
}

.property-card.monopoly-style .unit-preview-item.vacant {
    background: #fffbeb;
    border-color: #f59e0b;
}

.property-card.monopoly-style .unit-preview-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a1a1a;
}

.property-card.monopoly-style .unit-preview-rent {
    font-size: 0.7rem;
    font-weight: 600;
    color: #059669;
}

.property-card.monopoly-style .unit-preview-item.vacant .unit-preview-rent {
    color: #d97706;
}

.property-card.monopoly-style .units-preview-more {
    text-align: center;
    font-size: 0.7rem;
    color: #3b82f6;
    cursor: pointer;
    padding: 6px;
    margin-top: 4px;
}

.property-card.monopoly-style .units-preview-more:hover {
    text-decoration: underline;
}

.property-card.monopoly-style .summary-bar {
    margin-top: 12px;
    padding: 10px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    font-size: 0.7rem;
    color: #4a4a4a;
    text-align: center;
}

.property-card.monopoly-style .fine-print {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #d4c9b5;
    font-size: 0.7rem;
    font-style: italic;
    color: #666;
    text-align: center;
    line-height: 1.4;
}

.property-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--space-4);
}

.property-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.property-address {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.property-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--gray-200);
}

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

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: var(--space-1);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-value.positive { color: var(--success); }
.stat-value.negative { color: var(--error); }

/* Tables */
.activity-table {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

thead {
    background: var(--gray-50);
}

th {
    padding: var(--space-4);
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
}

td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.875rem;
}

tbody tr:hover {
    background: var(--gray-50);
}

.empty-row {
    text-align: center;
    color: var(--gray-500);
    padding: var(--space-10);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* Ensure select dropdowns in modals have readable text */
.modal select,
.modal-content select,
.modal-overlay select {
    font-size: 16px !important;
    min-height: 42px;
}

.modal-body {
    padding: var(--space-6);
}

.modal-description {
    color: var(--gray-600);
    margin-bottom: var(--space-6);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-2);
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3);
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* ==========================================================================
   UNIVERSAL FORM ELEMENT PROTECTION
   Prevents text shrinking, overflow, and iOS auto-zoom on ALL pages.
   This block is the SINGLE SOURCE OF TRUTH for form element sizing.
   ========================================================================== */

/* 1. Minimum 16px on ALL form inputs (prevents iOS zoom + tiny text).
      NOTE: buttons are NOT included — iOS auto-zoom only triggers on text inputs.
      Forcing 16px on buttons broke property card layouts (Monopoly cards). */
input, select, textarea,
input[type="text"], input[type="number"], input[type="email"],
input[type="tel"], input[type="date"], input[type="password"],
input[type="search"], input[type="url"] {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}

/* 2. Selects and options: enforce readable size everywhere */
select,
select option {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100% !important;
    line-height: 1.5;
}

select {
    font-family: var(--font-main);
    min-height: 42px;
}

/* 3. ALL form elements must stay within their container */
input, select, textarea, button,
img, video, canvas, svg, table {
    max-width: 100%;
}

/* 4. Prevent ANY horizontal overflow on containers */
.modal-content, .modal-body,
.wizard-content, .wizard-container,
.card, .form-group, .form-row,
[class*="wizard-form"] {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* 5. Force inline-width elements to respect container on small screens */
@media (max-width: 500px) {
    input[style*="width"],
    select[style*="width"] {
        max-width: 100% !important;
        min-width: 0 !important;
    }
}

/* 6. Property cards are protected — buttons were removed from rule #1 above
      so Monopoly card buttons use their class-defined font sizes (0.7rem etc.)
      instead of being forced to 16px and blowing out of their card borders. */

.form-error {
    color: var(--error);
    font-size: 0.75rem;
    margin-top: var(--space-1);
}

/* Alerts */
.alert {
    padding: var(--space-4);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--space-4);
    display: flex;
    gap: var(--space-3);
    font-size: 0.875rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Attention-grabbing animation for mark all past months as paid */
@keyframes attention-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
        transform: scale(1.01);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
        transform: scale(1);
    }
}

.mark-all-paid-attention {
    animation: attention-pulse 0.6s ease-out 3;
    border-width: 2px !important;
}

/* Pulsing animation for Add Lease button when unit has never had a tenant */
@keyframes add-tenant-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.add-lease-pulse {
    animation: add-tenant-pulse 1.5s ease-out infinite;
}

.add-tenant-hint {
    font-size: 0.7rem;
    color: #3b82f6;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .mobile-overlay.active {
        display: block;
        touch-action: none;        /* block all touch events on overlay */
        -webkit-overflow-scrolling: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-bar {
        padding: 0 var(--space-4);
    }
    
    .dashboard-content {
        padding: var(--space-4);
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
    }
    
    .top-bar-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: var(--space-2);
    }
    
    .credit-badge {
        font-size: 0.75rem;
        padding: var(--space-1) var(--space-2);
    }
    
    /* Hamburger menu */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: var(--space-2);
        color: var(--gray-700);
    }
    
    /* Modal/form overflow protection on mobile */
    .modal-content {
        max-width: calc(100vw - 32px);
    }
    .modal-body {
        padding: var(--space-4);
        overflow-x: hidden;
    }
    .modal-header {
        padding: var(--space-4);
    }
    .form-row, [class*="form-grid"] {
        flex-direction: column !important;
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
    
    .mobile-overlay {
        display: none !important;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.hidden { display: none; }

/* ========================================
   RENT REMINDERS TOGGLE PILL
   ======================================== */
.reminder-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    transition: background 0.2s;
}
.reminder-toggle-row:hover {
    background: #f1f5f9;
}

/* Reminder Link Row - links to Communications page */
.reminder-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
}
.reminder-link-row:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
}
.reminder-link-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
}
.reminder-link-label .icon {
    font-size: 1rem;
}
.reminder-status-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.reminder-status-badge.on {
    background: #d1fae5;
    color: #059669;
}
.reminder-status-badge.off {
    background: #f3f4f6;
    color: #9ca3af;
}
.reminder-link-arrow {
    color: #94a3b8;
    font-size: 1.1rem;
    transition: transform 0.2s;
}
.reminder-link-row:hover .reminder-link-arrow {
    transform: translateX(3px);
    color: #3b82f6;
}

.reminder-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
}
.reminder-toggle-label .icon {
    font-size: 1rem;
}

/* Tooltip for showing contact info */
.reminder-contact-tooltip {
    position: relative;
    cursor: help;
}
.reminder-contact-tooltip .tooltip-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 6px;
}
.reminder-contact-tooltip .tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
}
.reminder-contact-tooltip:hover .tooltip-content {
    display: block;
}

/* Tenant name tooltip */
.tenant-name-tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}
.tenant-name-tooltip .tenant-name {
    border-bottom: 1px dashed #94a3b8;
    transition: color 0.2s;
}
.tenant-name-tooltip:hover .tenant-name {
    color: #3b82f6;
}
.tenant-contact-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 9999;
    margin-bottom: 8px;
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: none;
}
.tenant-contact-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}
.tenant-name-tooltip:hover .tenant-contact-tooltip {
    display: block;
}

/* The pill toggle switch */
.toggle-pill {
    position: relative;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    padding: 0;
}
.toggle-pill.active {
    background: #3b82f6;
}
.toggle-pill::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s, left 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-pill.active::after {
    transform: translateX(20px);
}

/* ============================================
   PROPERTY COLORS - Monopoly-style by value
   Shared across all pages via PropertyColors.js
   ============================================ */

/* Base property header styling */
.property-color-header {
    color: white;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
}

/* Monopoly colors - lowest to highest property value */
.property-color-brown {
    background: linear-gradient(135deg, #955436 0%, #7a442c 100%);
    color: #ffffff;
}
.property-color-lightblue {
    background: linear-gradient(135deg, #aae0fa 0%, #89c4e8 100%);
    color: #1e3a5f;
}
.property-color-pink {
    background: linear-gradient(135deg, #d93a96 0%, #b8307d 100%);
    color: #ffffff;
}
.property-color-orange {
    background: linear-gradient(135deg, #f7941d 0%, #e07f0c 100%);
    color: #ffffff;
}
.property-color-red {
    background: linear-gradient(135deg, #ed1b24 0%, #c41018 100%);
    color: #ffffff;
}
.property-color-yellow {
    background: linear-gradient(135deg, #fef200 0%, #e6da00 100%);
    color: #78350f;
}
.property-color-green {
    background: linear-gradient(135deg, #1fb25a 0%, #178a46 100%);
    color: #ffffff;
}
.property-color-darkblue {
    background: linear-gradient(135deg, #0072bb 0%, #005a94 100%);
    color: #ffffff;
}
.property-color-gray {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GLOBAL COLLAPSIBLE SYSTEM — .lp-collapse
   Add class="lp-collapse" to any <details> element.
   Chevron size auto-scales by nesting depth:
     Level 1 (top)    → 0.75rem chevron, 0.85rem summary text
     Level 2 (nested) → 0.6rem  chevron, 0.8rem  summary text
     Level 3 (deep)   → 0.5rem  chevron, 0.75rem summary text
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base: hide native marker, flex layout */
.lp-collapse > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.lp-collapse > summary::-webkit-details-marker { display: none; }

/* Chevron via ::before */
.lp-collapse > summary::before {
    content: '▶';
    display: inline-block;
    transition: transform 0.15s ease;
    flex-shrink: 0;
    color: #9ca3af;
}
.lp-collapse[open] > summary::before {
    transform: rotate(90deg);
}

/* ── Level 1: Top-level ── */
.lp-collapse > summary::before {
    font-size: 0.85rem;
}
.lp-collapse > summary {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ── Level 2: Nested ── */
.lp-collapse .lp-collapse > summary::before {
    font-size: 0.7rem;
}
.lp-collapse .lp-collapse > summary {
    font-size: 0.8rem;
}

/* ── Level 3: Deep nested ── */
.lp-collapse .lp-collapse .lp-collapse > summary::before {
    font-size: 0.55rem;
}
.lp-collapse .lp-collapse .lp-collapse > summary {
    font-size: 0.75rem;
}

/* ── Syndication Live Dot ── */
.synd-live-dot { position: relative; display: inline-block; width: 6px; height: 6px; background: #22c55e; border-radius: 50%; flex-shrink: 0; }
.synd-live-dot::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; background: rgba(34, 197, 94, 0.5); animation: synd-dot-pulse 1.5s ease-in-out infinite; }
@keyframes synd-dot-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0; transform: scale(2.2); } }
