/* ---------- Base ---------- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #f4f6f9;
    color: #222;
}

.page-header {
    background: #ffffff;
    padding: 18px 28px;
    border-bottom: 1px solid #e5e7eb;
}

.page-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---------- Upload ---------- */
.upload-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    border: 1px dashed #cbd5e1;
}

.drop-zone {
    text-align: center;
    padding: 28px;
    border-radius: 6px;
    cursor: pointer;
    background: #f8fafc;
}

.drop-zone.dragover {
    background: #e0f2fe;
}

.browse-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #2563eb;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.upload-status {
    margin-top: 10px;
    font-size: 14px;
    color: #065f46;
}

/* ---------- Controls ---------- */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-controls input {
    padding: 8px 10px;
    width: 260px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.table-controls button {
    padding: 8px 14px;
    margin-left: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #0f172a;
    color: #fff;
}

#resultCount {
    margin-left: 12px;
    font-size: 14px;
    color: #475569;
}

/* ---------- Table ---------- */

#tableSection {
    max-height: 100%;
    overflow: auto;
}

.table-wrapper {
    background: #fff;
    border-radius: 8px;
    overflow: auto;
    border: 1px solid #e5e7eb;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1400px;
}

thead th {
    position: sticky;
    top: 0;
    background: #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

thead th .resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
}

tbody td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    white-space: nowrap;
}

tbody tr:hover {
    background: #f8fafc;
}

.empty-row td {
    text-align: center;
    color: #64748b;
    padding: 20px;
}

/* ---------- Fullscreen ---------- */
.fullscreen {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 999;
    padding: 20px;
}


mark {
    background: #ffe58f;
    padding: 2px 4px;
    border-radius: 4px;
}

.table-wrapper.fullscreen {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
    padding: 16px;
    overflow: auto;
}

.pagination {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin: 16px 0;
}

.pagination button {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}



.column-header {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.column-header span {
    display: inline-block;
    padding-right: 8px;
}



/* dropdown */
.column-header {
    position: relative;
    white-space: nowrap;
}

.menu-btn {
    margin-left: 6px;
    cursor: pointer;
    font-weight: bold;
}

.column-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    min-width: 190px;
    z-index: 999;
}

.column-menu div {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}

.column-menu div:hover {
    background: #f1f5f9;
}

.hidden {
    display: none;
}



.pinned {
    left: 0;
    background: #fff;
    z-index: 1;
}
