:root {
    /* theFLIP Brand Colors */
    --flip-green: #4ade80;
    --flip-cyan: #22d3ee;
    --flip-gradient: linear-gradient(135deg, #4ade80 0%, #22d3ee 100%);
    
    /* UI Colors - Clean White Theme */
    --background: #ffffff;
    --surface: #f8fafc;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--surface);
    color: var(--text-primary);
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar with theFLIP Branding */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1a1d2e 0%, #0f0f1a 100%);
    color: white;
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.text-logo {
    border: 4px solid white;
    border-radius: 12px;
    padding: 12px 20px;
    display: inline-block;
    font-family: 'Righteous', sans-serif;
    font-size: 36px;
    font-weight: 400;
    letter-spacing: -1px;
    background: linear-gradient(90deg, #84cc16 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.sidebar-header p {
    font-size: 13px;
    color: #8b92a7;
    font-weight: 500;
}

.new-deal-btn {
    width: 100%;
    padding: 11px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 8px;
    font-size: 14px;
    transition: all 0.3s;
    text-align: left;
}

.new-deal-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    transform: translateX(2px);
}

.deal-list {
    list-style: none;
}

/* Drag and Drop Styles */
.pipeline-column {
    user-select: none;
}

[draggable="true"] {
    cursor: move;
    user-select: none;
}

[draggable="true"]:active {
    cursor: grabbing;
}

.deal-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #2d3748;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.deal-item:hover {
    background: #4a5568;
}

.deal-item.active {
    background: #3182ce;
}

.deal-item-address {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.deal-item-status {
    font-size: 12px;
    color: #a0aec0;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: #f5f7fa;
}

/* Navigation Bar */
.nav-bar {
    background: var(--sidebar-bg);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding: 0 40px;
    padding-right: 120px; /* Reserve space for avatar + margin */
    display: flex;
    flex-wrap: nowrap; /* Don't wrap - keep in single row */
    gap: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto; /* Horizontal scroll */
    overflow-y: hidden; /* Hide overflow - menu uses fixed positioning now */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

.nav-bar::-webkit-scrollbar {
    height: 6px;
}

.nav-bar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.nav-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.nav-bar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.nav-item {
    padding: 14px 16px; /* Reduced from 16px 20px */
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    font-size: 13px; /* Reduced from 14px */
    color: #94a3b8;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap; /* Prevent text wrapping inside tabs */
    flex-shrink: 0; /* Prevent tabs from shrinking */
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    color: var(--flip-cyan);
    border-bottom: 3px solid;
    border-image: var(--flip-gradient) 1;
    font-weight: 600;
}

.nav-more-btn {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    font-size: 13px;
    color: #94a3b8;
    transition: all 0.2s;
    display: none; /* Hidden by default, shown via JS */
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative; /* Make this the positioning parent */
}

.nav-more-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-overflow-menu {
    display: none !important;
    position: fixed; /* Fixed positioning escapes parent overflow */
    top: 60px; /* Below nav bar */
    right: 140px; /* Aligned with More button area */
    background: var(--sidebar-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10000; /* Way above everything else */
    margin-top: 5px;
}

.nav-overflow-menu.active {
    display: block !important;
}

.nav-overflow-item {
    padding: 12px 16px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 13px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-overflow-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-overflow-item.active {
    color: var(--flip-cyan);
    border-left: 3px solid var(--flip-cyan);
    background: rgba(255, 255, 255, 0.05);
}

/* Default: Show all tabs, hide More button */
.nav-item-overflow {
    display: flex;
}

.nav-more-btn {
    display: none;
}

/* On smaller screens: Hide overflow tabs, show More button */
@media (max-width: 1400px) {
    .nav-item-overflow {
        display: none !important;
    }
    
    .nav-more-btn {
        display: flex !important;
    }
}

/* Content Area */
.content-area {
    padding: 40px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.page-header .subtitle {
    color: #718096;
    font-size: 14px;
}

/* Cards */
.card {
    background: linear-gradient(135deg, #1e2139 0%, #1a1d2e 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.card-header h3 {
    font-size: 18px;
    color: #ffffff;
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3182ce;
}

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

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: none;
}

.btn-primary {
    background: rgba(59,130,246,0.15);
    color: #3b82f6;
    border: 1px solid rgba(59,130,246,0.3);
    transition: all 0.3s;
}

.btn-primary:hover {
    background: rgba(59,130,246,0.25);
    border-color: rgba(59,130,246,0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: #8b92a7;
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: #e0e0e0;
    border-color: rgba(255,255,255,0.2);
}

.btn-success {
    background: rgba(16,185,129,0.15);
    color: #10b981;
    border: 1px solid rgba(16,185,129,0.3);
}

.btn-success:hover {
    background: rgba(16,185,129,0.25);
    border-color: rgba(16,185,129,0.5);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.3);
}

.btn-danger:hover {
    background: rgba(239,68,68,0.25);
    border-color: rgba(239,68,68,0.5);
    transform: translateY(-1px);
}

.btn-small {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* Comp Search Results */
.comp-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px;
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.data-table tr:hover {
    background: #f7fafc;
}

.data-table input,
.data-table select {
    width: 100%;
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
}

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

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.stat-card {
    background: linear-gradient(135deg, #1e2139 0%, #1a1d2e 100%);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-left: 4px solid #3b82f6;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    transform: translateY(-2px);
    border-left-color: #8b5cf6;
}

.stat-label {
    font-size: 13px;
    color: #8b92a7;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
}

.stat-subtext {
    font-size: 12px;
    color: #8b92a7;
    margin-top: 4px;
}

/* Trade Cards */
.trades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.trade-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid #cbd5e0;
}

.trade-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.trade-card.status-pending { border-left-color: #ed8936; }
.trade-card.status-in-progress { border-left-color: #3182ce; }
.trade-card.status-completed { border-left-color: #48bb78; }
.trade-card.status-on-hold { border-left-color: #f56565; }

.trade-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.trade-name {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.trade-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.trade-status.pending { background: #feebc8; color: #c05621; }
.trade-status.in-progress { background: #bee3f8; color: #2c5282; }
.trade-status.completed { background: #c6f6d5; color: #22543d; }
.trade-status.on-hold { background: #fed7d7; color: #742a2a; }

.trade-details {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.trade-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.trade-detail-label {
    color: #718096;
}

.trade-detail-value {
    font-weight: 600;
    color: #2d3748;
}

/* Photo Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #e2e8f0;
    cursor: pointer;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #a0aec0;
    font-size: 40px;
}

.photo-upload-btn {
    margin-top: 10px;
    font-size: 14px;
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px;
    font-size: 12px;
}

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

.modal.active {
    display: flex;
}

.modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(135deg, #2a2d3a 0%, #1f212d 100%) !important;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #8b92a7;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 30px;
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 22px;
    color: #ffffff;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #4a5568;
}

.empty-state p {
    color: #718096;
    margin-bottom: 20px;
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #e2e8f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 20px;
}

.back-button:hover {
    background: #cbd5e0;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: #48bb78;
    transition: width 0.3s;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #1a1d2e 0%, #151721 100%);
    padding: 15px 20px 0 20px;
    border-radius: 12px 12px 0 0;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #8b92a7;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.tab:hover {
    color: #e0e0e0;
    background: rgba(255,255,255,0.05);
    border-radius: 8px 8px 0 0;
}

.tab.active {
    color: white;
    border-bottom-color: #3b82f6;
}

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

.badge-success { background: #c6f6d5; color: #22543d; }
.badge-warning { background: #feebc8; color: #c05621; }
.badge-danger { background: #fed7d7; color: #742a2a; }
.badge-info { background: #bee3f8; color: #2c5282; }

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Hamburger Menu Button (hidden on desktop) */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2000;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4ade80 0%, #22d3ee 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
}

/* Mobile Styles (phones and small tablets) */
@media (max-width: 768px) {
    /* Show hamburger menu */
    .mobile-menu-btn {
        display: flex;
        width: 44px;
        height: 44px;
        top: 12px;
        left: 12px;
    }

    .mobile-menu-btn span {
        width: 22px;
        height: 2px;
    }

    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1600;
        transition: left 0.3s ease;
        box-shadow: 4px 0 12px rgba(0,0,0,0.3);
        width: 260px;
        padding: 16px;
    }

    /* Sidebar content smaller on mobile */
    .sidebar .text-logo {
        font-size: 28px;
        padding: 10px 16px;
        border-width: 3px;
    }

    .sidebar-header {
        margin-bottom: 20px;
        padding-bottom: 16px;
    }

    .sidebar-header p {
        font-size: 11px;
    }

    .new-deal-btn {
        padding: 10px 14px;
        font-size: 13px;
        margin-bottom: 6px;
    }

    /* Show sidebar when active */
    .sidebar.active {
        left: 0;
    }

    /* Show overlay when sidebar is active */
    .mobile-overlay.active {
        display: block;
    }

    /* Nav bar sticky at top with proper spacing for mobile buttons */
    .nav-bar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 999 !important;
        padding: 8px 70px !important;
        min-height: 50px;
    }

    .nav-item {
        font-size: 12px !important;
        padding: 10px 8px !important;
    }

    /* Content area padding to account for fixed nav */
    .content-area {
        padding: 60px 12px 12px 12px !important;
        background: #0f0f1a !important;
        min-height: 100vh !important;
    }

    /* Main content takes full width */
    .main-content {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 0 !important;
        background: #0f0f1a !important;
    }

    /* User menu button - adjust position for mobile */
    #userMenuContainer {
        top: 8px !important;
        right: 10px !important;
        gap: 8px !important;
    }

    #userMenuContainer > button,
    #userMenuContainer > div > button {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }

    /* Notification dropdown mobile */
    #notificationsDropdown {
        min-width: 300px !important;
        right: -50px !important;
    }

    /* User dropdown mobile */
    #userMenu {
        min-width: 200px !important;
    }

    /* Modals - tighter padding on mobile */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto !important;
        max-height: 90vh !important;
        padding: 16px !important;
        border-radius: 12px !important;
    }

    .modal-header {
        padding: 12px 16px !important;
    }

    .modal-header h3 {
        font-size: 16px !important;
    }

    .modal-body {
        padding: 16px !important;
    }

    .modal-content h3 {
        font-size: 18px !important;
        margin-bottom: 16px !important;
    }

    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }

    /* Forms stack vertically */
    .form-row {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .form-row .form-group {
        width: 100% !important;
    }

    .form-group label {
        font-size: 12px !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px !important;
        font-size: 14px !important;
    }

    /* Buttons - NOT full width by default, only in specific contexts */
    .btn {
        padding: 10px 16px !important;
        font-size: 13px !important;
    }

    .btn-small, .btn-sm {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    /* Full width buttons only in modal actions and specific containers */
    .modal-actions .btn {
        width: 100% !important;
    }

    /* Cards - tighter spacing */
    .card {
        padding: 16px !important;
        margin-bottom: 12px !important;
        border-radius: 12px !important;
    }

    .card-header {
        padding-bottom: 10px !important;
        margin-bottom: 12px !important;
        flex-wrap: wrap;
        gap: 8px;
    }

    .card-header h3 {
        font-size: 15px !important;
    }

    /* Stats grid - 2 columns on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .stat-card {
        padding: 12px !important;
        border-radius: 10px !important;
    }

    .stat-label {
        font-size: 10px !important;
        margin-bottom: 4px !important;
    }

    .stat-value {
        font-size: 18px !important;
    }

    .stat-subtext {
        font-size: 10px !important;
    }

    /* Pipeline stages stack */
    .pipeline-stages {
        grid-template-columns: 1fr !important;
    }

    /* Tables scroll horizontally */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .data-table td,
    .data-table th {
        padding: 10px 8px !important;
        font-size: 12px !important;
    }

    /* Smaller text on mobile */
    h1 { font-size: 20px !important; }
    h2 { font-size: 18px !important; }
    h3 { font-size: 16px !important; }
    h4 { font-size: 14px !important; }

    /* Page headers */
    .page-header {
        margin-bottom: 16px !important;
    }

    .page-header h2 {
        font-size: 18px !important;
    }

    .page-header .subtitle {
        font-size: 12px !important;
    }

    /* Tab navigation scrollable */
    .tabs {
        padding: 10px 12px 0 12px !important;
        gap: 4px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        padding: 10px 14px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }

    .tab-nav {
        overflow-x: auto;
        flex-wrap: nowrap !important;
    }

    .tab-nav button {
        flex-shrink: 0;
    }

    /* Trade cards */
    .trades-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .trade-card {
        padding: 14px !important;
    }

    .trade-name {
        font-size: 15px !important;
    }

    .trade-status {
        font-size: 10px !important;
        padding: 3px 6px !important;
    }

    .trade-detail-row {
        font-size: 12px !important;
    }

    /* Photo gallery smaller */
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Empty state */
    .empty-state {
        padding: 40px 16px !important;
    }

    .empty-state h3 {
        font-size: 16px !important;
    }

    .empty-state p {
        font-size: 13px !important;
    }

    /* Back button */
    .back-button {
        padding: 8px 12px !important;
        font-size: 13px !important;
        margin-bottom: 12px !important;
    }

    /* Badge smaller */
    .badge {
        font-size: 10px !important;
        padding: 3px 6px !important;
    }

    /* Charts smaller */
    .chart-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Fix inline styles that use px values - override with smaller mobile values */
    [style*="font-size: 24px"],
    [style*="font-size:24px"] {
        font-size: 18px !important;
    }

    [style*="font-size: 28px"],
    [style*="font-size:28px"] {
        font-size: 20px !important;
    }

    [style*="font-size: 32px"],
    [style*="font-size:32px"] {
        font-size: 22px !important;
    }

    [style*="font-size: 36px"],
    [style*="font-size:36px"] {
        font-size: 24px !important;
    }

    [style*="font-size: 48px"],
    [style*="font-size:48px"] {
        font-size: 32px !important;
    }

    [style*="padding: 24px"],
    [style*="padding:24px"] {
        padding: 14px !important;
    }

    [style*="padding: 32px"],
    [style*="padding:32px"] {
        padding: 16px !important;
    }

    [style*="padding: 40px"],
    [style*="padding:40px"] {
        padding: 16px !important;
    }

    [style*="gap: 20px"],
    [style*="gap:20px"] {
        gap: 12px !important;
    }

    [style*="gap: 24px"],
    [style*="gap:24px"] {
        gap: 12px !important;
    }

    [style*="margin-bottom: 24px"],
    [style*="margin-bottom:24px"] {
        margin-bottom: 14px !important;
    }

    [style*="margin-bottom: 30px"],
    [style*="margin-bottom:30px"] {
        margin-bottom: 16px !important;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    button, .btn, a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* FLIP Phase 2 Dark Form Styles */
.content-area label {
    display: block;
    color: #8b92a7 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    margin-bottom: 8px !important;
}

.content-area input[type="text"],
.content-area input[type="number"],
.content-area input[type="email"],
.content-area input[type="tel"],
.content-area input[type="date"],
.content-area input[type="password"],
.content-area select,
.content-area textarea {
    width: 100%;
    padding: 10px 12px !important;
    background: #1a1d2e !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-size: 14px !important;
}

.content-area input[type="text"]:focus,
.content-area input[type="number"]:focus,
.content-area input[type="email"]:focus,
.content-area input[type="tel"]:focus,
.content-area input[type="date"]:focus,
.content-area input[type="password"]:focus,
.content-area select:focus,
.content-area textarea:focus {
    outline: none !important;
    border-color: rgba(102,126,234,0.5) !important;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1) !important;
}

.content-area .card {
    background: linear-gradient(135deg, #2a2d3a 0%, #1f212d 100%) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 16px !important;
}

.content-area .card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

.content-area .card-header h3 {
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: 600 !important;
}

/* Trade Cards Dark Styling */
.trade-card {
    background: linear-gradient(135deg, #2a2d3a 0%, #1f212d 100%) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 12px !important;
}

.trade-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

.trade-name {
    color: #ffffff !important;
}

.trade-status {
    background: rgba(245,158,11,0.15) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245,158,11,0.3) !important;
}

.trade-status.completed {
    background: rgba(16,185,129,0.15) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16,185,129,0.3) !important;
}

.trade-detail-label {
    color: #8b92a7 !important;
}

.trade-detail-value {
    color: #ffffff !important;
}

/* Stat Cards Dark Styling */
.stat-card {
    background: linear-gradient(135deg, #2a2d3a 0%, #1f212d 100%) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 12px !important;
    padding: 20px !important;
}

.stat-label {
    color: #8b92a7 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 8px !important;
}

.stat-value {
    color: #ffffff !important;
    font-size: 24px !important;
    font-weight: 700 !important;
}

/* Data Table Dark Styling */
.data-table {
    background: transparent !important;
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
    width: 100% !important;
}

.data-table thead tr {
    background: linear-gradient(135deg, #1a1d2e 0%, #151721 100%) !important;
}

.data-table thead th {
    color: #8b92a7 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 16px 12px !important;
    border-bottom: 2px solid rgba(255,255,255,0.1) !important;
    background: transparent !important;
}

.data-table thead th:first-child {
    border-radius: 8px 0 0 0 !important;
}

.data-table thead th:last-child {
    border-radius: 0 8px 0 0 !important;
}

.data-table tbody tr {
    background: linear-gradient(135deg, #2a2d3a 0%, #1f212d 100%) !important;
    border-radius: 8px !important;
}

.data-table tbody tr:hover {
    background: linear-gradient(135deg, #2d3140 0%, #222430 100%) !important;
}

.data-table tbody td {
    padding: 16px !important;
    color: #ffffff !important;
    border-top: 1px solid rgba(255,255,255,0.05) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

.data-table tbody td:first-child {
    border-left: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 8px 0 0 8px !important;
}

.data-table tbody td:last-child {
    border-right: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 0 8px 8px 0 !important;
}

.data-table tbody tr td input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    accent-color: #10b981 !important;
}

.data-table tbody tr td strong {
    color: #ffffff !important;
}

/* Read-only mode for JV partner shared deals */
.read-only-deal input,
.read-only-deal select,
.read-only-deal textarea {
    pointer-events: none !important;
    opacity: 0.7 !important;
    background: rgba(255,255,255,0.03) !important;
}

.read-only-deal button:not(.nav-item):not(.back-button):not(.nav-overflow-item):not(.nav-more-btn) {
    display: none !important;
}

.read-only-deal .delete-deal-btn,
.read-only-deal .new-deal-btn-inline {
    display: none !important;
}

/* Mobile-specific JV partner / read-only styles */
@media (max-width: 768px) {
    /* Better readability on mobile for read-only inputs */
    .read-only-deal input,
    .read-only-deal select,
    .read-only-deal textarea {
        opacity: 0.85 !important;
        background: rgba(255,255,255,0.05) !important;
        font-size: 14px !important;
    }

    /* Read-only banner mobile sizing */
    .read-only-banner,
    [style*="Viewing as JV Partner"] {
        font-size: 12px !important;
        padding: 10px 12px !important;
        flex-wrap: wrap;
        gap: 4px;
    }

    /* Shared deals page cards larger on mobile */
    .shared-deal-card {
        min-height: 140px !important;
        padding: 16px !important;
    }

    /* Shared deals grid single column on mobile */
    .shared-deals-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Make touch targets bigger for JV view */
    .read-only-deal .nav-item {
        min-height: 44px;
        padding: 12px 16px;
    }

    /* Improve chart containers on mobile */
    .read-only-deal .chart-container {
        height: 200px !important;
        min-height: 180px;
    }

    /* Deal stats grid on mobile */
    .read-only-deal .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}
