:root {
    color-scheme: dark;
    --bg: #0A0E27;
    --card: #1A1F3A;
    --text: #FFFFFF;
    --muted: #8B8FA3;
    --primary: #00D4FF;
    --primary-soft: rgba(0, 212, 255, 0.15);
    --accent: #6C5CE7;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 39, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background: var(--card);
    border-radius: 20px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow);
    position: relative;
    border: 1px solid var(--border);
}

.modal-header {
    margin-bottom: 16px;
    position: relative;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.modal-body {
    padding: 0;
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

* {
    box-sizing: border-box;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

.admin-body {
    min-height: 100vh;
}

.admin-shell {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    max-width: 100vw;
}

html.admin-panel,
html.admin-panel body.admin-body {
    overflow-x: hidden;
    max-width: 100%;
}

.admin-sidebar {
    background: #0F1422;
    color: #ffffff;
    border-right: 1px solid var(--border);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    transition: width 0.3s ease;
}

.admin-sidebar:hover {
    width: 260px;
}

.sidebar-brand {
    padding: 20px 18px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: #0F1422;
    z-index: 10;
    flex-shrink: 0;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.admin-sidebar:hover .sidebar-brand {
    opacity: 1;
}

.brand-mark {
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.5px;
}

.brand-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 18px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.admin-sidebar:hover .sidebar-nav {
    opacity: 1;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(0, 212, 255, 0.15);
    color: #00D4FF;
}

.nav-section {
    margin-top: 18px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
}

.admin-main {
    display: flex;
    flex-direction: column;
    margin-left: 0;
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    position: relative;
    transition: margin-left 0.3s ease, width 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 212, 255, 0.3) transparent;
}

.admin-main::-webkit-scrollbar {
    width: 6px;
}

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

.admin-main::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 3px;
}

.admin-main::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}


.admin-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    cursor: pointer;
    margin-right: 12px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.admin-menu-toggle:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.admin-sidebar-close {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 11;
    transition: background 0.2s;
}

.admin-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.admin-sidebar-overlay {
    display: none;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 32px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 56px;
    overflow: visible;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.topbar-title h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.topbar-subtitle {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
}

.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
    overflow: visible;
}

.topbar-lang {
    position: relative;
    overflow: visible;
}

.user-label {
    font-size: 12px;
    color: var(--muted);
    background: var(--primary-soft);
    padding: 5px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.admin-content {
    padding: 24px 32px;
    flex: 1;
    background: var(--bg);
    overflow-x: hidden;
}

.admin-content::-webkit-scrollbar {
    width: 6px;
}

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

.admin-content::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 3px;
}

.admin-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    background: var(--card);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    color: var(--text);
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    margin-top: 8px;
    color: var(--text);
}

.stat-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.panel-card {
    background: var(--card);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    color: var(--text);
}

.panel-card h3 {
    margin-top: 0;
    font-size: 18px;
    color: var(--text);
    font-weight: 600;
}

.panel-card p {
    color: var(--muted);
    font-size: 14px;
    margin: 8px 0;
}

.panel-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn {
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #00b8e6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.btn-outline {
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-soft);
}

.btn.full {
    width: 100%;
}

.admin-login-body {
    background: radial-gradient(circle at top, #1A1F3A, #0F1422 55%, #0A0E27);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-shell {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: var(--card);
    padding: 32px;
    border-radius: 22px;
    box-shadow: var(--shadow);
    width: min(420px, 100%);
}

.login-brand {
    font-size: 20px;
    font-weight: 700;
}

.login-subtitle {
    margin: 6px 0 18px;
    color: var(--muted);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 13px;
}

.field input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.field input:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.field input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.field input::placeholder {
    color: var(--muted);
}

.alert {
    background: rgba(255, 107, 107, 0.15);
    color: #FF6B6B;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 13px;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.login-hint {
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted);
}

@media (max-width: 1100px) {
    .stats-grid,
    .panel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text);
}

.page-header p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

/* Table Styles - horizontal scroll on mobile (Admin Management, Wallet Management, etc.) */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: rgba(0, 212, 255, 0.1);
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.data-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.05);
}

.data-table .text-center {
    text-align: center;
}

.data-table .text-muted {
    color: var(--muted);
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    cursor: pointer;
}

.form-control:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

/* Select dropdown options - Theme colors */
.form-control select,
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300D4FF' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-control option,
select.form-control option {
    background: var(--card);
    color: var(--text);
    padding: 10px 12px;
    border: none;
}

.form-control option:hover,
select.form-control option:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.form-control option:checked,
select.form-control option:checked {
    background: var(--primary-soft);
    color: var(--primary);
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 12px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

/* Button Variants */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-success {
    background: #10b981;
    color: #fff;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-warning {
    background: #f59e0b;
    color: #fff;
}

.btn-info {
    background: #3b82f6;
    color: #fff;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.badge-secondary {
    background: rgba(107, 114, 128, 0.2);
    color: #6b7280;
}

/* Panel Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.panel-body {
    color: var(--text);
}

/* Search Form */
.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-form input,
.search-form select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.search-form input:hover,
.search-form select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.search-form input:focus,
.search-form select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.search-form select option {
    background: var(--card);
    color: var(--text);
    padding: 8px 12px;
}

.search-form button {
    padding: 8px 16px;
    font-size: 13px;
}

/* Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

/* Info Row */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: var(--muted);
    font-size: 13px;
}

/* Voucher Modal - Compact Size */
.voucher-modal {
    max-width: 600px;
    padding: 16px;
}

.voucher-modal .modal-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voucher-modal .modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.voucher-modal-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

.voucher-image {
    max-width: 100%;
    max-height: 70vh;
    height: auto;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .voucher-modal {
        max-width: 95%;
        padding: 12px;
    }
    
    .voucher-image {
        max-height: 60vh;
    }
}

.info-row .value {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}

/* Pagination */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.pagination ul {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination li {
    display: inline-block;
}

.pagination a,
.pagination span {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    border: 1px solid var(--border);
}

.pagination a:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.pagination .active span {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Standard Admin Pagination Component */
.admin-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-total {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
}

.pagination-per-page {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.pagination-per-page:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.pagination-per-page:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 36px;
    text-align: center;
    transition: all 0.2s;
    outline: none;
}

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

.pagination-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-ellipsis {
    padding: 8px 4px;
    color: var(--muted);
    font-size: 14px;
}

.pagination-goto {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-goto span {
    font-size: 14px;
    color: var(--muted);
}

.pagination-goto-input {
    width: 60px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    text-align: center;
    outline: none;
    transition: all 0.2s;
}

.pagination-goto-input:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.pagination-goto-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

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

    .pagination-info {
        justify-content: space-between;
        width: 100%;
    }

    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }

    .pagination-goto {
        justify-content: center;
        width: 100%;
    }
}

/* Utility Classes */
.mt-3 {
    margin-top: 16px;
}

.text-muted {
    color: var(--muted);
}

@media (max-width: 900px) {
    .admin-menu-toggle {
        display: flex;
    }

    .admin-sidebar {
        width: 260px;
        max-width: 85vw;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        box-shadow: none;
    }

    .admin-shell.sidebar-open .admin-sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    }

    .admin-sidebar .sidebar-brand,
    .admin-sidebar .sidebar-nav {
        opacity: 1;
    }

    .admin-sidebar-close {
        display: flex;
    }

    .admin-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .admin-shell.sidebar-open .admin-sidebar-overlay {
        display: block;
        opacity: 1;
    }

    .admin-main {
        margin-left: 0;
        width: 100%;
    }

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

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

    .admin-topbar {
        padding: 10px 12px;
        min-width: 0;
        overflow: visible;
        gap: 8px;
    }

    .topbar-title {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .topbar-title h1 {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-subtitle {
        font-size: 11px;
    }

    .topbar-actions {
        flex-shrink: 0;
        min-width: 0;
        gap: 6px;
    }

    .topbar-lang,
    .topbar-issue {
        position: relative;
        z-index: 1001;
    }

    #admin-lang-dropdown,
    #admin-issue-dropdown {
        z-index: 1002;
    }

    .topbar-actions .btn,
    .admin-topbar #admin-lang-btn,
    .admin-topbar #admin-issue-btn {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 0;
    }

    .admin-topbar #admin-lang-btn {
        min-width: 0;
        padding-left: 10px;
        padding-right: 10px;
    }

    .admin-topbar #admin-issue-btn {
        min-width: 0;
        padding-left: 10px;
        padding-right: 10px;
    }

    .admin-content {
        padding: 16px;
        min-width: 0;
    }

    .panel-card,
    .grid-2 {
        min-width: 0;
    }

    .table-container {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .admin-topbar {
        padding: 8px 10px;
        gap: 6px;
    }

    .topbar-title h1 {
        font-size: 14px;
    }

    .topbar-subtitle {
        display: none;
    }

    .topbar-actions .btn,
    .admin-topbar #admin-lang-btn,
    .admin-topbar #admin-issue-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
}

body.sidebar-open-mobile {
    overflow: hidden;
}

/* Admin Chat UI */
.admin-chat-wrapper {
    padding: 0;
    overflow: hidden;
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    margin: -24px -32px;
    width: calc(100% + 64px);
}

.admin-chat-container {
    display: flex;
    height: 100%;
    min-height: 0;
    background: var(--bg);
    overflow: hidden;
}

/* Left Sidebar - User List */
.admin-chat-sidebar {
    width: 320px;
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
}

.admin-chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-chat-sidebar-header h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.admin-chat-search input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
}

.admin-chat-search input:focus {
    outline: none;
    border-color: var(--primary);
}

.admin-chat-user-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.admin-chat-user-list::-webkit-scrollbar {
    width: 6px;
}

.admin-chat-user-list::-webkit-scrollbar-track {
    background: transparent;
}

.admin-chat-user-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.admin-chat-user-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.admin-chat-user-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.admin-chat-user-item.active {
    background: var(--primary-soft);
    border-left: 3px solid var(--primary);
}

.admin-chat-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    margin-right: 12px;
}

.admin-chat-user-info {
    flex: 1;
    min-width: 0;
}

.admin-chat-user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.admin-chat-user-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-chat-unread-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff4757;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.admin-chat-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* Right Side - Chat Area */
.admin-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: var(--bg);
    overflow: hidden;
}

.admin-chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.admin-chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.admin-chat-header-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-chat-header-meta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.admin-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.admin-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.admin-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.admin-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.admin-chat-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 75%;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-chat-message-left {
    align-self: flex-start;
}

.admin-chat-message-right {
    align-self: flex-end;
    flex-direction: row-reverse;
    margin-left: auto;
}

.admin-chat-message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    word-wrap: break-word;
    white-space: pre-wrap;
    position: relative;
}

.admin-chat-message-left .admin-chat-message-content {
    align-items: flex-start;
}

.admin-chat-message-right .admin-chat-message-content {
    align-items: flex-end;
}

.admin-chat-message-text {
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    word-wrap: break-word;
    white-space: pre-wrap;
    border-radius: 12px;
    background: transparent;
    border: none;
    max-width: 100%;
    margin-bottom: 0;
}

.admin-chat-message-left .admin-chat-message-text {
    background: rgba(255, 255, 255, 0.1);
    border-top-left-radius: 4px;
}

.admin-chat-message-right .admin-chat-message-text {
    background: rgba(255, 255, 255, 0.1);
    border-top-right-radius: 4px;
    color: var(--text);
}

.admin-chat-message-image {
    max-width: 200px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 4px;
    position: relative;
}

.admin-chat-message-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.admin-chat-message-image img:hover {
    transform: scale(1.02);
}

.admin-chat-message-time {
    font-size: 11px;
    color: var(--muted);
    padding: 0 4px;
    opacity: 0.7;
    margin-top: 0;
}

.admin-chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--card);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.admin-chat-input-area form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.admin-chat-input-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.admin-chat-icon-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-chat-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.admin-chat-text-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.admin-chat-text-input::-webkit-scrollbar {
    display: none;
}

.admin-chat-text-input:focus {
    outline: none;
    border-color: var(--primary);
}

.admin-chat-text-input::placeholder {
    color: var(--muted);
}

.admin-chat-send-btn {
    background: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.admin-chat-send-btn:hover:not(:disabled) {
    background: var(--accent);
}

.admin-chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.admin-chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.admin-chat-placeholder-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.admin-chat-placeholder-text {
    font-size: 16px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive - Support/Customer Service: horizontal swipe for ticket list + chat */
@media (max-width: 900px) {
    .admin-chat-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        margin: -16px -16px;
        width: calc(100% + 32px);
    }

    .admin-chat-container {
        min-width: 560px;
        overflow-x: visible;
        overflow-y: hidden;
    }

    .admin-chat-sidebar {
        width: 260px;
        min-width: 260px;
        flex-shrink: 0;
    }

    .admin-chat-main {
        min-width: 300px;
        flex: 1;
    }
}

@media (max-width: 768px) {
    .admin-chat-sidebar {
        width: 260px;
        min-width: 260px;
    }

    .admin-chat-message {
        max-width: 85%;
    }

    .admin-chat-text-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

