:root {
    --primary: #1379f0;
    --black: #333;
    --white: #fff;
    --grey-50: #f9f9f9;
    --grey-100: #f4f4f4;
    --grey-700: #676a72;
    --grey-500: #bcbfc5;
    --grey-600: #8e9198;
    --grey-800: #393b40;
    --grey-900: #2c2d30;
    --grey-300: #dcddde;
    --grey-200: #eeeeee;
    --light-active: #fafafa;
}

.card-main {
    position: relative;
    background-color: var(--white);
    height: 100%;
    width: 100%;
    padding: 16px 38px 8px 42px;
}

.page-title {
    font-weight: 600;
    font-size: 20px !important;
    leading-trim: NONE;
    line-height: 20px;
    letter-spacing: 0%;
    color: var(--black);
}
.page-subtitle {
    font-weight: 400;
    font-size: 14px !important;
    leading-trim: NONE;
    line-height: 14px;
    letter-spacing: 0%;
    color: var(--grey-700);
}
.date-filter {
    height: 34px;
    border: 1px solid var(--grey-300);
    border-radius: 6px;
    padding: 7px 12px;
    padding-bottom: 9px;
    font-weight: 400;
    font-size: 13px !important;
    leading-trim: NONE;
    line-height: 14px;
    letter-spacing: 0%;
    color: var(--grey-800);
    cursor: pointer;
}
.btn-export {
    height: 34px !important;
    border: 1px solid var(--grey-300);
    border-radius: 6px;
    padding: 7px 12px;
    padding-bottom: 9px;
    font-weight: 400;
    font-size: 13px !important;
    leading-trim: NONE;
    line-height: 14px;
    letter-spacing: 0%;
    color: var(--grey-900);
}
.other-actions {
    height: 34px;
    border: 1px solid var(--grey-300);
    border-radius: 6px;
    padding: 7px 12px;
    padding-bottom: 9px;
    font-weight: 400;
    font-size: 13px !important;
    leading-trim: NONE;
    line-height: 14px;
    letter-spacing: 0%;
    color: var(--grey-800);
    cursor: pointer;
}
.btn-primary-action {
    background: var(--primary);
    border: none;
    color: var(--white);
    font-weight: 600;
    border-radius: 6px;
    padding: 7px 12px !important;
    padding-bottom: 9px !important;
    height: 34px !important;
    transition: background 0.15s;
    font-weight: 500;
    font-style: Medium;
    font-size: 12px !important;
    leading-trim: NONE;
    line-height: 12px;
    letter-spacing: 0%;
}
.btn-primary-action:hover {
    background: #1d4ed8;
    color: var(--white);
}
/* -- card content ──────────────────────────────────────────────────── */
.card-content {
    box-shadow: 0px 4px 5px 0px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    background-color: var(--white);
}
/* ── card header ────────────────────────────────────── */
.card-header-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 10px;
    height: 66px;
    background: var(--white);
}
/* Tab nav */
.card-header-custom .tab-nav {
    display: flex;
    gap: 4px;
    height: 100%;
}
.card-header-custom .tab-nav .tab-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    color: var(--grey-800);
    cursor: pointer;
    text-decoration: none;
    transition:
        border-bottom 0.15s,
        color 0.15s;
    font-weight: 500;
    font-size: 14px;
    leading-trim: NONE;
    line-height: 14px;
    letter-spacing: 0%;
    height: 100%;
}
.card-header-custom .tab-nav .tab-item:hover {
    color: var(--primary);
}
.card-header-custom .tab-nav .tab-item.active {
    border-bottom: 1px solid var(--primary);
    color: var(--primary);
}
.card-header-custom .tab-nav .tab-badge {
    border: 1px solid var(--grey-200);
    background-color: var(--grey-50);
    color: var(--grey-800);
    padding: 4px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 10px;
    leading-trim: NONE;
    line-height: 10px;
    letter-spacing: -3%;
}
.card-header-custom .tab-nav .tab-item.active .tab-badge,
.card-header-custom .tab-nav .tab-item:hover .tab-badge {
    background: rgba(231, 242, 255, 1);
    color: var(--primary);
    border: 1px solid rgba(19, 121, 240, 0.2);
}
/* Search + filter */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-controls .search-wrapper {
    position: relative;
}
.header-controls .search-wrapper svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}
.header-controls .search-input {
    border: 1px solid var(--grey-300);
    border-radius: 8px;
    padding: 10px 12px 10px 30px;
    width: 200px;
    height: 34px;
    outline: none;
    transition: border-color 0.15s;
    font-weight: 400;
    font-size: 13px;
    leading-trim: NONE;
    line-height: 14px;
    letter-spacing: 0%;
    color: var(--grey-800);
}
.header-controls .search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.header-controls .search-input::placeholder {
    color: var(--grey-600);
}
.header-controls .btn-filter {
    border: 1px solid var(--grey-300);
    background: var(--white);
    border-radius: 8px;
    padding: 6px 13px;
    color: var(--grey-800);
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    cursor: pointer;
    transition: background 0.15s;
    font-weight: 500;
    font-size: 12px;
    leading-trim: NONE;
    line-height: 12px;
    letter-spacing: 0%;
}
.header-controls .btn-filter:hover {
    background: var(--grey-200);
}
/* table section */
.main-table {
    margin-bottom: 0;
    font-size: 13px;
    width: 100%;
    border-collapse: collapse;
}
.main-table thead th {
    background: var(--light-active);
    border: 1px solid var(--grey-200);
    color: var(--grey-700);
    font-weight: 500;
    font-size: 13px !important;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    border-top: none;
    vertical-align: middle;
    white-space: nowrap;
}
.main-table thead th.sortable {
    cursor: pointer;
}
.main-table thead th .sort-icon {
    margin-left: 4px;
    margin-bottom: 2px;
}
.main-table thead th svg.sort-icon path {
    fill: var(--grey-600);
    transition: fill 0.15s;
}
.main-table thead th.asc path:first-child {
    fill: var(--blue-100);
}
.main-table thead th.asc svg.sort-icon path:last-child {
    fill: var(--grey-600);
}
.main-table thead th.desc svg.sort-icon path:first-child {
    fill: var(--grey-600);
}
.main-table thead th.desc svg.sort-icon path:last-child {
    fill: var(--blue-100);
}
.main-table th .checkbox-input,
.main-table td .checkbox-input {
    width: 15px;
    height: 15px;
    cursor: pointer;
}
.main-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--grey-200);
    color: var(--grey-900);
    vertical-align: middle;
    font-weight: 400;
    font-size: 13px !important;
    leading-trim: NONE;
    line-height: 14px;
    letter-spacing: 0%;
}
.main-table tbody tr:last-child td {
    border-bottom: none;
}
.main-table tbody tr:hover td {
    background: #fafafa;
}
.doc-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}
.doc-link:hover {
    text-decoration: underline;
}
/* ── Table footer ───────────────────────────────────── */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--grey-200);
}
.table-footer .per-page-control {
    display: flex;
    align-items: center;
    gap: 8px;
}
body .table-footer .per-page-control span {
    color: var(--grey-600);
    font-weight: 500;
    font-size: 13px !important;
    leading-trim: NONE;
    line-height: 14px;
    letter-spacing: -1%;
}
.table-footer .per-page-select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 3px 8px;
    font-weight: 400;
    font-size: 11px;
    leading-trim: NONE;
    line-height: 12px;
    letter-spacing: 0%;
}
.table-footer .pagination-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.table-footer .pagination-info {
    white-space: nowrap;
    font-weight: 500;
    font-size: 13px;
    leading-trim: NONE;
    line-height: 14px;
    letter-spacing: -1%;
    color: var(--grey-600);
}
/* user badge */
.main-table tbody td .user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--white);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 11px !important;
    font-weight: 500;
    color: var(--grey-900);
    border: 1px solid var(--grey-300);
    height: 28px;
}
.main-table tbody td .user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
}
.main-table tbody td .avatar-blue {
    background: #3b82f6;
}
.main-table tbody td .avatar-orange {
    background: #f97316;
}
.main-table tbody td .avatar-green {
    background: #22c55e;
}
.main-table tbody td .avatar-purple {
    background: #8b5cf6;
}
.main-table tbody td .avatar-red {
    background: #ef4444;
}
.main-table tbody td .avatar-gray {
    background: #6b7280;
}
.main-table tbody td .avatar-teal {
    background: #14b8a6;
}
.main-table tbody td .avatar-pink {
    background: #ec4899;
}

/* Action buttons */
.main-table tbody td .action-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}
.main-table tbody td .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.main-table tbody td .btn-action:hover {
    background: #f3f4f6;
}
.main-table tbody td .btn-action svg {
    display: block;
}
.main-table tbody td .btn-action svg path {
    transition: fill 0.15s;
}
/* ── Skeleton loading ───────────────────────────────── */
@keyframes shimmer {
    0% {
        background-position: -600px 0;
    }
    100% {
        background-position: 600px 0;
    }
}
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
    background-size: 600px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: 6px;
    display: inline-block;
}
.sk-text {
    height: 13px;
}
.sk-badge {
    height: 24px;
    border-radius: 20px;
}
.sk-check {
    height: 15px;
    width: 15px;
    border-radius: 3px;
}
/* ── Empty state ────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #9ca3af;
}
.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
    color: #d1d5db;
}
.empty-state p {
    font-size: 0.85rem;
    margin: 0;
}
/* ── Error state ────────────────────────────────────── */
.error-state {
    text-align: center;
    padding: 48px 20px;
}
.error-state i {
    font-size: 2.2rem;
    color: #f87171;
    margin-bottom: 12px;
    display: block;
}
.error-state p {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 16px;
}
.btn-retry {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-retry:hover {
    background: #f3f4f6;
}
/* ── twbsPagination overrides ───────────────────────── */
#pagination-container {
    margin: 0;
}
#pagination-container.pagination {
    margin: 0;
    gap: 0;
    align-items: center;
}
body #pagination-container.pagination li {
    padding: 10px 0;
    margin-bottom: 0;
}
/* Nomor halaman biasa */
body #pagination-container.pagination li a,
body #pagination-container.pagination li span {
    border-radius: 6px !important;
    border: 1px solid transparent !important;
    min-width: 26px;
    height: 26px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    transition: all 0.15s;
    text-decoration: none;
    background: transparent !important;
    font-weight: 400;
    font-size: 14px !important;
    leading-trim: NONE;
    line-height: 14px;
    letter-spacing: 0%;
    text-align: center;
    color: var(--grey-700);
}
#pagination-container.pagination li a:hover {
    background: var(--grey-100) !important;
    color: var(--grey-900);
}
/* Halaman aktif — abu-abu muda, teks gelap */
#pagination-container.pagination li.active a,
#pagination-container.pagination li.active span {
    background: var(--grey-100) !important;
    border-color: transparent !important;
    color: var(--grey-900) !important;
    font-weight: 600;
}

/* Tombol prev & next — lingkaran dengan border */
#pagination-container.pagination li:first-child a,
#pagination-container.pagination li:first-child span,
#pagination-container.pagination li:last-child a,
#pagination-container.pagination li:last-child span {
    background: #fff !important;
    width: 26px;
    min-width: 26px;
    height: 26px;
}
#pagination-container.pagination li:first-child a svg path,
#pagination-container.pagination li:last-child a svg path {
    fill: var(--grey-700);
}
#pagination-container.pagination li:first-child a:hover,
#pagination-container.pagination li:last-child a:hover {
    background: var(--grey-100) !important;
}

/* Disabled prev/next */
#pagination-container.pagination li.disabled a svg path {
    fill: var(--grey-500);
}
