@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

html {
    overscroll-behavior: none;
    background: #ffffff;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    color: #000000;
    min-height: 100vh;
    overflow-y: auto;
    position: relative;
}

.app {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    padding-top: 80px;
    padding-bottom: 3rem;
}

.page-header {
    padding: 3rem 2rem 1rem 2rem;
}

.page-header-container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    font-family: 'Inter', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.page-description {
    font-size: 1.1rem;
    color: #6b7280;
    margin: 0;
}

.filters-section {
    padding: 1rem 2rem;
    margin: 0 auto;
    width: 100%;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.875rem;
    margin-bottom: 1rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

.filter-group input, .filter-group select {
    padding: 0.5rem 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    background: #ffffff;
    color: #000000;
}

.filter-group input::placeholder {
    color: #9ca3af;
}

.filter-group select option {
    background: #ffffff;
    color: #000000;
}

.filter-group input:focus, .filter-group select:focus {
    outline: none;
    border-color: #d1d5db;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.03);
    background: #ffffff;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.filter-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn {
    padding: 0.625rem 1.25rem;
    border: 1px solid rgba(1, 74, 51, 0.4);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.btn-primary:hover:not(:disabled) {
    background: #1f2937;
    border-color: #1f2937;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: #fafafa;
    color: #1f2937;
    border-color: #f3f4f6;
}

.btn-secondary:hover:not(:disabled) {
    background: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.view-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.view-toggle {
    background: #fafafa;
    border: 1px solid #f3f4f6;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}

.view-toggle.active {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-toggle:hover:not(.active) {
    background: #ffffff;
    border-color: #e5e7eb;
}

.spreadsheet-container {
    flex: 1;
    background: #ffffff;
    margin: 2rem auto;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: calc(100% - 4rem);
    max-width: 1200px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.virtual-table {
    flex: 1;
    position: relative;
    overflow: auto;
    border: none;
}

.table-header {
    position: sticky;
    top: 0;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    z-index: 10;
    display: flex;
    font-weight: 700;
    font-size: 0.8rem;
    color: #374151;
    font-family: 'Inter', sans-serif;
    width: 100%;
}

.table-body {
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
}

/* Smaller font for complete view */
.view-complete .table-body {
    font-size: 0.45rem;
}

.view-complete .table-header {
    font-size: 0.5rem;
}

.table-row {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.15s;
    width: 100%;
}

.table-row:hover {
    background: #f9fafb;
}

.table-row:nth-child(even) {
    background: #ffffff;
}

.table-row:nth-child(odd) {
    background: #f9fafb;
}

.table-cell {
    padding: 0.5rem 0.6rem;
    border-right: 1px solid #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    min-height: 2.5rem;
    color: #374151;
}

.table-header .table-cell {
    background: transparent;
    font-weight: 700;
    border-bottom: none;
    position: relative;
    overflow: hidden;
    resize: none;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #374151;
}

.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    cursor: col-resize;
    z-index: 20;
}

.resize-handle:hover {
    background: rgba(0, 0, 0, 0.2);
}

.resizing {
    user-select: none;
}

.table-header .table-cell:hover {
    background: #f3f4f6;
}

/* Column widths */
.col-id { width: 95px; }
.col-owner { width: 180px; }
.col-city { width: 120px; }
.col-zip { width: 70px; }
.col-holder { width: 260px; }
.col-type { width: 190px; }
.col-balance {
    width: 120px;
    text-align: right;
    flex-grow: 1;
    min-width: 120px;
}

/* Additional columns for complete view */
.col-owner-addr1 { width: 200px; }
.col-owner-addr2 { width: 95px; }
.col-owner-addr3 { width: 95px; }
.col-owner-state { width: 60px; }
.col-owner-country { width: 80px; }
.col-num-owners { width: 90px; text-align: center; }
.col-holder-addr1 { width: 200px; }
.col-holder-addr2 { width: 95px; }
.col-holder-addr3 { width: 95px; }
.col-holder-city { width: 100px; }
.col-holder-state { width: 60px; }
.col-holder-zip { width: 70px; }
.col-cash { width: 140px; text-align: right; }
.col-shares { width: 80px; text-align: right; }
.col-securities { width: 120px; }
.col-pending { width: 80px; text-align: center; }
.col-paid { width: 60px; text-align: center; }
.col-cusip { width: 80px; }

.amount {
    font-weight: 600;
    color: #7c3aed;
}

.col-balance.amount {
    color: #205c49;
}

.claims-indicator {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(1, 74, 51, 0.4);
    font-size: 0.7rem;
    font-weight: 600;
}

.claims-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.4);
}

.claims-paid {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
    border-color: rgba(124, 58, 237, 0.2);
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: #6b7280;
}

.status-bar {
    background: #f9fafb;
    padding: 0.5rem 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-btn {
    padding: 0.3rem 0.8rem;
    border: 1px solid #f3f4f6;
    background: #fafafa;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: #ffffff;
    border-color: #e5e7eb;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn.active {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

#rows-per-page {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    padding: 0.3rem;
    background: #ffffff;
    color: #000000;
}

#rows-per-page option {
    background: #ffffff;
    color: #000000;
}

/* View-specific column hiding */
.view-essential .complete-only { display: none !important; }
.view-complete .complete-only { display: flex !important; }

/* Mobile Responsive Styles */
@media (max-width: 968px) {
    .app {
        padding-top: 70px;
        padding-bottom: 2rem;
    }

    .page-header {
        padding: 2rem 1.5rem 1.5rem 1.5rem;
    }

    .page-title {
        font-size: 2.25rem;
        margin-bottom: 0.65rem;
    }

    .page-description {
        font-size: 1rem;
    }

    .filters-section {
        padding: 1.5rem 1.5rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .filter-group label {
        font-size: 0.85rem;
    }

    .filter-group input, .filter-group select {
        padding: 0.6rem 0.7rem;
        font-size: 0.875rem;
    }

    .filter-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .filter-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
        width: 100%;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
        width: 100%;
    }

    .view-controls {
        width: 100%;
        justify-content: space-between;
    }

    .view-toggle {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
        flex: 1;
    }

    .spreadsheet-container {
        width: calc(100% - 2rem);
        margin: 1.5rem auto;
        border-radius: 8px;
    }

    .table-header {
        font-size: 0.7rem;
    }

    .table-body {
        font-size: 0.7rem;
    }

    .view-complete .table-body {
        font-size: 0.4rem;
    }

    .view-complete .table-header {
        font-size: 0.45rem;
    }

    .table-cell {
        padding: 0.45rem 0.5rem;
        min-height: 2rem;
        font-size: 0.7rem;
    }

    /* Adjusted column widths for mobile */
    .col-id { width: 80px; }
    .col-owner { width: 150px; }
    .col-city { width: 110px; }
    .col-zip { width: 60px; }
    .col-holder { width: 200px; }
    .col-type { width: 150px; }
    .col-balance { width: 60px; min-width: 60px; }

    .status-bar {
        padding: 0.45rem 0.75rem;
        font-size: 0.75rem;
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .pagination-controls {
        gap: 0.4rem;
        flex-wrap: wrap;
    }

    .page-btn {
        padding: 0.3rem 0.65rem;
        font-size: 0.75rem;
    }

    #rows-per-page {
        font-size: 0.75rem;
        padding: 0.25rem;
    }

    .claims-indicator {
        padding: 0.1rem 0.4rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .app {
        padding-top: 60px;
        padding-bottom: 1.5rem;
    }

    .page-header {
        padding: 1.5rem 1rem 1rem 1rem;
    }

    .page-title {
        font-size: 1.875rem;
        margin-bottom: 0.5rem;
    }

    .page-description {
        font-size: 0.925rem;
    }

    .filters-section {
        padding: 1.25rem 1rem;
    }

    .filters-grid {
        gap: 0.875rem;
        margin-bottom: 1rem;
    }

    .filter-group label {
        font-size: 0.8rem;
    }

    .filter-group input, .filter-group select {
        padding: 0.55rem 0.65rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    .btn {
        padding: 0.55rem 0.875rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    .view-toggle {
        padding: 0.55rem 0.875rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    .spreadsheet-container {
        width: calc(100% - 1.5rem);
        margin: 1.25rem auto;
        border-radius: 6px;
    }

    .table-header {
        font-size: 0.65rem;
    }

    .table-body {
        font-size: 0.65rem;
    }

    .view-complete .table-body {
        font-size: 0.38rem;
    }

    .view-complete .table-header {
        font-size: 0.42rem;
    }

    .table-cell {
        padding: 0.4rem 0.45rem;
        min-height: 1.875rem;
        font-size: 0.65rem;
    }

    /* Further reduced column widths for small mobile */
    .col-id { width: 70px; }
    .col-owner { width: 130px; }
    .col-city { width: 100px; }
    .col-zip { width: 55px; }
    .col-holder { width: 180px; }
    .col-type { width: 130px; }
    .col-balance { width: 55px; min-width: 55px; }

    .status-bar {
        padding: 0.4rem 0.65rem;
        font-size: 0.7rem;
    }

    .pagination-controls {
        gap: 0.35rem;
    }

    .page-btn {
        padding: 0.25rem 0.55rem;
        font-size: 0.7rem;
        border-radius: 4px;
    }

    #rows-per-page {
        font-size: 0.7rem;
        padding: 0.2rem;
        border-radius: 4px;
    }

    .claims-indicator {
        padding: 0.1rem 0.35rem;
        font-size: 0.6rem;
        border-radius: 3px;
    }

    .amount {
        font-size: 0.65rem;
    }
}

/* Save button styles */
.col-save {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    justify-content: center;
}

.save-btn {
    width: 24px;
    height: 24px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.save-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.3);
}

.save-btn.saved {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.3);
}

.save-btn svg {
    width: 14px;
    height: 14px;
    stroke: rgba(0, 0, 0, 0.7);
    stroke-width: 2;
    fill: none;
}

.save-btn.saved svg {
    fill: #000000;
    stroke: #000000;
}
