/* ============================================================
   Urban Lynx — Shared Styles
   ============================================================ */

/* --- Variables --- */
:root {
    --brand-teal: #2BBCB3;
    --brand-teal-hover: #249E97;
    --brand-teal-light: #E8F8F7;
    --text-primary: #222222;
    --text-secondary: #666666;
    --text-muted: #999999;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-gray: #F0F0F0;
    --border-color: #E0E0E0;
    --border-light: #EEEEEE;
    --danger: #E74C3C;
    --warning: #F39C12;
    --success: #27AE60;

    --sidebar-width: 200px;
    --sidebar-collapsed: 60px;
    --header-height: 96px;
    --mode-bar-height: 56px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-light);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: var(--brand-teal);
    text-decoration: none;
}
a:hover {
    color: var(--brand-teal-hover);
}

/* ============================================================
   Landing Page
   ============================================================ */

.landing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.landing-logo svg {
    width: 40px;
    height: 40px;
}

.landing-logo span {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.landing-nav a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.15s;
}
.landing-nav a:hover {
    color: var(--text-primary);
}

.landing-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 40px;
}

.landing-hero-text h1 {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}

.landing-hero-text p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.landing-hero-image {
    flex-shrink: 0;
    width: 500px;
    height: 320px;
    background: var(--bg-gray);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.landing-features {
    max-width: 1200px;
    margin: 0 auto 80px;
    padding: 0 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.landing-feature {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px 24px;
    text-align: center;
}

.landing-feature h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.landing-feature p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ============================================================
   App Shell — Header
   ============================================================ */

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px;
    z-index: 200;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    padding-right: 16px;
    border-right: 1px solid var(--border-color);
}

.app-logo img {
    width: 80px;
    height: 80px;
}

.app-logo svg {
    width: 80px;
    height: 80px;
}

.app-logo span {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.15;
    text-transform: none;
}

.app-company {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.app-header-right a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}
.app-header-right a:hover {
    color: var(--text-primary);
}

/* ============================================================
   App Shell — Sidebar
   ============================================================ */

.app-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    padding: 16px 0;
    z-index: 150;
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px 16px;
    color: var(--text-primary);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 2px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: var(--brand-teal-light);
    color: var(--brand-teal);
    border-left-color: var(--brand-teal);
    font-weight: 600;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid currentColor;
    flex-shrink: 0;
}

.sidebar-nav a.active .sidebar-icon {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
}

/* ============================================================
   App Shell — Main Content
   ============================================================ */

.app-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* ============================================================
   Mode Bar
   ============================================================ */

.mode-bar {
    display: flex;
    align-items: stretch;
    gap: 16px;
    padding: 16px 32px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

.mode-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    max-width: 280px;
}

.mode-btn {
    padding: 10px 32px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
    width: 100%;
}

.mode-btn:hover {
    border-color: var(--brand-teal);
    color: var(--brand-teal);
}

.mode-btn.active {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: white;
}

.mode-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.3;
}

/* ============================================================
   Content Area
   ============================================================ */

.content {
    padding: 32px;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.content-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

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

.btn-outline {
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-outline:hover {
    border-color: var(--brand-teal);
    color: var(--brand-teal);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--brand-teal);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ============================================================
   Search Bar
   ============================================================ */

.search-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.search-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.15s;
}

.search-input:focus {
    border-color: var(--brand-teal);
}

.scout-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}
.scout-status.info {
    background: #EBF5FB;
    color: #1A5276;
}
.scout-status.error {
    background: #FDEDEC;
    color: #922B21;
}

/* Autocomplete dropdown */
.scout-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}
.scout-ac-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}
.scout-ac-item:hover {
    background: #f0faf9;
}
.scout-ac-item:last-child {
    border-bottom: none;
}

/* CSV preview */
.scout-csv-preview {
    margin-top: 12px;
    padding: 12px 16px;
    background: #F8F9FA;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}
.scout-csv-list {
    max-height: 200px;
    overflow-y: auto;
}
.scout-csv-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.85rem;
    border-bottom: 1px solid #eee;
}
.scout-csv-item:last-child {
    border-bottom: none;
}
.scout-csv-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
}
.scout-csv-remove:hover {
    color: #c0392b;
}

/* Fuzzy match confirmation */
.scout-confirm {
    margin-top: 12px;
    padding: 12px 16px;
    background: #FEF9E7;
    border: 1px solid #F9E79F;
    border-radius: 6px;
    font-size: 0.9rem;
}
.scout-confirm-row {
    padding: 6px 0;
    border-bottom: 1px solid #F9E79F;
}
.scout-confirm-row:last-child {
    border-bottom: none;
}
.scout-confirm-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.scout-confirm-query {
    color: #666;
}
.scout-confirm-nomatch {
    color: #c0392b;
    font-size: 0.8rem;
    font-style: italic;
}

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

/* ============================================================
   Data Tables
   ============================================================ */

.table-container {
    overflow-x: auto;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    white-space: nowrap;
}

.data-table thead {
    background: var(--bg-light);
    position: sticky;
    top: 0;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--brand-teal-light);
}

.data-table .address-link {
    color: var(--brand-teal);
    font-weight: 500;
    cursor: pointer;
}
.data-table .address-link:hover {
    text-decoration: underline;
}

.rec-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.rec-high { background: #D5F5E3; color: #1E8449; }
.rec-medium { background: #FEF9E7; color: #B7950B; }
.rec-low { background: #FADBD8; color: #C0392B; }
.rec-na { background: #EAECEE; color: #717D7E; }

/* ============================================================
   Forms
   ============================================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus {
    border-color: var(--brand-teal);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-section {
    margin-bottom: 32px;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-teal);
    margin-bottom: 20px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.toggle {
    position: relative;
    width: 48px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle.active {
    background: var(--brand-teal);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle.active::after {
    transform: translateX(24px);
}

/* ============================================================
   Collapsible Sections (Pursuit Workspace)
   ============================================================ */

.collapsible {
    border-bottom: 1px solid var(--border-color);
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--brand-teal);
}

.collapsible-header::after {
    content: '\25BC';
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.collapsible-header.collapsed::after {
    transform: rotate(-90deg);
}

.collapsible-body {
    padding: 16px 0;
}

.collapsible-body.hidden {
    display: none;
}

/* ============================================================
   Dashboard Widgets
   ============================================================ */

.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.widget {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.widget-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
}

.widget-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

.widget-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.widget-list li:last-child {
    border-bottom: none;
}

/* ============================================================
   Info Tooltip (i) Icon
   ============================================================ */

.info-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    font-style: italic;
    color: var(--text-muted);
    cursor: help;
    position: relative;
    flex-shrink: 0;
}

.info-icon:hover {
    border-color: var(--brand-teal);
    color: var(--brand-teal);
}

.info-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 300px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
}

/* Ensure table headers don't clip tooltips */
.data-table thead th {
    overflow: visible;
    position: relative;
}
.data-table thead {
    overflow: visible;
}
.table-container {
    overflow-x: auto;
    overflow-y: visible;
}
.data-table-mobile-cards {
    overflow: visible;
}

/* ============================================================
   Scenario Tabs
   ============================================================ */

.scenario-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.scenario-tab {
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-white);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    color: var(--text-secondary);
    text-decoration: none;
}

.scenario-tab:hover {
    border-color: var(--brand-teal);
    color: var(--brand-teal);
}

.scenario-tab.active {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: white;
}

.scenario-tab-add {
    padding: 8px 12px;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    background: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* ============================================================
   Pursuit Two-Column Layout
   ============================================================ */

.pursuit-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
}

.pursuit-left {
    min-width: 0;
}

.pursuit-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.map-placeholder, .plan-placeholder {
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================================
   Status Badges
   ============================================================ */

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-contact-broker { background: #E8F8F7; color: #2BBCB3; }
.status-in-underwriting { background: #EBF5FB; color: #2E86C1; }
.status-loi-signed { background: #FEF9E7; color: #B7950B; }
.status-in-due-diligence { background: #F5EEF8; color: #7D3C98; }
.status-closed { background: #D5F5E3; color: #1E8449; }
.status-passed { background: #FADBD8; color: #C0392B; }

/* ============================================================
   Filters Bar
   ============================================================ */

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 24px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--font-family);
    outline: none;
    color: var(--text-secondary);
    min-width: 140px;
}

.filter-select:focus {
    border-color: var(--brand-teal);
}

/* ============================================================
   Timeline / Activity Feed
   ============================================================ */

.timeline {
    list-style: none;
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.timeline-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
    width: 80px;
}

.timeline-event {
    color: var(--text-primary);
}

/* ============================================================
   Login Page
   ============================================================ */

.login-container {
    max-width: 460px;
    margin: 80px auto;
    padding: 0 20px;
}

.login-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 48px 40px;
    text-align: center;
}

.login-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 32px;
}

.login-card .form-input {
    text-align: center;
    margin-bottom: 16px;
}

.login-card .btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1rem;
    margin-top: 8px;
}

.login-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 24px;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.login-checkbox input {
    margin-top: 3px;
    flex-shrink: 0;
}

/* ============================================================
   Editable Table (Development Plan)
   ============================================================ */

.editable-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.editable-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.8rem;
}

.editable-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
}

.editable-table input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: var(--font-family);
    background: var(--bg-light);
}

.editable-table input:focus {
    border-color: var(--brand-teal);
    outline: none;
    background: white;
}

/* ============================================================
   Responsive — Tablet (768px)
   ============================================================ */

@media (max-width: 768px) {
    /* Header */
    .app-header {
        padding: 0 16px;
    }
    .app-company {
        font-size: 1rem;
    }
    .app-header-right {
        gap: 16px;
    }
    .app-header-right a {
        font-size: 0.8rem;
    }

    /* Sidebar */
    .app-sidebar {
        transform: translateX(-100%);
        width: 240px;
        box-shadow: 4px 0 12px rgba(0,0,0,0.1);
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .sidebar-toggle {
        display: block;
    }

    /* Main */
    .app-main {
        margin-left: 0;
    }

    /* Mode bar */
    .mode-bar {
        padding: 10px 16px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .mode-item {
        flex: 0 0 auto;
        max-width: none;
    }
    .mode-btn {
        padding: 8px 20px;
        font-size: 0.85rem;
    }
    .mode-desc {
        display: none;
    }

    /* Scenario bar */
    .scenario-bar {
        flex-wrap: wrap;
    }
    .scenario-bar > span {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 8px;
    }

    /* Filters bar */
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    /* Editable tables */
    .editable-table {
        font-size: 0.8rem;
    }
    .editable-table th, .editable-table td {
        padding: 6px 8px;
    }

    /* All cards and content: prevent overflow */
    .card, .search-section {
        overflow-x: auto;
    }

    /* Data tables inside cards: allow horizontal scroll */
    .card .data-table {
        min-width: 500px;
    }

    /* Content */
    .content {
        padding: 20px 16px;
    }

    /* Pursuit layout */
    .pursuit-layout {
        grid-template-columns: 1fr;
    }
    .pursuit-left {
        overflow-x: hidden;
    }
    .pursuit-right {
        order: -1;
    }
    .map-placeholder, .plan-placeholder {
        height: 200px;
    }

    /* Landing */
    .landing-header {
        padding: 12px 20px;
    }
    .landing-nav {
        gap: 16px;
    }
    .landing-hero {
        flex-direction: column;
        gap: 32px;
        margin: 40px auto;
        padding: 0 20px;
    }
    .landing-hero-text h1 {
        font-size: 2rem;
    }
    .landing-hero-image {
        width: 100%;
        height: 220px;
    }
    .landing-features {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }

    /* Widget grid */
    .widget-grid {
        grid-template-columns: 1fr;
    }

    /* Filters */
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================
   Responsive — Mobile (480px)
   ============================================================ */

@media (max-width: 480px) {
    .app-header-right a.hide-mobile {
        display: none;
    }

    .app-company {
        font-size: 0.85rem;
    }

    .landing-nav a.hide-mobile {
        display: none;
    }

    .landing-hero-text h1 {
        font-size: 1.6rem;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Scout results: card view on mobile */
    .data-table-mobile-cards .data-table thead {
        display: none;
    }
    .data-table-mobile-cards .data-table tbody tr {
        display: block;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;
        background: var(--bg-white);
    }
    .data-table-mobile-cards .data-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        border-bottom: 1px solid var(--border-light);
        white-space: normal;
    }
    .data-table-mobile-cards .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.8rem;
        flex-shrink: 0;
        margin-right: 12px;
    }
    .data-table-mobile-cards .data-table tbody td:last-child {
        border-bottom: none;
    }

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

    .scenario-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .login-card {
        padding: 32px 24px;
    }
}

/* ============================================================
   Sidebar Overlay (mobile)
   ============================================================ */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 140;
}

.sidebar-overlay.visible {
    display: block;
}

/* ============================================================
   Utility Classes
   ============================================================ */

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ============================================================
   B8: Address column — black, bold, clickable
   ============================================================ */
.address-link {
    color: var(--text-primary) !important;
    font-weight: 700;
    text-decoration: none;
}
.address-link:hover {
    text-decoration: underline;
}

/* ============================================================
   C17: Color coding — yellow = clickable/link, teal = editable
   ============================================================ */
.field-clickable {
    background-color: #FFF9C4;
    cursor: pointer;
}
.field-clickable:hover {
    background-color: #FFF176;
}
.field-editable {
    background-color: #E0F2F1;
    border-color: var(--brand-teal);
}
.field-editable:focus {
    outline: 2px solid var(--brand-teal);
    background-color: #fff;
}

/* ============================================================
   Asking Price inline input (Scout results table)
   ============================================================ */
.asking-price-input {
    width: 90px;
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    text-align: right;
    background: var(--bg-light);
}
.asking-price-input:focus {
    outline: 2px solid var(--brand-teal);
    background: #fff;
}

/* ============================================================
   Pursuit page: Section nav bullets
   ============================================================ */
.section-nav {
    position: sticky;
    top: calc(var(--header-height) + 16px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 16px;
}
.section-nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.15s;
}
.section-nav-dot.active,
.section-nav-dot:hover {
    border-color: var(--brand-teal);
    background: var(--brand-teal);
}

/* ============================================================
   Pursuit page: Two-way toggle
   ============================================================ */
.two-way-toggle {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.8rem;
}
.two-way-toggle button {
    padding: 6px 14px;
    border: none;
    background: var(--bg-light);
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.two-way-toggle button.active {
    background: var(--brand-teal);
    color: #fff;
}

/* ============================================================
   Pursuit page: Collapsible section with expand/collapse arrow
   ============================================================ */
.collapsible-header::after {
    content: '\25BC';
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: auto;
    transition: transform 0.2s;
}
.collapsible-header.collapsed::after {
    transform: rotate(-90deg);
}
