:root {
    /* New Light Theme Variables */
    --bg-body: #F5F7FA;       /* Very light creamy grey/blue */
    --bg-white: #FFFFFF;
    --text-main: #1A1A1A;     /* Black */
    --text-muted: #64748B;    /* Slate Grey */
    
    /* Accents */
    --creamy-blue: #D6E4F0;   /* Soft Blue */
    --accent-blue: #4A90E2;   /* Primary Action Blue */
    --accent-green: #10B981;  /* Success Green */
    
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05);

    --font-main: 'Outfit', sans-serif;
    --radius-m: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
}

.admin-container {
    display: flex;
    min-height: 100vh;
    perspective: 1500px;
    background: var(--bg-body);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-white);
    padding: 2rem;
    border-right: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.sidebar .logo {
    text-align: center;
    margin-bottom: 3rem;
}

.sidebar .logo img {
    border: 2px solid var(--accent-blue);
    padding: 3px;
}

.menu {
    list-style: none;
    flex: 1;
}

.menu li {
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    border-radius: var(--radius-m);
    transition: all 0.3s;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
}

.menu li.active,
.menu li:hover {
    background: #E8F0FE; /* Light Blue Hover */
    color: var(--accent-blue);
    font-weight: 600;
}

.menu li i {
    margin-right: 12px;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2rem;
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-white);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    box-shadow: var(--shadow-card);
}

.avatar {
    width: 35px;
    height: 35px;
    background: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.3s;
}

.stat-card:hover { 
    transform: translateY(-5px); 
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
}

.stat-card p {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Table */
.orders-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.table-container {
    background: var(--bg-white);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-soft);
    overflow: hidden; /* For Rounded Corners */
    border: 1px solid #eee;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #F8FAFC;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

tr:hover {
    background: #F8FAFC;
}

.admin-review-cell {
    width: 320px;
    min-width: 260px;
    max-width: 320px;
    white-space: normal;
    vertical-align: top;
}

.admin-review-cell .testimonial-text {
    display: block;
    width: 100%;
    max-width: 320px;
    overflow: hidden;
    line-height: 1.5;
    max-height: 4.5em;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.admin-review-cell.expanded .testimonial-text {
    max-height: none;
}

.admin-review-cell .testimonial-text a {
    overflow-wrap: anywhere;
    word-break: normal;
}

.reviews-mobile-list {
    display: none;
}

#reviewsSection table {
    table-layout: fixed;
}

#reviewsSection th:nth-child(1),
#reviewsSection td:nth-child(1) {
    width: 150px;
}

#reviewsSection th:nth-child(2),
#reviewsSection td:nth-child(2) {
    width: 130px;
}

#reviewsSection th:nth-child(3),
#reviewsSection td:nth-child(3) {
    width: 95px;
}

#reviewsSection th:nth-child(4),
#reviewsSection td:nth-child(4) {
    width: 320px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

#reviewsSection th:nth-child(5),
#reviewsSection td:nth-child(5) {
    width: 130px;
}

#reviewsSection th:nth-child(6),
#reviewsSection td:nth-child(6) {
    width: 110px;
}

.status-paid {
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-block;
}

/* Login Overlay (Fully Opaque - Hides Admin Panel) */
.login-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: #F5F7FA; /* Fully opaque - no transparency */
    z-index: 9999; display: flex; justify-content: center; align-items: center; 
}

.login-box { 
    background: var(--bg-white); 
    padding: 3rem; 
    border-radius: 20px; 
    width: 100%; max-width: 400px; 
    text-align: center; 
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1); 
    border: none;
    animation: slideUp 0.5s ease-out; 
    position: relative;
    border: 1px solid #eee;
}

.login-logo img { width: 80px; height: 80px; border-radius: 50%; box-shadow: 0 5px 15px rgba(0,0,0,0.1); margin-bottom: 1.5rem; }
.login-box h2 { color: var(--text-main); margin-bottom: 0.5rem; }
.login-box p { color: var(--text-muted); margin-bottom: 2rem; font-size: 0.9rem; }

.input-group { 
    background: #F1F5F9; 
    border: 1px solid transparent; 
    padding: 0.8rem 1rem; 
    border-radius: 10px; 
    margin-bottom: 1rem; 
    display: flex; align-items: center; gap: 10px; 
    transition: 0.3s;
}

.input-group:focus-within {
    background: white;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.input-group i { color: var(--text-muted); }
.input-group input { background: transparent; border: none; color: var(--text-main); width: 100%; outline: none; font-family: inherit; }

.login-btn { 
    width: 100%; padding: 1rem; 
    background: var(--text-main); 
    border: none; border-radius: 10px; 
    color: white; font-weight: bold; 
    cursor: pointer; font-size: 1rem; 
    margin-top: 1rem; 
    transition: transform 0.2s, background 0.3s; 
}

.login-btn:hover { transform: translateY(-2px); background: #333; }

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Toast (Dark for contrast) */
.toast-notification {
    background: #1A1A1A;
    color: white;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-width: 300px;
    padding: 15px 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
    z-index: 10000;
    animation: slideInRight 0.4s ease-out forwards;
}

.toast-progress {
    position: absolute; bottom: 0; left: 0; height: 3px;
    background: rgba(255, 255, 255, 0.3); width: 100%;
    animation: progressDecrease 4s linear forwards;
}

/* Button & Status Styles */
.verify-btn {
    background: var(--text-main);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: 0.3s;
}
.verify-btn:hover {
    background: var(--accent-blue);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    /* 1. Stack layout vertically */
    .admin-container {
        flex-direction: column;
        padding-bottom: 70px; /* Space for bottom nav */
    }

    /* 2. Sidebar → Fixed Bottom Navigation Bar */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        padding: 0;
        border-right: none;
        border-top: 1px solid rgba(0,0,0,0.08);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
        z-index: 1000;
        background: var(--bg-white);
    }

    .sidebar .logo {
        display: none; /* Hide logo on mobile */
    }

    .menu {
        display: flex;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        padding: 0;
        gap: 0;
    }

    .menu li {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 4px;
        margin: 0;
        border-radius: 0;
        font-size: 0; /* Hide text */
        gap: 0;
        flex: 1;
        min-width: 0;
    }

    .menu li i {
        margin: 0;
        font-size: 1.2rem;
        display: block;
    }

    .menu li.active,
    .menu li:hover {
        background: transparent;
        color: var(--accent-blue);
    }

    .menu li.active i {
        color: var(--accent-blue);
    }

    /* 3. Main Content - Full Width */
    .main-content {
        padding: 1rem 0.8rem;
        width: 100%;
        min-height: 100vh;
    }

    /* 4. Header compact */
    header {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .user-profile {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    /* 5. Stats Row - side by side */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
        margin-bottom: 1.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card h3 {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
    }

    .stat-card p {
        font-size: 1.5rem;
    }

    /* 6. Tables - Horizontal Scroll with full readability */
    .orders-section h2,
    .users-section h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
        margin: 0 -0.4rem; /* Slight negative margin for edge-to-edge feel */
    }

    table {
        min-width: 700px; /* Force scroll on mobile */
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.8rem 0.6rem;
        white-space: nowrap;
    }

    #reviewsSection .table-container {
        overflow-x: hidden;
    }

    #reviewsSection .reviews-table-wrap {
        display: none !important;
    }

    .reviews-mobile-list {
        display: flex;
        flex-direction: column;
        gap: 0.9rem;
    }

    .review-mobile-card {
        width: 100%;
        max-width: 100%;
        background: var(--bg-white);
        border: 1px solid #eee;
        border-radius: 14px;
        box-shadow: var(--shadow-soft);
        padding: 1rem;
        overflow: hidden;
    }

    .review-mobile-top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .review-mobile-user {
        min-width: 0;
    }

    .review-mobile-user strong,
    .review-mobile-user small,
    .review-mobile-meta span,
    .review-mobile-text {
        display: block;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .review-mobile-user small {
        opacity: 0.6;
        margin-top: 0.15rem;
    }

    .review-mobile-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .review-mobile-meta span:first-child {
        color: var(--accent-blue);
        font-weight: 700;
        font-size: 0.85rem;
    }

    .review-mobile-text {
        color: var(--text-main);
        font-size: 0.92rem;
        line-height: 1.55;
    }

    .review-mobile-text a {
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .review-mobile-actions {
        margin-top: 0.9rem;
    }

    #reviewsSection table,
    #reviewsSection thead,
    #reviewsSection tbody,
    #reviewsSection tr,
    #reviewsSection th,
    #reviewsSection td {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    #reviewsSection thead {
        display: none;
    }

    #reviewsSection tr {
        padding: 0.9rem;
        border-bottom: 1px solid #eee;
    }

    #reviewsSection td {
        padding: 0.35rem 0;
        border-bottom: none;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    #reviewsSection td:nth-child(1)::before { content: "User: "; font-weight: 700; color: var(--text-muted); }
    #reviewsSection td:nth-child(2)::before { content: "Service: "; font-weight: 700; color: var(--text-muted); }
    #reviewsSection td:nth-child(3)::before { content: "Rating: "; font-weight: 700; color: var(--text-muted); }
    #reviewsSection td:nth-child(4)::before { content: "Review: "; font-weight: 700; color: var(--text-muted); display: block; margin-bottom: 0.25rem; }
    #reviewsSection td:nth-child(5)::before { content: "Status: "; font-weight: 700; color: var(--text-muted); }
    #reviewsSection td:nth-child(6)::before { content: "Action: "; font-weight: 700; color: var(--text-muted); }

    #reviewsSection td.review-mobile-card::before {
        content: none;
    }

    #reviewsSection td.review-mobile-card {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    .admin-review-cell {
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    .admin-review-cell .testimonial-text {
        width: 100% !important;
        max-width: 100% !important;
        max-height: none;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    th {
        font-size: 0.7rem;
        position: sticky;
        top: 0;
    }

    /* 7. Login Box Mobile */
    .login-box {
        padding: 2rem 1.5rem;
        width: 92%;
        max-width: 360px;
    }

    .login-box h2 {
        font-size: 1.3rem;
    }

    .login-logo img {
        width: 60px !important;
        height: 60px !important;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .main-content {
        padding: 0.8rem 0.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.8rem;
    }

    .stat-card p {
        font-size: 1.3rem;
    }

    th {
        font-size: 0.7rem;
        position: sticky;
        top: 0;
    }

    /* 7. Login Box Mobile */
    .login-box {
        padding: 2rem 1.5rem;
        width: 92%;
        max-width: 360px;
    }

    .login-box h2 {
        font-size: 1.3rem;
    }

    .login-logo img {
        width: 60px !important;
        height: 60px !important;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .main-content {
        padding: 0.8rem 0.5rem;
    }

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

    .stat-card {
        padding: 0.8rem;
    }

    .stat-card p {
        font-size: 1.3rem;
    }

    header h1 {
        font-size: 1.2rem;
    }
}

/* --- Universe Portal Animation (Login Gate) --- */
@keyframes universePortalEnter {
    0% {
        transform: scale(0.1) rotateX(15deg) translateY(100px) translateZ(-1000px);
        opacity: 0;
        filter: blur(20px) hue-rotate(90deg) brightness(2);
    }
    40% {
        opacity: 0.8;
        filter: blur(10px) hue-rotate(45deg) brightness(1.5);
    }
    100% {
        transform: scale(1) rotateX(0) translateY(0) translateZ(0);
        opacity: 1;
        filter: blur(0) hue-rotate(0) brightness(1);
    }
}

.portal-enter {
    transform-style: preserve-3d;
    animation: universePortalEnter 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Skeleton Loading styles */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-row td {
    padding: 15px;
}

.skeleton-bar {
    height: 18px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
