/* =========================================================
   AYSELL GALLERY
   ADMIN REVIEWS
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #8b5cf6;
    --primary-dark: #7044d4;

    --bg: #f7f7fb;
    --card: #ffffff;

    --text: #1f2937;
    --muted: #8a8f9c;

    --border: #ececf2;

    --green: #16a34a;
    --green-bg: #ecfdf3;

    --orange: #d97706;
    --orange-bg: #fff7ed;

    --red: #dc2626;
    --red-bg: #fef2f2;

    --sidebar: #17151d;
    --sidebar-text: #aaa6b6;
}

html,
body {
    min-height: 100%;
}

body {
    font-family:
        Tahoma,
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);

    line-height: 1.7;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}


/* =========================================================
   LAYOUT
========================================================= */

.admin-layout {
    min-height: 100vh;
    display: flex;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    width: 260px;
    min-width: 260px;

    background: var(--sidebar);
    color: #fff;

    min-height: 100vh;

    display: flex;
    flex-direction: column;

    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;

    z-index: 1100;

    transition:
        transform 0.25s ease,
        visibility 0.25s ease;
}

.sidebar-header {
    padding: 26px 20px;

    display: flex;
    align-items: center;
    gap: 12px;

    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.logo-mark {
    width: 44px;
    height: 44px;

    border-radius: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(
        135deg,
        #a78bfa,
        #7c3aed
    );

    font-size: 21px;
    font-weight: 900;
}

.sidebar-header h2 {
    font-size: 17px;
    margin-bottom: 2px;
}

.sidebar-header span {
    font-size: 11px;
    color: var(--sidebar-text);
}

.sidebar-nav {
    padding: 20px 12px;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 15px;
    margin-bottom: 6px;

    color: var(--sidebar-text);
    text-decoration: none;

    border-radius: 11px;

    transition: 0.2s ease;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(139,92,246,0.17);
    color: #fff;
}

.nav-icon {
    width: 24px;
    text-align: center;
    font-size: 17px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.logout-btn {
    width: 100%;

    border: 0;
    background: transparent;

    color: #b6b1bd;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 15px;

    border-radius: 10px;

    font-size: 14px;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}


/* =========================================================
   MAIN
========================================================= */

.main-content {
    width: calc(100% - 260px);
    margin-right: 260px;

    min-height: 100vh;

    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;

    gap: 18px;

    margin-bottom: 26px;
}

.page-title {
    flex: 1;
}

.page-title h1 {
    font-size: 25px;
    margin-bottom: 3px;
}

.page-title p {
    color: var(--muted);
    font-size: 13px;
}

.menu-toggle {
    display: none;

    border: 0;
    background: #fff;

    width: 43px;
    height: 43px;

    border-radius: 11px;

    font-size: 21px;

    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.refresh-btn {
    border: 1px solid var(--border);
    background: #fff;

    padding: 10px 15px;

    border-radius: 10px;

    color: #555;

    display: flex;
    align-items: center;
    gap: 7px;

    transition: 0.2s;
}

.refresh-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}


/* =========================================================
   STATS
========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;

    margin-bottom: 22px;
}

.stat-card {
    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 16px;

    padding: 20px;

    display: flex;
    align-items: center;

    gap: 14px;
}

.stat-icon {
    width: 48px;
    height: 48px;

    border-radius: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 21px;
    font-weight: bold;
}

.stat-icon.total {
    background: #f3eefe;
    color: var(--primary);
}

.stat-icon.pending {
    background: var(--orange-bg);
    color: var(--orange);
}

.stat-icon.approved {
    background: var(--green-bg);
    color: var(--green);
}

.stat-icon.rejected {
    background: var(--red-bg);
    color: var(--red);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.stat-card strong {
    display: block;
    font-size: 23px;
    margin-top: 2px;
}


/* =========================================================
   CONTENT
========================================================= */

.content-card {
    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 18px;

    overflow: hidden;
}

.content-header {
    padding: 21px 22px 15px;

    display: flex;
    align-items: center;
}

.content-header h2 {
    font-size: 18px;
}

.content-header p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}


/* =========================================================
   FILTERS
========================================================= */

.filters {
    padding: 0 22px 20px;

    display: flex;
    align-items: center;

    gap: 10px;
}

.search-box {
    flex: 1;

    min-width: 180px;

    border: 1px solid var(--border);

    border-radius: 11px;

    display: flex;
    align-items: center;

    padding: 0 13px;

    background: #fff;
}

.search-box span {
    color: #aaa;
    font-size: 21px;
}

.search-box input {
    width: 100%;

    border: 0;
    outline: 0;

    padding: 11px;

    background: transparent;

    color: var(--text);

    font-size: 13px;
}

.filters select {
    min-width: 160px;

    padding: 11px 13px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: #fff;

    color: #555;

    outline: 0;
}

.clear-filter-btn {
    border: 1px solid var(--border);
    background: #fff;

    color: #666;

    padding: 10px 14px;

    border-radius: 10px;

    white-space: nowrap;
}

.clear-filter-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}


/* =========================================================
   TABLE
========================================================= */

.table-wrapper {
    overflow-x: auto;
}

.reviews-table {
    width: 100%;
    border-collapse: collapse;

    min-width: 900px;
}

.reviews-table th {
    text-align: right;

    padding: 13px 17px;

    background: #fafafd;

    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);

    color: #777;

    font-size: 12px;
    font-weight: 600;
}

.reviews-table td {
    padding: 15px 17px;

    border-bottom: 1px solid var(--border);

    font-size: 13px;

    vertical-align: middle;
}

.reviews-table tbody tr:hover {
    background: #fcfbff;
}

.customer-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-avatar {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    background: #f0eafe;
    color: var(--primary);

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: bold;
}

.customer-name {
    font-weight: 600;
}

.product-name {
    max-width: 180px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rating {
    direction: ltr;
    color: #f59e0b;

    white-space: nowrap;

    letter-spacing: 1px;
}

.rating-number {
    color: #777;
    font-size: 11px;
    margin-right: 5px;
}

.review-preview {
    max-width: 230px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #666;
}

.status-badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border-radius: 20px;

    font-size: 11px;

    white-space: nowrap;
}

.status-badge.pending {
    color: var(--orange);
    background: var(--orange-bg);
}

.status-badge.approved {
    color: var(--green);
    background: var(--green-bg);
}

.status-badge.rejected {
    color: var(--red);
    background: var(--red-bg);
}

.date-cell {
    color: #888;
    white-space: nowrap;
    font-size: 11px;
}


/* =========================================================
   ACTIONS
========================================================= */

.actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn {
    width: 34px;
    height: 34px;

    border-radius: 9px;

    border: 1px solid var(--border);

    background: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 15px;

    transition: 0.2s;
}

.action-btn.view:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.action-btn.approve:hover {
    color: var(--green);
    border-color: var(--green);
}

.action-btn.reject:hover {
    color: var(--red);
    border-color: var(--red);
}

.action-btn.delete:hover {
    color: var(--red);
    border-color: var(--red);
}


/* =========================================================
   LOADING / EMPTY / ERROR
========================================================= */

.loading-state,
.empty-state,
.error-state {
    padding: 65px 20px;

    text-align: center;
}

.spinner {
    width: 38px;
    height: 38px;

    border: 3px solid #eee;
    border-top-color: var(--primary);

    border-radius: 50%;

    animation: spin 0.8s linear infinite;

    margin: 0 auto 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p,
.empty-state p,
.error-state p {
    color: var(--muted);
    font-size: 13px;
}

.empty-icon,
.error-icon {
    width: 60px;
    height: 60px;

    margin: 0 auto 14px;

    border-radius: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 26px;
}

.empty-icon {
    background: #f3eefe;
    color: var(--primary);
}

.error-icon {
    background: var(--red-bg);
    color: var(--red);

    font-weight: bold;
}

.empty-state h3,
.error-state h3 {
    margin-bottom: 5px;
}

.error-state button {
    margin-top: 17px;

    border: 0;
    background: var(--primary);
    color: #fff;

    padding: 9px 17px;

    border-radius: 9px;
}


/* =========================================================
   PAGINATION
========================================================= */

.pagination {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 15px;

    padding: 18px;

    border-top: 1px solid var(--border);
}

.pagination button {
    border: 1px solid var(--border);

    background: #fff;

    padding: 7px 13px;

    border-radius: 8px;

    color: #555;
}

.pagination button:hover:not(:disabled) {
    color: var(--primary);
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#pageInfo {
    color: #777;
    font-size: 12px;
}


/* =========================================================
   MODAL
========================================================= */

.modal-overlay {
    position: fixed;

    inset: 0;

    background: rgba(15, 13, 20, 0.55);

    z-index: 2000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

.modal {
    width: 100%;
    max-width: 620px;

    max-height: calc(100vh - 40px);

    overflow-y: auto;

    background: #fff;

    border-radius: 20px;

    box-shadow: 0 25px 80px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 19px 21px;

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 18px;
}

.modal-header span {
    color: #aaa;
    font-size: 10px;
}

.modal-close {
    border: 0;
    background: #f6f6f8;

    width: 35px;
    height: 35px;

    border-radius: 9px;

    font-size: 22px;

    color: #777;
}

.modal-body {
    padding: 20px;
}

.review-user-box {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 20px;
}

.avatar {
    width: 47px;
    height: 47px;

    border-radius: 50%;

    background: #f0eafe;

    color: var(--primary);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 17px;
    font-weight: bold;
}

.review-user-box strong {
    display: block;
}

.review-user-box span {
    display: block;

    color: #999;

    font-size: 11px;
}

.detail-row {
    display: flex;

    justify-content: space-between;

    gap: 15px;

    padding: 11px 0;

    border-bottom: 1px solid #f1f1f4;
}

.detail-row span,
.detail-block > span {
    color: #999;
    font-size: 12px;
}

.detail-row strong {
    font-size: 13px;
}

.detail-block {
    margin-top: 18px;
}

.detail-block strong {
    display: block;

    margin-top: 7px;

    font-size: 14px;
}

.detail-block p {
    margin-top: 7px;

    padding: 13px;

    background: #fafafd;

    border-radius: 10px;

    color: #555;

    font-size: 13px;

    white-space: pre-wrap;
}

.admin-reply-box {
    margin-top: 20px;

    padding: 16px;

    background: #faf9ff;

    border: 1px solid #eee9fb;

    border-radius: 13px;
}

.admin-reply-box label {
    display: block;

    margin-bottom: 8px;

    font-size: 12px;
    font-weight: bold;
}

.admin-reply-box textarea {
    width: 100%;

    resize: vertical;

    min-height: 100px;

    border: 1px solid var(--border);

    border-radius: 10px;

    padding: 11px;

    outline: none;

    font-size: 13px;
}

.admin-reply-box textarea:focus {
    border-color: var(--primary);
}

.reply-btn {
    margin-top: 9px;

    border: 0;

    background: var(--primary);
    color: #fff;

    padding: 9px 15px;

    border-radius: 9px;

    font-size: 12px;
}

.reply-btn:hover {
    background: var(--primary-dark);
}

.modal-footer {
    padding: 15px 20px;

    border-top: 1px solid var(--border);

    display: flex;

    gap: 8px;

    flex-wrap: wrap;
}

.status-btn,
.delete-btn {
    border: 1px solid var(--border);

    background: #fff;

    padding: 8px 13px;

    border-radius: 9px;

    font-size: 12px;
}

.status-btn.pending:hover {
    color: var(--orange);
    border-color: var(--orange);
}

.status-btn.approved:hover {
    color: var(--green);
    border-color: var(--green);
}

.status-btn.rejected:hover,
.delete-btn:hover {
    color: var(--red);
    border-color: var(--red);
}

.delete-btn {
    margin-right: auto;
}


/* =========================================================
   TOAST
========================================================= */

.toast {
    position: fixed;

    left: 25px;
    bottom: 25px;

    max-width: 340px;

    padding: 12px 17px;

    background: #222;

    color: #fff;

    border-radius: 10px;

    font-size: 12px;

    opacity: 0;

    visibility: hidden;

    transform: translateY(15px);

    transition: 0.25s;

    z-index: 3000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.toast.success {
    background: #15803d;
}

.toast.error {
    background: #b91c1c;
}


/* =========================================================
   OVERLAY
========================================================= */

.sidebar-overlay {
    position: fixed;

    inset: 0;

    background: rgba(0,0,0,0.45);

    z-index: 1099;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition: 0.25s;
}

.sidebar-overlay.active,
.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1000px) {

    .sidebar {
        transform: translateX(100%);
        visibility: hidden;
    }

    .sidebar.active,
    .sidebar.open {
        transform: translateX(0);
        visibility: visible;
    }

    .main-content {
        width: 100%;
        margin-right: 0;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;

        position: relative;
        z-index: 1101;
    }
}

@media (max-width: 700px) {

    .main-content {
        padding: 17px;
    }

    .topbar {
        gap: 10px;
    }

    .page-title h1 {
        font-size: 20px;
    }

    .page-title p {
        display: none;
    }

    .refresh-btn span {
        display: none;
    }

    .refresh-btn {
        width: 43px;
        height: 43px;

        justify-content: center;
        padding: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;

        gap: 9px;
    }

    .stat-card {
        padding: 13px;
        gap: 9px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;

        border-radius: 11px;

        font-size: 17px;
    }

    .stat-card strong {
        font-size: 19px;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;

        padding: 0 14px 15px;
    }

    .search-box {
        width: 100%;
    }

    .filters select,
    .clear-filter-btn {
        width: 100%;
    }

    .content-header {
        padding: 17px 14px 13px;
    }

    .modal-overlay {
        padding: 10px;
    }

    .modal {
        max-height: calc(100vh - 20px);
        border-radius: 16px;
    }

    .modal-footer {
        padding: 12px;
    }

    .delete-btn {
        margin-right: 0;
    }
}

@media (max-width: 430px) {

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 12px 14px;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .delete-btn {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   TOUCH
========================================================= */

#menuToggle,
#refreshBtn,
button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}