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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

.header {
    background: white;
    padding: 12px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-item {
    color: #000;
    text-decoration-line: underline;
    text-decoration-style: dotted;
    font-size: 14px;
    font-weight: 500;
}

.nav-item.active {
    color: #000;
    font-weight: 700;
    text-decoration-style: solid;
}

.search-bar {
    display: flex;
    border: 1px solid #000;
    align-items: center;
    background: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    width: 300px;
}

.search-bar input {
    background: none;
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
}

.search-bar span {
    font-size: 14px;
    color: #888;
    flex-shrink: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

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

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-icon {
    width: 20px;
    height: 20px;
    background: #666;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #000;
    border-radius: 6px;
    font-size: 14px;
    width: 200px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #000;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.suggest-btn { padding: 8px 16px; border: 1.5px solid #000; border-radius: 6px; background: #fff; color: #000; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.suggest-btn:hover { background: #000; color: #fff; }
.smodal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); z-index: 1000; overflow-y: auto; padding: 24px 16px; }
.smodal-box { background: #fff; max-width: 540px; margin: 0 auto; border-radius: 8px; padding: 32px; position: relative; }
.smodal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 22px; cursor: pointer; color: #666; line-height: 1; }
.smodal-close:hover { color: #000; }
.smodal h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; color: #000; }
.smodal-sub { font-size: 13px; color: #666; margin-bottom: 24px; }
.smodal-ok { display: none; padding: 14px; background: #f0fff4; border: 1px solid #c6f6d5; border-radius: 6px; color: #276749; font-size: 14px; margin-bottom: 16px; }
.smodal-err { display: none; padding: 10px 12px; background: #fff5f5; border: 1px solid #fed7d7; border-radius: 6px; color: #c53030; font-size: 13px; margin-bottom: 16px; }
.smodal-f { margin-bottom: 14px; }
.smodal-f label { display: block; font-size: 13px; font-weight: 600; color: #333; margin-bottom: 4px; }
.smodal-f input, .smodal-f textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 6px; padding: 8px 12px; font-size: 14px; font-family: inherit; box-sizing: border-box; }
.smodal-f input:focus, .smodal-f textarea:focus { outline: none; border-color: #000; }
.smodal-f textarea { resize: vertical; min-height: 70px; }
.smodal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.smodal-submit { width: 100%; background: #000; color: #fff; border: none; border-radius: 6px; padding: 10px; font-size: 14px; font-weight: 500; cursor: pointer; margin-top: 4px; }
.smodal-submit:hover { background: #333; }
.smodal-submit:disabled { background: #ccc; cursor: not-allowed; }

/* === Year multi-select === */
.year-multi { position: relative; display: inline-block; }
.year-multi .year-toggle {
    padding: 8px 12px;
    border: 1px solid #000;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 140px;
    max-width: 260px;
}
.year-multi .year-tags {
    display: flex;
    gap: 6px;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    max-width: 160px;
}
.year-multi .year-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f0f7ff;
    color: #007bff;
    font-size: 12px;
}
.year-multi .year-caret { color: #666; font-size: 12px; }

.year-multi .year-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 260px;
    max-width: 90vw;
    background: white;
    border: 1px solid #e6e6e6;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 8px;
    z-index: 9999;
    display: none;
    max-height: 260px;
    overflow: auto;
}
.year-multi .year-dropdown.show { display: block; }
.year-multi .year-dropdown label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.year-multi .year-dropdown label:hover { background: #f8f9fb; }
.year-multi .year-actions { display: flex; justify-content: flex-end; padding-top: 6px; }

/* === Filters toggle & panel === */
.filters-toggle {
    padding: 8px 14px;
    border: 1px solid #000;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}
.filters-toggle:hover { background: #f8f9fb; }
.filters-toggle.active { background: #000; color: #fff; }
.filters-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #007bff;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
}
.filters-toggle.active .filters-badge { background: #fff; color: #000; }
.filters-panel {
    margin-bottom: 16px;
    padding: 14px 0 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.investor-search-input {
    padding: 8px 12px;
    border: 1px solid #000;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    width: 160px;
    font-family: inherit;
}
.investor-search-input:focus { outline: none; border-color: #555; }

/* === Table === */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.table th {
    background: #000;
    padding: 12px;
    text-align: left;
    font-weight: 500;
    color: #fff;
    font-size: 13px;
    border-bottom: 1px solid #e9ecef;
}

.table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.table tr:hover {
    background: #f8f9fa;
}

.startup-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.startup-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.startup-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    flex-shrink: 0;
}

.startup-logo img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.startup-details {
    min-width: 0;
    flex: 1;
}

.startup-name {
    font-weight: 600;
    color: #000;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.startup-name:hover {
    color: #0056b3;
    text-decoration: underline;
}

.info-btn {
    width: 20px;
    height: 20px;
    background: #000;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.info-btn:hover {
    background: #666;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4CAF50;
}

.investors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.investor-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #fff;
    color: #000;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: 1px solid #000;
}

.investor-tag:hover {
    background: #000;
    color: white;
    text-decoration: none;
}

.more-investors {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.page-btn.active {
    background: #000;
    color: white;
    border-color: #666;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 24px;
}

/* === Modal === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #000 0%, #888787 100%);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-startup-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.modal-logo img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.modal-startup-details h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    margin-top: 16px;
}

.info-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-alive {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-closed {
    background: #ffebee;
    color: #c62828;
}

.status-acquired {
    background: #e3f2fd;
    color: #1565c0;
}

/* === Tab nav === */
.tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
    color: #111;
}

.col-added { display: none; }
.table.show-added .col-added { display: table-cell; }

.tab-btn.active {
    color: #111;
    border-bottom-color: #111;
    font-weight: 600;
}

/* === Footer === */
.footer {
    margin-top: 60px;
    border-top: 1px solid #e5e7eb;
    padding: 28px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.footer-copy {
    font-size: 13px;
    color: #999;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-link {
    font-size: 13px;
    color: #555;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-link:hover {
    color: #000;
}

/* === Mobile card layout (hidden on desktop) === */
.cards-container {
    display: none;
}

.startup-card {
    background: white;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

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

.card-title .startup-name {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.card-status {
    margin-top: 4px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.card-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #555;
    font-size: 12px;
}

.card-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.45;
    margin-bottom: 10px;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-funding {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

/* =====================================================
   RESPONSIVE — desktop styles above are NOT touched
   ===================================================== */

/* Tablet: ≤ 900px */
@media (max-width: 900px) {
    .header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 16px;
    }

    .search-bar {
        width: 100%;
        order: 3;
    }

    .container {
        padding: 16px;
    }

    /* Hide less critical table columns */
    .table th:nth-child(4),  /* Year */
    .table td:nth-child(4),
    .table th:nth-child(5),  /* HQ */
    .table td:nth-child(5) {
        display: none;
    }
}

/* Mobile: ≤ 600px */
@media (max-width: 600px) {
    .nav {
        gap: 10px;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .page-title {
        font-size: 18px;
    }

    /* Switch to card layout */
    .table-container {
        display: none;
    }

    .cards-container {
        display: block;
    }

    /* Modal full-screen on mobile */
    .modal-content {
        width: 96%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 10px;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-startup-details h2 {
        font-size: 18px;
    }

    .modal-body {
        padding: 16px;
    }

    /* Stack modal grid to single column */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Suggest modal */
    .smodal-box {
        padding: 20px 16px;
    }

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

    /* Footer */
    .footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 16px;
    }

    .filters-panel {
        gap: 8px;
    }

    .investor-search-input {
        width: 100%;
    }

    .year-multi .year-toggle {
        min-width: 110px;
    }
}
