:root {
    --admin-bg: #090a0d;
    --admin-sidebar: #11141a;
    --admin-card: #171b24;
    --admin-accent: #dfba73; /* Rich Royal Gold */
    --admin-txt-primary: #f0f1f4;
    --admin-txt-muted: #8b95a5;
    --admin-border: #252b38;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--admin-bg);
    color: var(--admin-txt-primary);
    overflow-x: hidden;
}

.hide {
    display: none !important;
}

/* Auth Portal styles */
.auth-screen {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #151a24 0%, #07080a 100%);
}

.auth-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    text-align: center;
}

.lock-icon {
    font-size: 40px;
    color: var(--admin-accent);
    margin-bottom: 16px;
}

.auth-header h2 {
    font-size: 22px;
    margin-bottom: 4px;
}

.auth-header p {
    color: var(--admin-txt-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.auth-body {
    text-align: left;
}

.auth-body label {
    font-size: 12px;
    font-weight: 700;
    color: var(--admin-txt-muted);
    margin-bottom: 8px;
    display: block;
}

.password-input-group {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.password-input-group input {
    width: 100%;
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 12px 16px;
    color: white;
    font-size: 15px;
    outline: none;
}

.toggle-pwd-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--admin-txt-muted);
    cursor: pointer;
}

.error-msg {
    color: #ff4d4d;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}

.btn-login {
    background: var(--admin-accent);
    color: black;
    border: none;
    width: 100%;
    padding: 12px 0;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: #cbb065;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(223, 186, 115, 0.3);
}

.back-home {
    display: block;
    text-align: center;
    color: var(--admin-txt-muted);
    font-size: 13px;
    text-decoration: none;
    margin-top: 24px;
    transition: color 0.3s;
}

.back-home:hover {
    color: white;
}

/* Dashboard Panel Layout (Made fluid with responsive flexbox) */
.admin-dashboard {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
}

.sidebar {
    width: 100%;
    background: var(--admin-sidebar);
    border-bottom: 1px solid var(--admin-border);
    border-right: none;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.sidebar-logo {
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--admin-accent);
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
}

.admin-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--admin-accent);
    color: black;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-profile h4 {
    font-size: 14px;
}

.online-indicator {
    font-size: 11px;
    color: #4cd137;
}

.sidebar-menu {
    flex-grow: 1;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 12px;
    scrollbar-width: none;
}

.sidebar-menu::-webkit-scrollbar {
    display: none;
}

.menu-tab {
    background: none;
    border: none;
    color: var(--admin-txt-muted);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    transition: all 0.3s;
}

.menu-tab:hover, .menu-tab.active {
    background: var(--admin-card);
    color: white;
}

.menu-tab.active {
    border-bottom: 2px solid var(--admin-accent);
    border-left: none;
    border-radius: 8px 8px 0 0;
}

.btn-logout {
    background: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.2);
    width: auto;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    align-self: flex-start;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #ff4d4d;
    color: white;
}

.dashboard-workspace {
    flex-grow: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.visit-store-btn {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    color: white;
    padding: 8px 18px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

/* Tables styling (HORIZONTAL SCROLL ON MOBILE SCREENS) */
.table-container {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 600px; /* Forces layout preservation to trigger horizontal overflow container */
}

.data-table th, .data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--admin-border);
    font-size: 14px;
}

.data-table th {
    background: rgba(0,0,0,0.25);
    font-weight: 600;
    color: var(--admin-txt-muted);
}

.p-preview {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
}

.btn-primary {
    background: var(--admin-accent);
    color: black;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.btn-danger {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.btn-edit {
    background: none;
    border: none;
    color: var(--admin-accent);
    cursor: pointer;
    margin-right: 12px;
    font-size: 16px;
}

.btn-delete {
    background: none;
    border: none;
    color: #ff4d4d;
    cursor: pointer;
    font-size: 16px;
}

/* Image Preview box style */
.image-preview-box {
    margin-top: 15px;
    background: var(--admin-bg);
    border: 1px dashed var(--admin-border);
    height: 120px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.image-preview-box img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.image-preview-box p {
    font-size: 12px;
    color: var(--admin-txt-muted);
}

/* Stat Editors tab styles */
.stats-editor-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    color: var(--admin-txt-muted);
    margin-bottom: 8px;
}

.form-group input, .form-group textarea, .form-group select {
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    color: white;
    padding: 12px;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Modal overlays */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--admin-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel {
    background: none;
    border: 1px solid var(--admin-border);
    color: white;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
}

/* Desktop Sidebar Adaptability on wider screen sizes (>768px) */
@media (min-width: 768px) {
    .admin-dashboard {
        flex-direction: row;
        height: 100vh;
    }
    .sidebar {
        width: 280px;
        border-right: 1px solid var(--admin-border);
        border-bottom: none;
    }
    .sidebar-menu {
        flex-direction: column;
        overflow-x: visible;
        margin-bottom: 24px;
    }
    .menu-tab.active {
        border-left: 4px solid var(--admin-accent);
        border-bottom: none;
        border-radius: 0 8px 8px 0;
    }
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .dashboard-workspace {
        padding: 40px;
    }
}