/* 
 * Carolina's Prospect Tracker - Styles
 * Mobile-first, clean, professional design
 */

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
    /* Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    --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;
    
    /* Quarter colors */
    --q1-color: #FFD700;
    --q2-color: #FF8C00;
    --q3-color: #4169E1;
    --q4-color: #DC143C;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    
    /* Borders */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Layout */
    --header-height: 60px;
    --bottom-nav-height: 70px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size-base);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
}

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

/* ============================================================
   Flash Messages
   ============================================================ */
.flash-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-md);
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.flash-info {
    background: #dbeafe;
    color: #1e40af;
}

.flash-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 var(--space-sm);
}

/* ============================================================
   Bottom Navigation
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--gray-200);
    z-index: 900;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    color: var(--gray-500);
    transition: color 0.2s;
    min-width: 64px;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: var(--space-xs);
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

.nav-item.active {
    color: var(--gray-700);
}

.nav-actions {
    display: flex;
    gap: 8px;
    margin-top: -20px;
}

.nav-add {
    position: relative;
}

.nav-add svg {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 50%;
    padding: 12px;
    color: white;
    box-shadow: var(--shadow-lg);
}

.nav-add:nth-child(2) svg {
    background: var(--success);
}

/* ============================================================
   Page Header
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header h1 {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    color: var(--gray-600);
}

.back-btn:active {
    background: var(--gray-100);
}

.back-btn svg {
    width: 24px;
    height: 24px;
}

.header-stats {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.stat-badge {
    background: var(--primary-light);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.header-action {
    background: none;
    border: none;
    padding: var(--space-sm);
    color: var(--gray-500);
    cursor: pointer;
}

.header-action:hover {
    color: var(--danger);
}

.header-action svg {
    width: 24px;
    height: 24px;
}

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

.header-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--gray-100);
    border-radius: var(--radius-md);
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
}

.header-link:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.header-link svg {
    width: 18px;
    height: 18px;
}

/* ============================================================
   Login Page
   ============================================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
}

.login-card {
    width: 100%;
    max-width: 360px;
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
}

.login-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.login-header h1 {
    font-size: var(--font-size-xl);
    color: var(--gray-800);
    margin-bottom: var(--space-xs);
}

.login-subtitle {
    color: var(--gray-500);
    font-size: var(--font-size-sm);
}

.login-form .form-group {
    margin-bottom: var(--space-lg);
}

.login-footer {
    text-align: center;
    margin-top: var(--space-xl);
    color: var(--gray-400);
    font-size: var(--font-size-sm);
}

/* ============================================================
   Forms
   ============================================================ */
.form-page {
    padding-bottom: var(--space-xl);
}

.prospect-form {
    padding: var(--space-md);
}

.form-section {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.form-section h3 {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--space-xs);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px var(--space-md);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-actions {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.field-action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--primary);
}

.field-action svg {
    width: 16px;
    height: 16px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    margin-top: var(--space-sm);
}

/* ============================================================
   Map Page
   ============================================================ */
.map-page {
    height: calc(100vh - var(--bottom-nav-height) - var(--safe-area-bottom));
    display: flex;
    flex-direction: column;
}

.map-container {
    flex: 1;
    width: 100%;
}

#map {
    height: 100%;
    width: 100%;
}

.map-legend {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--space-md) + var(--safe-area-bottom));
    left: var(--space-md);
    background: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    gap: var(--space-md);
    z-index: 500;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 12px;
    color: var(--gray-600);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Mobile-specific legend styles */
@media (max-width: 768px) {
    /* Hide Q1-Q4 text labels, show only dots */
    .legend-item:not(.legend-toggle) span:last-child {
        display: none;
    }
    
    /* Reduce dot size slightly */
    .legend-dot {
        width: 10px;
        height: 10px;
    }
    
    /* Tighter spacing between items */
    .map-legend {
        gap: var(--space-sm);
        padding: var(--space-xs) var(--space-sm);
    }
    
    /* Hide toggle button text labels */
    .legend-toggle span:last-child {
        display: none;
    }
    
    /* Slightly larger icons for tap targets */
    .legend-toggle svg {
        width: 18px;
        height: 18px;
    }
    
    /* Add subtle background to active toggles for clarity */
    .legend-toggle.active {
        background: var(--primary-100, #dbeafe);
        padding: 4px 6px;
        border-radius: 4px;
    }
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--space-md) + var(--safe-area-bottom));
    right: var(--space-md);
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 500;
    transition: transform 0.2s, background 0.2s;
}

.fab:hover {
    transform: scale(1.05);
    background: var(--primary-dark);
}

.fab svg {
    width: 24px;
    height: 24px;
}

/* Custom marker popup */
.marker-popup h4 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-xs);
}

.marker-popup .popup-address {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-xs);
}

.marker-popup .popup-interest {
    display: inline-block;
    background: var(--gray-100);
    padding: 2px var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-bottom: var(--space-sm);
}

.marker-popup .popup-notes {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-bottom: var(--space-sm);
}

.marker-popup .popup-link {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* Overlay popup */
.overlay-popup {
    text-align: center;
    padding: var(--space-xs);
}

.overlay-popup strong {
    font-size: var(--font-size-base);
    color: var(--gray-800);
}

.overlay-popup small {
    color: var(--gray-500);
    text-transform: capitalize;
}

/* Street popup */
.street-popup {
    padding: var(--space-xs);
}

.street-popup strong {
    font-size: var(--font-size-base);
    color: var(--gray-800);
}

/* ============================================================
   List Page
   ============================================================ */
.list-page {
    min-height: calc(100vh - var(--bottom-nav-height) - var(--safe-area-bottom));
}

.filters-bar {
    background: white;
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
}

.filters-form {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 100px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px var(--space-md);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background: white;
}

.search-group {
    flex: 2;
    display: flex;
    gap: var(--space-xs);
}

.search-group input {
    flex: 1;
}

.search-btn {
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.search-btn svg {
    width: 20px;
    height: 20px;
}

/* Prospect List */
.prospect-list {
    padding: var(--space-md);
}

.prospect-card {
    display: block;
    background: white;
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    box-shadow: var(--shadow-sm);
    color: inherit;
    transition: box-shadow 0.2s;
}

.prospect-card:active {
    box-shadow: var(--shadow-md);
}

.prospect-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.prospect-quarter {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
    color: white;
    background: var(--gray-400);
}

.prospect-quarter.q1 { background: var(--q1-color); color: var(--gray-800); }
.prospect-quarter.q2 { background: var(--q2-color); }
.prospect-quarter.q3 { background: var(--q3-color); }
.prospect-quarter.q4 { background: var(--q4-color); }

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

.prospect-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.prospect-address {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prospect-arrow {
    color: var(--gray-400);
    flex-shrink: 0;
}

.prospect-arrow svg {
    width: 20px;
    height: 20px;
}

.prospect-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
    padding-left: calc(40px + var(--space-md));
}

.meta-tag {
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 2px var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.meta-action {
    background: #dbeafe;
    color: #1e40af;
}

.meta-source {
    background: #fce7f3;
    color: #9d174d;
}

.meta-date {
    color: var(--gray-500);
    font-size: 12px;
}

.prospect-notes {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-top: var(--space-sm);
    padding-left: calc(40px + var(--space-md));
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--gray-500);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--gray-300);
    margin-bottom: var(--space-md);
}

.empty-state h3 {
    font-size: var(--font-size-lg);
    color: var(--gray-700);
    margin-bottom: var(--space-sm);
}

.empty-state .btn {
    margin-top: var(--space-lg);
}

/* ============================================================
   Quick Links
   ============================================================ */
.quick-links {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    overflow-x: auto;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: white;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.quick-link svg {
    width: 16px;
    height: 16px;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 400px;
    width: 100%;
}

.modal-content h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-md);
}

.modal-content p {
    color: var(--gray-600);
    margin-bottom: var(--space-sm);
}

.modal-content .text-muted {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.modal-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.modal-actions .btn {
    flex: 1;
}

/* ============================================================
   Streets Page
   ============================================================ */
.streets-page {
    padding-bottom: var(--space-xl);
}

.streets-info {
    padding: var(--space-md);
    background: #fef3c7;
    color: #92400e;
}

.suburbs-list {
    padding: var(--space-md);
}

.suburb-card {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
}

.suburb-card h3 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-xs);
}

.suburb-status {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

/* ============================================================
   Error Page
   ============================================================ */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

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

.error-icon {
    margin-bottom: var(--space-lg);
}

.error-icon svg {
    width: 64px;
    height: 64px;
    color: var(--warning);
}

.error-content h1 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-sm);
}

.error-content p {
    color: var(--gray-600);
    margin-bottom: var(--space-lg);
}

/* ============================================================
   Loading Spinners
   ============================================================ */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 768px) {
    .login-card {
        padding: var(--space-xl) 48px;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .filters-form {
        flex-wrap: nowrap;
    }
    
    .filter-group {
        min-width: 150px;
    }
}

/* ============================================================
   Utilities
   ============================================================ */
.text-muted {
    color: var(--gray-500);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================================
   Timeline / Activity History
   ============================================================ */
.quick-note-container {
    margin-bottom: var(--space-md);
}

.quick-note-input {
    display: flex;
    gap: var(--space-sm);
}

.quick-note-input input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: border-color 0.2s;
}

.quick-note-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.quick-note-input .btn {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.note-status {
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
    min-height: 20px;
}

.note-status.success {
    color: var(--success);
}

.note-status.error {
    color: var(--danger);
}

.timeline-entries {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
}

.timeline-entry {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
}

.timeline-entry:last-child {
    border-bottom: none;
}

.timeline-entry.new {
    background: #e8f5e9;
    animation: fadeIn 0.3s ease-out;
}

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

.timeline-date {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

.timeline-note {
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    line-height: 1.4;
}

.no-timeline {
    padding: var(--space-md);
    text-align: center;
    color: var(--gray-500);
    font-style: italic;
}

/* Quarter-colored timeline dates */
.timeline-entry[data-quarter="1"] .timeline-date {
    background: var(--q1-color);
    color: var(--gray-900);
}

.timeline-entry[data-quarter="2"] .timeline-date {
    background: var(--q2-color);
    color: white;
}

.timeline-entry[data-quarter="3"] .timeline-date {
    background: var(--q3-color);
    color: white;
}

.timeline-entry[data-quarter="4"] .timeline-date {
    background: var(--q4-color);
    color: white;
}

/* Follow Up entries - use a distinct color */
.followup-entry .followup-date {
    background: var(--success);
    color: white;
}

.followup-entry.new .followup-date {
    background: var(--success);
}

/* ============================================================ */
/* Property Bottom Sheet - Compact Mobile-First Design */
/* ============================================================ */

/* Overlay backdrop */
.property-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1000;
}
.property-sheet-overlay.active { display: block; }

/* Bottom Sheet Container */
.property-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.25s ease-out;
    z-index: 1001;
    max-height: 55vh; /* Reduced from 70vh for more map visibility */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.property-sheet.active { transform: translateY(0); }

/* Handle bar */
.property-sheet-handle {
    width: 32px;
    height: 3px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 8px auto 4px;
}

/* Close button */
.property-sheet-close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.property-sheet-close:active { background: #e5e7eb; }

/* Content container */
.property-sheet-content { padding: 0 16px 16px; }

/* Header section - more compact */
.property-sheet-header { margin-bottom: 10px; }

.property-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.property-sheet .property-address {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.property-sheet .property-suburb {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 6px 0;
}

/* Seller Target Badges */
.property-targets {
    display: flex;
    gap: 6px;
    margin: 6px 0;
    flex-wrap: wrap;
}

.target-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.downsizer-badge {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.largeland-badge {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

/* Zone and Land Use Info */
.property-zone-info {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.zone-pill {
    display: inline-block;
    padding: 2px 8px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.landuse-text {
    font-size: 10px;
    color: #6b7280;
    font-style: italic;
}

/* Stats grid - compact */
.property-sheet .property-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 10px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 10px;
}

.property-sheet .stat-item { text-align: center; }
.property-sheet .stat-icon { font-size: 18px; margin-bottom: 2px; }
.property-sheet .stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}
.property-sheet .stat-label {
    font-size: 9px;
    color: #9ca3af;
    text-transform: uppercase;
}

/* Size section - compact inline */
.property-size {
    display: flex;
    gap: 16px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 10px;
}
.size-item { flex: 1; }
.size-label { font-size: 11px; color: #6b7280; }
.size-value { font-size: 14px; font-weight: 600; color: #111827; }

/* Purchase info section - compact */
.property-purchase {
    padding: 10px 12px;
    background: #fffbeb;
    border-radius: 6px;
    margin-bottom: 12px;
}
.purchase-header {
    font-size: 9px;
    font-weight: 700;
    color: #92400e;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.purchase-price {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 2px;
}
.purchase-details { font-size: 12px; color: #6b7280; }
.purchase-separator { margin: 0 6px; }

/* Color-coded Owner Badges */
.owner-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.owner-badge.owner-green {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.owner-badge.rental-red {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.owner-badge.unknown-grey {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

/* Corporate Owner Name */
.owner-name {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #fde68a;
    font-size: 10px;
    color: #78350f;
    font-weight: 500;
}

/* Action buttons - row layout for compact view */
.property-actions {
    display: flex;
    gap: 8px;
}

.btn-rp-data,
.btn-add-prospect {
    flex: 1;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.btn-rp-data {
    background: #4f46e5;
    color: white;
}
.btn-rp-data:active { background: #4338ca; }

.btn-add-prospect {
    background: #10b981;
    color: white;
}
.btn-add-prospect:active { background: #059669; }

.btn-view-comps {
    flex: 1;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    background: #0891b2;
    color: white;
}
.btn-view-comps:active { background: #0e7490; }

/* ============================================================
   Comparable Sales Panel
   ============================================================ */

.comps-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    z-index: 1001;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.comps-panel.active {
    transform: translateY(0);
}

.comps-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s;
    z-index: 1000;
}

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

.comps-panel-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 8px auto;
}

.comps-panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.comps-panel-close:active { background: #e5e7eb; }

.comps-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 20px;
}

.comps-panel-header {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 12px;
}

.comps-panel-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.comps-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.comps-count {
    font-size: 14px;
    color: #6b7280;
}

.comps-price-range {
    font-size: 15px;
    color: #059669;
}

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

.comp-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.comp-item:active {
    background: #f3f4f6;
}

.comp-address {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}

.comp-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.comp-price {
    font-size: 16px;
    font-weight: 700;
    color: #059669;
}

.comp-meta {
    font-size: 13px;
    color: #6b7280;
}

.comp-sale-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #9ca3af;
}

/* Safe area for iPhone */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .property-sheet-content {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}

/* ============================================================
   KSS Conquest Zone Markers
   ============================================================ */
.kss-zone-marker {
    background: none;
    border: none;
}

.kss-zone-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: 3px solid #fff;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1.1;
}

.kss-zone-number small {
    font-size: 9px;
    opacity: 0.9;
    font-weight: normal;
}
