/* ============================================================
   HAU Batu Karas — Sales Report Analyzer
   Stylesheet
   ============================================================ */

/* ===== BASE ===== */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f1f5f9;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== UTILITY ===== */
.hidden { display: none !important; }

/* ===== TABS ===== */
.tab-btn {
    padding: 8px 18px;
    border-bottom: 2px solid transparent;
    font-size: 13.5px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.tab-btn:hover {
    color: #1e40af;
    background: #eff6ff;
    border-radius: 6px 6px 0 0;
}
.tab-btn.active {
    color: #1e40af;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

/* ===== EXCEL TABLE ===== */
.excel-wrap {
    overflow: auto;
    flex: 1;
}
.excel-table {
    border-collapse: collapse;
    font-size: 12.5px;
    min-width: max-content;
    width: 100%;
}

/* Table header */
.excel-table thead th {
    background: #c6d0e2;
    border: 1px solid #94a3b8;
    padding: 8px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 10;
}
.excel-table thead th:hover { background: #b0bed6; }
.excel-table thead th.sort-asc::after  { content: ' ▲'; font-size: 9px; color: #1d4ed8; }
.excel-table thead th.sort-desc::after { content: ' ▼'; font-size: 9px; color: #1d4ed8; }
.excel-table thead th.sorted { background: #a8b9d0; }

/* Table body */
.excel-table tbody td {
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    color: #1f2937;
    white-space: nowrap;
}
.excel-table tbody tr:nth-child(even) td { background: #f8fafc; }
.excel-table tbody tr:nth-child(odd)  td { background: #ffffff; }
.excel-table tbody tr:hover td { background: #dbeafe !important; }

/* Row number column */
.excel-table .rn {
    background: #e8ecf4 !important;
    color: #94a3b8;
    text-align: center !important;
    font-size: 11px;
    border-right: 2px solid #94a3b8 !important;
    min-width: 44px;
    position: sticky;
    left: 0;
    z-index: 5;
}
.excel-table thead th.rn {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 20;
    cursor: default;
    text-align: center;
}
.excel-table tbody tr:hover .rn { background: #bfdbfe !important; }

/* Total (footer) row */
.excel-table tfoot td {
    border: 1px solid #d1d5db;
    padding: 7px 14px;
    background: #fefce8 !important;
    font-weight: 700;
    border-top: 2px solid #ca8a04 !important;
    color: #1c1917;
    white-space: nowrap;
}
.excel-table tfoot td.rn { background: #fef9c3 !important; }
.excel-table tfoot {
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Column alignment helpers */
.col-right  { text-align: right !important; }
.col-center { text-align: center !important; }
.col-mono   { font-variant-numeric: tabular-nums; }

/* ===== SOURCE BADGES ===== */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
}

/* ===== PAGINATION ===== */
.pg-btn {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.1s;
    padding: 0 8px;
}
.pg-btn:hover:not(:disabled) {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}
.pg-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    font-weight: 600;
}
.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== PRINT ===== */
@media print {
    body { background: white; }
    #upload-screen, .no-print { display: none !important; }
    #main-screen { display: block !important; }
    #panel-dashboard { display: none !important; }
    #panel-table { display: block !important; padding: 0 !important; }
    #table-controls { display: none !important; }
    #pagination-bar { display: none !important; }
    .excel-wrap { overflow: visible; }
    .excel-table { font-size: 10px; }
    .excel-table thead th,
    .excel-table tbody td,
    .excel-table tfoot  td { padding: 3px 6px; font-size: 10px; }
}
