/* ================================================================
   PROJECTKART — ADMIN TABLES
   Premium dark data-table system
================================================================ */

.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-border, #1b2430);
    border-radius: 16px;
    background: var(--color-surface, #0d1118);
    scrollbar-width: thin;
    scrollbar-color: #293442 transparent;
}

.admin-table-wrapper::-webkit-scrollbar {
    height: 7px;
}

.admin-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.admin-table-wrapper::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #293442;
}

.admin-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    color: #dbe2eb;
    font-size: 13px;
}

/* ------------------------------------------------
   TABLE HEADER
------------------------------------------------ */

.admin-table thead th {
    height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid #202a36;
    background: #0b1017;
    color: #7d8999;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.045em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-table thead th:first-child {
    padding-left: 20px;
}

.admin-table thead th:last-child {
    padding-right: 20px;
}

/* ------------------------------------------------
   TABLE BODY
------------------------------------------------ */

.admin-table tbody td {
    height: 64px;
    padding: 10px 16px;
    border-bottom: 1px solid #18212c;
    background: #0d1118;
    vertical-align: middle;
    white-space: nowrap;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr {
    transition: background-color 150ms ease;
}

.admin-table tbody tr:hover td {
    background: #10161f;
}

.admin-table tbody td:first-child {
    padding-left: 20px;
}

.admin-table tbody td:last-child {
    padding-right: 20px;
}

/* ------------------------------------------------
   CHECKBOX COLUMN
------------------------------------------------ */

.admin-table__check {
    width: 46px;
    text-align: center;
}

.admin-table__check .admin-checkbox {
    justify-content: center;
}

/* ------------------------------------------------
   SORTABLE HEADER
------------------------------------------------ */

.admin-table__sortable {
    cursor: pointer;
    user-select: none;
}

.admin-table__sortable-content {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.admin-table__sort-icon {
    display: inline-flex;
    width: 13px;
    height: 13px;
    color: #566273;
    transition: color 150ms ease;
}

.admin-table__sortable:hover {
    color: #b8c2cf;
}

.admin-table__sortable:hover .admin-table__sort-icon {
    color: #8492a5;
}

.admin-table__sortable.is-active {
    color: #d7e0eb;
}

.admin-table__sortable.is-active .admin-table__sort-icon {
    color: #4c8fff;
}

/* ------------------------------------------------
   PRODUCT CELL
------------------------------------------------ */

.admin-table-product {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.admin-table-product__image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    overflow: hidden;
    border: 1px solid #202b38;
    border-radius: 9px;
    background: #090d13;
}

.admin-table-product__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-table-product__image--placeholder {
    color: #566477;
}

.admin-table-product__content {
    min-width: 0;
}

.admin-table-product__name {
    overflow: hidden;
    color: #e5ebf2;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-table-product__meta {
    margin-top: 3px;
    overflow: hidden;
    color: #697688;
    font-size: 11px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------------------------
   CATEGORY CELL
------------------------------------------------ */

.admin-table-category {
    color: #8b97a7;
    font-size: 12px;
}

/* ------------------------------------------------
   PRICE
------------------------------------------------ */

.admin-table-price {
    color: #e7edf5;
    font-size: 13px;
    font-weight: 650;
}

.admin-table-old-price {
    margin-left: 5px;
    color: #596575;
    font-size: 11px;
    text-decoration: line-through;
}

/* ------------------------------------------------
   STOCK
------------------------------------------------ */

.admin-stock {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.admin-stock__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #758092;
}

.admin-stock--in .admin-stock__dot {
    background: #48c98b;
    box-shadow: 0 0 8px rgba(72, 201, 139, 0.35);
}

.admin-stock--low .admin-stock__dot {
    background: #e5b95c;
    box-shadow: 0 0 8px rgba(229, 185, 92, 0.3);
}

.admin-stock--out .admin-stock__dot {
    background: #ef6868;
    box-shadow: 0 0 8px rgba(239, 104, 104, 0.3);
}

.admin-stock__text {
    color: #a5afbc;
    font-size: 12px;
}

/* ------------------------------------------------
   STATUS BADGES
------------------------------------------------ */

.admin-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 25px;
    padding: 0 9px;
    border: 1px solid #27313e;
    border-radius: 999px;
    background: #111720;
    color: #8d99aa;
    font-size: 11px;
    font-weight: 600;
}

.admin-status__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.admin-status--active {
    border-color: rgba(63, 190, 126, 0.18);
    background: rgba(63, 190, 126, 0.07);
    color: #54cb91;
}

.admin-status--inactive {
    color: #778394;
}

.admin-status--pending {
    border-color: rgba(229, 185, 92, 0.18);
    background: rgba(229, 185, 92, 0.06);
    color: #dcb55e;
}

.admin-status--danger {
    border-color: rgba(239, 104, 104, 0.18);
    background: rgba(239, 104, 104, 0.06);
    color: #ef7474;
}

.admin-status--blue {
    border-color: rgba(40, 120, 255, 0.18);
    background: rgba(40, 120, 255, 0.07);
    color: #619cff;
}

/* ------------------------------------------------
   BADGE / LABEL
------------------------------------------------ */

.admin-table-badge {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 0 8px;
    border: 1px solid rgba(40, 120, 255, 0.18);
    border-radius: 6px;
    background: rgba(40, 120, 255, 0.06);
    color: #619cff;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

/* ------------------------------------------------
   ACTIONS
------------------------------------------------ */

.admin-table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.admin-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #738093;
    cursor: pointer;
    transition:
        color 150ms ease,
        background-color 150ms ease,
        border-color 150ms ease;
}

.admin-table-action:hover {
    border-color: #25303d;
    background: #151c25;
    color: #e4eaf1;
}

.admin-table-action--edit:hover {
    border-color: rgba(40, 120, 255, 0.18);
    background: rgba(40, 120, 255, 0.08);
    color: #5d9aff;
}

.admin-table-action--danger:hover {
    border-color: rgba(239, 104, 104, 0.18);
    background: rgba(239, 104, 104, 0.08);
    color: #ef7474;
}

/* ------------------------------------------------
   MORE MENU
------------------------------------------------ */

.admin-table-menu {
    position: relative;
}

.admin-table-menu__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #758194;
    cursor: pointer;
    transition:
        color 150ms ease,
        background-color 150ms ease,
        border-color 150ms ease;
}

.admin-table-menu__button:hover,
.admin-table-menu.is-open .admin-table-menu__button {
    border-color: #26313e;
    background: #151c25;
    color: #e2e8ef;
}

.admin-table-menu__dropdown {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 50;
    display: none;
    width: 170px;
    padding: 5px;
    border: 1px solid #27313e;
    border-radius: 11px;
    background: #10161e;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.38),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.admin-table-menu.is-open .admin-table-menu__dropdown {
    display: block;
}

.admin-table-menu__item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 34px;
    gap: 9px;
    padding: 0 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #aeb8c6;
    font-family: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    transition:
        background-color 140ms ease,
        color 140ms ease;
}

.admin-table-menu__item:hover {
    background: #18212c;
    color: #ffffff;
}

.admin-table-menu__item--danger:hover {
    background: rgba(239, 104, 104, 0.08);
    color: #ef7777;
}

.admin-table-menu__divider {
    height: 1px;
    margin: 5px 3px;
    background: #202a35;
}

/* ------------------------------------------------
   EMPTY STATE
------------------------------------------------ */

.admin-table-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 270px;
    padding: 40px 20px;
    text-align: center;
}

.admin-table-empty__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
    border: 1px solid #232e3b;
    border-radius: 13px;
    background: #111720;
    color: #5c6a7d;
}

.admin-table-empty__title {
    margin: 0 0 6px;
    color: #dce3eb;
    font-size: 14px;
    font-weight: 650;
}

.admin-table-empty__text {
    max-width: 360px;
    margin: 0;
    color: #6e7b8c;
    font-size: 12px;
    line-height: 1.55;
}

/* ------------------------------------------------
   PAGINATION
------------------------------------------------ */

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 18px;
    border: 1px solid #1b2430;
    border-top: 0;
    border-radius: 0 0 16px 16px;
    background: #0d1118;
}

.admin-pagination__info {
    color: #687587;
    font-size: 12px;
}

.admin-pagination__info strong {
    color: #b9c3cf;
    font-weight: 600;
}

.admin-pagination__controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.admin-pagination__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border: 1px solid #222c38;
    border-radius: 8px;
    background: #10161e;
    color: #8591a2;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    transition:
        color 150ms ease,
        border-color 150ms ease,
        background-color 150ms ease;
}

.admin-pagination__button:hover:not(:disabled) {
    border-color: #354253;
    background: #151c25;
    color: #e3e9f0;
}

.admin-pagination__button.is-active {
    border-color: rgba(40, 120, 255, 0.4);
    background: rgba(40, 120, 255, 0.12);
    color: #65a0ff;
}

.admin-pagination__button:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

/* ------------------------------------------------
   SKELETON ROWS
------------------------------------------------ */

.admin-table-skeleton {
    display: inline-block;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(
        90deg,
        #141b24 0%,
        #1c2530 50%,
        #141b24 100%
    );
    background-size: 200% 100%;
    animation: adminTableSkeleton 1.5s ease-in-out infinite;
}

.admin-table-skeleton--short {
    width: 55%;
}

.admin-table-skeleton--medium {
    width: 75%;
}

@keyframes adminTableSkeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ------------------------------------------------
   RESPONSIVE
------------------------------------------------ */

@media (max-width: 760px) {
    .admin-pagination {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .admin-pagination__controls {
        width: 100%;
        overflow-x: auto;
    }
}

@media (max-width: 520px) {
    .admin-table-wrapper {
        border-radius: 13px;
    }

    .admin-table {
        min-width: 680px;
    }

    .admin-table thead th {
        height: 44px;
        padding: 0 12px;
    }

    .admin-table tbody td {
        height: 58px;
        padding: 8px 12px;
    }

    .admin-table thead th:first-child,
    .admin-table tbody td:first-child {
        padding-left: 14px;
    }

    .admin-table thead th:last-child,
    .admin-table tbody td:last-child {
        padding-right: 14px;
    }
}