/* ============================================================
   Valunxt Index - Dashboard Styles
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d23;
    --sidebar-hover: #2d3139;
}

/* ---------- Global ---------- */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f0f2f5;
    font-size: 0.875rem;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-nav .nav-link {
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--sidebar-hover);
}

.sidebar-nav .nav-link.active {
    background-color: rgba(13, 110, 253, 0.15);
    color: #6ea8fe !important;
}

.sidebar-nav .disabled-link {
    opacity: 0.5;
    pointer-events: none;
}

.sidebar-footer {
    margin-top: auto;
}

/* ---------- Content wrapper ---------- */
#page-content-wrapper {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

/* Sidebar collapsed state */
.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

.sidebar-collapsed #page-content-wrapper {
    margin-left: 0;
}

/* ---------- Stat cards ---------- */
.stat-card {
    border-radius: 0.5rem;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

.stat-card .card-body {
    padding: 1.1rem 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* ---------- Table ---------- */
#data-table {
    font-size: 0.8125rem;
}

#data-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.6rem 0.5rem;
}

#data-table thead th:hover {
    background-color: #2c3034;
}

#data-table thead th .sort-icon {
    opacity: 0.4;
    font-size: 0.7rem;
    margin-left: 4px;
}

#data-table thead th.sorted .sort-icon {
    opacity: 1;
}

#data-table tbody td {
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    padding: 0.45rem 0.5rem;
}

#data-table tbody tr {
    transition: background-color 0.1s ease;
}

.table-responsive {
    max-height: calc(100vh - 420px);
    overflow-y: auto;
}

/* ---------- Link column (for listing URLs) ---------- */
.link-cell a {
    font-size: 0.8rem;
    text-decoration: none;
}

.link-cell a:hover {
    text-decoration: underline;
}

/* ---------- Pagination ---------- */
#pagination-nav .pagination {
    margin-bottom: 0;
}

#pagination-nav .page-link {
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem;
}

/* ---------- Filter panel ---------- */
#filter-panel .card-header {
    padding: 0.6rem 1rem;
}

#filter-panel .form-label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* ---------- Upload modal ---------- */
.progress {
    border-radius: 1rem;
}

.progress-bar {
    border-radius: 1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    #page-content-wrapper {
        margin-left: 0;
    }

    .table-responsive {
        max-height: calc(100vh - 480px);
    }

    #stats-cards .col-xl-3 {
        flex: 0 0 50%;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 1rem !important;
    }

    .stat-card h4 {
        font-size: 1.1rem;
    }
}

/* ---------- Utility ---------- */
.currency {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.number {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.text-truncate-cell {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
