/* ========================================= */
/*   ADMIN OS SPECIFIC STYLES                */
/* ========================================= */

.admin-container {
    display: flex;
    height: calc(100vh - 110px);
    margin: 108px 2.5% 0;
    gap: 20px;
    padding-bottom: 20px;
}

/* Sidebar Styling */
.admin-sidebar {
    width: 280px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.admin-sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--lg-accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.admin-nav-group {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--lg-text-muted);
    margin-bottom: 5px;
    padding-left: 10px;
    font-weight: 600;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border-radius: var(--radius-md);
    color: var(--lg-text-main);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.95rem;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.admin-tab:hover {
    background: rgba(255, 255, 255, 0.7);
    color: var(--lg-accent-primary);
}

.admin-tab.active {
    background: var(--lg-accent-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(35, 192, 255, 0.3);
}

.admin-tab i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Main Content Area */
.admin-content {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.admin-nav-actions {
    gap: 14px;
}

.admin-notifications {
    position: relative;
}

.admin-notif-btn {
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(35, 192, 255, 0.24), transparent 58%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12));
    color: #f4fbff;
    box-shadow: 0 16px 34px rgba(11, 32, 60, 0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    position: relative;
}

.admin-notif-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(11, 32, 60, 0.24);
    border-color: rgba(132, 229, 255, 0.6);
}

.admin-notif-btn i {
    font-size: 1rem;
}

.admin-notif-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff6b6b, #ff2d55);
    border: 2px solid rgba(12, 23, 39, 0.92);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(255, 45, 85, 0.38);
}

.admin-notif-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: min(420px, 92vw);
    padding: 14px;
    border-radius: 24px;
    border: 1px solid rgba(151, 227, 255, 0.28);
    background:
        radial-gradient(circle at top right, rgba(0, 194, 255, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(11, 20, 34, 0.96), rgba(14, 31, 55, 0.94));
    box-shadow: 0 28px 80px rgba(3, 10, 20, 0.38);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 2200;
}

.admin-notif-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 220, 255, 0.14);
}

.admin-notif-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f5fbff;
}

.admin-notif-subtitle {
    margin-top: 4px;
    font-size: 0.82rem;
    color: rgba(214, 234, 255, 0.74);
}

.admin-notif-mark-all {
    border: 1px solid rgba(148, 220, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #b8ebff;
    padding: 8px 12px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.admin-notif-mark-all:hover {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(125, 211, 252, 0.42);
    transform: translateY(-1px);
}

.admin-notif-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: min(62vh, 520px);
    overflow: auto;
    padding-top: 14px;
}

.admin-notif-item {
    position: relative;
    width: 100%;
    border: 1px solid rgba(148, 220, 255, 0.14);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.05));
    padding: 14px 16px 14px 18px;
    display: grid;
    grid-template-columns: auto 54px 1fr;
    gap: 14px;
    align-items: center;
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.admin-notif-item:hover {
    transform: translateY(-1px);
    border-color: rgba(125, 211, 252, 0.38);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(56, 189, 248, 0.08));
    box-shadow: 0 18px 34px rgba(2, 8, 18, 0.24);
}

.admin-notif-item.unread {
    border-color: rgba(110, 231, 255, 0.4);
    background: linear-gradient(180deg, rgba(16, 185, 255, 0.14), rgba(255, 255, 255, 0.07));
}

.admin-notif-accent {
    width: 4px;
    align-self: stretch;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(103, 232, 249, 0.22), rgba(34, 211, 238, 0.05));
}

.admin-notif-item.unread .admin-notif-accent {
    background: linear-gradient(180deg, #7dd3fc, #22d3ee);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.42);
}

.admin-notif-avatar {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(148, 220, 255, 0.16);
}

.admin-notif-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-notif-copy {
    min-width: 0;
}

.admin-notif-item-top,
.admin-notif-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-notif-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7dd3fc;
}

.admin-notif-kicker::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px rgba(125, 211, 252, 0.4);
}

.admin-notif-time,
.admin-notif-meta {
    font-size: 0.74rem;
    color: rgba(214, 234, 255, 0.68);
}

.admin-notif-item-title {
    margin-top: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    color: #f5fbff;
}

.admin-notif-item-body {
    margin-top: 6px;
    font-size: 0.83rem;
    line-height: 1.45;
    color: rgba(224, 239, 255, 0.82);
}

.admin-notif-meta {
    margin-top: 10px;
}

.admin-notif-empty {
    min-height: 180px;
    border: 1px dashed rgba(148, 220, 255, 0.18);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(214, 234, 255, 0.68);
    text-align: center;
    padding: 24px;
}

.admin-notif-empty i {
    font-size: 1.4rem;
    color: rgba(125, 211, 252, 0.8);
}

@media (max-width: 720px) {
    .admin-nav-actions {
        gap: 10px;
    }

    .admin-notif-dropdown {
        right: -12px;
        width: min(92vw, 360px);
        padding: 12px;
    }

    .admin-notif-item {
        grid-template-columns: auto 44px 1fr;
        gap: 12px;
        padding: 13px 14px 13px 16px;
    }

    .admin-notif-avatar {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .admin-notif-top,
    .admin-notif-item-top,
    .admin-notif-meta {
        gap: 8px;
    }
}

.admin-panel {
    display: none;
    animation: lg-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-panel.active {
    display: block;
}

#tab-tickets,
#tab-adminchat {
    height: 100%;
}

.admin-split-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 100%;
    overflow: hidden;
}

.admin-split-left {
    border-right: 1px solid var(--lg-glass-border);
    height: 100%;
    overflow-y: auto;
}

.admin-split-right {
    height: 100%;
    overflow: hidden;
}

/* Admin right area: chat column + detail sidebar side by side */
.admin-right-flex {
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow: hidden;
}
.admin-chat-col {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* admin-detail-sidebar styles live in addon-system.css */

/* Common Utility Classes */
.h-full {
    height: 100%;
}

.w-full {
    width: 100%;
}

.m-0 {
    margin: 0;
}

.mt-0 {
    margin-top: 0;
}

.mt-5 {
    margin-top: 5px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-5 {
    margin-bottom: 5px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.ml-10 {
    margin-left: 10px;
}

.p-5 {
    padding: 5px;
}

.p-10 {
    padding: 10px;
}

.p-15 {
    padding: 15px;
}

.p-20 {
    padding: 20px;
}

.p-30 {
    padding: 30px;
}

.px-15 {
    padding-left: 15px;
    padding-right: 15px;
}

.py-12 {
    padding-top: 12px;
    padding-bottom: 12px;
}

.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.align-center {
    align-items: center;
}

.align-baseline {
    align-items: baseline;
}

.end-align {
    justify-content: flex-end;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.space-between {
    justify-content: space-between;
}

.gap-5 {
    gap: 5px;
}

.gap-10 {
    gap: 10px;
}

.gap-15 {
    gap: 15px;
}

.gap-20 {
    gap: 20px;
}

.flex-1 {
    flex: 1;
}

.shrink-0 {
    flex-shrink: 0;
}

.text-center {
    text-align: center;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.85rem;
}

.text-md {
    font-size: 1.1rem;
}

.text-lg {
    font-size: 1.3rem;
}

.text-xl {
    font-size: 1.5rem;
}

.fw-500 {
    font-weight: 500;
}

.fw-600 {
    font-weight: 600;
}

.fw-bold {
    font-weight: 700;
}

.muted {
    color: var(--lg-text-dim);
}

.text-white {
    color: #fff;
}

.text-danger {
    color: #ef4444;
}

.text-accent {
    color: var(--lg-accent-primary);
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.z-top {
    z-index: 1000;
}

.overflow-hidden {
    overflow: hidden;
}

.pointer-events-none {
    pointer-events: none;
}

.cursor-pointer {
    cursor: pointer;
}

.text-nodeco {
    text-decoration: none;
}

.min-w-0 {
    min-width: 0;
}

.w-fit {
    width: fit-content;
}

.w-max {
    width: max-content;
}

.br-8 {
    border-radius: 8px;
}

.br-12 {
    border-radius: 12px;
}

.br-circle {
    border-radius: 50%;
}

.border-top {
    border-top: 1px solid var(--lg-glass-border);
}

.border-bottom {
    border-bottom: 1px solid var(--lg-glass-border);
}

.border-accent {
    border: 1px solid rgba(35, 192, 255, 0.3);
}

.border-danger {
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.bg-glass {
    background: rgba(255, 255, 255, 0.6);
}

.hover-bg-glass:hover {
    background: rgba(255, 255, 255, 0.85);
}

.custom-hover:hover {
    background: rgba(255, 255, 255, 0.85);
}

.transition {
    transition: all 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.shadow-lg {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.no-wrap {
    white-space: nowrap;
}

.text-ellipsis {
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Custom Scrollbars */
.custom-scroll {
    overflow-y: auto;
}

.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Specific Component Styles */
.admin-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--lg-text-dim);
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.admin-chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--lg-glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
}

.admin-chat-subheader {
    padding: 10px 20px;
    border-bottom: 1px solid var(--lg-glass-border);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.5);
}

/* ── Claimed-by bar (shown below subheader when ticket is claimed) ── */
.admin-claimed-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 20px;
    background: linear-gradient(90deg, rgba(234,179,8,0.08), rgba(234,179,8,0.04));
    border-bottom: 1px solid rgba(234,179,8,0.18);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.admin-claimed-bar.hidden {
    display: none !important;
}

.admin-claimed-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(234,179,8,0.4);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-claimed-avatar:hover {
    transform: scale(1.12);
    box-shadow: 0 0 0 2px rgba(234,179,8,0.5);
}

.admin-claimed-label {
    color: #92400e;
    font-weight: 500;
}

.admin-claimed-name {
    color: #78350f;
    font-weight: 700;
}

.admin-claimed-time {
    color: #a16207;
    font-size: 0.75rem;
}

/* ── Claimer pill in ticket list row ── */
.admin-ticket-claimer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px 1px 3px;
    border-radius: 20px;
    background: rgba(234,179,8,0.12);
    border: 1px solid rgba(234,179,8,0.25);
    font-size: 0.68rem;
    color: #92400e;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    white-space: nowrap;
}

.admin-ticket-claimer-avatar {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.admin-ticket-claimer-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-header-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.admin-chat-header-copy {
    min-width: 0;
}

.admin-mobile-back {
    display: none;
}

.admin-chat-input-area {
    padding: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.65);
}

.admin-chat-input-area.sky-drop-active,
.admin-attachment-tray.sky-drop-active {
    box-shadow: inset 0 0 0 2px rgba(14, 165, 233, 0.55);
    background: rgba(224, 242, 254, 0.74);
}

.admin-chat-actions {
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

#finalizeThumbnailBtn {
    position: relative;
    z-index: 21;
    pointer-events: auto;
}

.chat-preview-box {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--lg-glass-border);
    backdrop-filter: blur(10px);
}

.preview-img {
    max-height: 80px;
    border-radius: 4px;
}

.preview-close {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.admin-ticket-card,
.admin-ticket-card-closed {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--lg-glass-border);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-ticket-card:hover,
.admin-ticket-card-closed:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--lg-accent-primary);
    transform: translateY(-2px);
}

.admin-ticket-id {
    font-family: monospace;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--lg-text-muted);
}

.admin-ticket-meta {
    border-top: 1px solid var(--lg-glass-border);
    padding-top: 10px;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--lg-text-dim);
    display: flex;
    justify-content: space-between;
}

.grid-layout {
    display: grid;
}

.admin-users-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px;
    gap: 12px;
}

.admin-users-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.admin-users-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(440px, 100%);
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    padding: 9px 12px;
}

.admin-users-search i {
    color: #64748b;
}

.admin-users-search input {
    border: 0;
    background: transparent;
    width: 100%;
    outline: none;
    color: #0f172a;
    font-size: 0.88rem;
}

.admin-users-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.admin-user-row {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.94));
    border-radius: 14px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 10px;
    align-items: center;
}

.admin-user-row:hover {
    border-color: rgba(14, 165, 233, 0.45);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.07);
}

.admin-user-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #fff;
}

.admin-user-main {
    min-width: 0;
}

.admin-user-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-user-top strong {
    font-size: 0.9rem;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-email {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-role-badge {
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.admin-user-role-badge.role-user {
    background: rgba(148, 163, 184, 0.2);
    color: #475569;
}

.admin-user-role-badge.role-admin,
.admin-user-role-badge.role-dev {
    background: rgba(56, 189, 248, 0.2);
    color: #0c4a6e;
}

.admin-user-role-badge.role-super_admin {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(99, 102, 241, 0.22));
    color: #3730a3;
}

#sidebar-role.super-admin-badge {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.24), rgba(99, 102, 241, 0.2));
    color: #312e81;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.admin-users-empty {
    padding: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    border-radius: 12px;
    text-align: center;
    color: #64748b;
    background: rgba(255, 255, 255, 0.74);
}

.admin-users-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.admin-user-avatar-skeleton {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(203, 213, 225, 0.45);
}

.block-modal {
    width: 550px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    opacity: 0.6;
    transition: 0.2s;
}

.modal-close:hover {
    opacity: 1;
    color: var(--lg-accent-primary);
}

.accent-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--lg-accent-primary);
    cursor: pointer;
}

#finalize-ticket-overlay {
    z-index: 12000 !important;
}

.finalize-modal-card {
    width: min(980px, 92vw);
    max-height: 86vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.finalize-dropzone {
    border: 1.5px dashed rgba(14, 165, 233, 0.45);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(224, 242, 254, 0.65));
    border-radius: 14px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 14px;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.finalize-dropzone:hover,
.finalize-dropzone.drag-over {
    border-color: rgba(2, 132, 199, 0.95);
    box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.35);
    transform: translateY(-1px);
}

.finalize-dropzone-icon {
    font-size: 1.4rem;
    color: #0284c7;
    margin-bottom: 8px;
}

.finalize-dropzone-title {
    font-weight: 700;
    color: var(--lg-text-main);
}

.finalize-dropzone-sub {
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--lg-text-dim);
}

.finalize-preview-wrap {
    border: 1px solid var(--lg-glass-border);
    border-radius: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.75);
    margin-bottom: 12px;
}

.finalize-preview-wrap img {
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
}

.finalize-preview-meta {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.finalize-preview-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.84rem;
    color: var(--lg-text-muted);
}

.finalize-existing-title {
    margin: 8px 0 10px;
    font-size: 0.9rem;
    color: var(--lg-text-muted);
    font-weight: 600;
}

.finalize-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    overflow: auto;
    padding-right: 4px;
    min-height: 120px;
    max-height: 28vh;
}

.finalize-image-option {
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.finalize-image-option img {
    width: 100%;
    height: 100%;
    max-height: 180px;
    object-fit: cover;
    display: block;
}

.finalize-image-option:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.85);
}

.finalize-image-option.selected {
    border-color: rgba(14, 165, 233, 0.95);
    box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.45);
}

.finalize-image-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(14, 165, 233, 0.95);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 6px 14px rgba(2, 132, 199, 0.35);
}

.finalize-image-option.selected .finalize-image-check {
    display: inline-flex;
}

.finalize-modal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#finalize-ticket-status {
    min-height: 18px;
    margin-top: 8px;
}

.ticket-msg-text {
    user-select: text;
    -webkit-user-select: text;
}

.admin-chat-body {
    user-select: text;
    -webkit-user-select: text;
}

.admin-chat-bubble {
    position: relative;
}

.admin-chat-bubble .msg-actions,
.ticket-msg-inner .msg-actions {
    position: absolute;
    top: -14px;
    right: 8px;
    opacity: 0;
    transition: opacity .18s ease;
    pointer-events: none;
}

.admin-chat-bubble:hover .msg-actions,
.ticket-msg-inner:hover .msg-actions {
    opacity: 1;
}

.admin-chat-bubble .msg-actions button,
.ticket-msg-inner .msg-actions button {
    pointer-events: auto;
    border: 1px solid var(--lg-glass-border);
    background: rgba(255, 255, 255, 0.94);
    border-radius: 999px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.admin-chat-bubble .msg-actions button:hover,
.ticket-msg-inner .msg-actions button:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.08);
}

.ticket-msg-role {
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 7px;
    letter-spacing: .04em;
    width: fit-content;
}

.ticket-msg-role.role-client {
    background: rgba(148, 163, 184, 0.2);
    color: #475569;
}

.ticket-msg-role.role-artist {
    background: rgba(56, 189, 248, 0.18);
    color: #075985;
}

.ticket-msg-role.role-admin {
    background: rgba(244, 114, 182, 0.18);
    color: #9d174d;
}

.msg-reply-context {
    margin-bottom: 8px;
    border-left: 3px solid rgba(14, 165, 233, 0.7);
    background: rgba(240, 249, 255, 0.8);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 0.76rem;
    cursor: pointer;
}

.msg-target-highlight {
    box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.8);
    transition: box-shadow .35s ease;
}

@media (max-width: 900px) {
    .admin-container {
        flex-direction: column;
        margin: 92px 10px 10px;
        height: auto;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        margin-bottom: 20px;
    }

    .admin-split-layout {
        grid-template-columns: 1fr;
    }

    .admin-split-left {
        border-right: none;
        border-bottom: 1px solid var(--lg-glass-border);
        height: 40vh;
    }

    .admin-split-right {
        height: 60vh;
    }
    .admin-right-flex {
        flex-direction: column;
    }
    .admin-chat-col {
        flex: 1;
        min-height: 0;
    }

    .admin-content {
        height: 80vh;
    }
}

/* ===== Admin Chat V2 (Light Liquid Glass) ===== */
.admin-ticket-inbox-toolbar {
    position: sticky;
    top: 0;
    z-index: 6;
    padding: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.admin-ticket-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.82);
}

.admin-ticket-search input {
    border: 0;
    background: transparent;
    width: 100%;
    outline: none;
    color: #0f172a;
    font-size: 0.9rem;
}

.admin-ticket-filter-pills {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.admin-ticket-filter-pills button {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.78);
    color: #334155;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.78rem;
    cursor: pointer;
}

.admin-ticket-filter-pills button.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(56, 189, 248, 0.28));
    color: #075985;
    border-color: rgba(14, 165, 233, 0.45);
}

.admin-ticket-toolbar-meta {
    margin-top: 8px;
    font-weight: 600;
    color: #64748b;
}

.admin-gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.82);
}

.admin-gallery-search {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.admin-gallery-toolbar-meta {
    font-weight: 600;
    color: #64748b;
    flex-shrink: 0;
}

.admin-ticket-inbox-list {
    padding: 10px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-ticket-row {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.92));
    border-radius: 14px;
    padding: 10px;
    display: grid;
    grid-template-columns: 38px 1fr auto;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.admin-ticket-row:hover {
    transform: translateY(-1px);
    border-color: rgba(14, 165, 233, 0.42);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.admin-ticket-row.selected {
    border-color: rgba(14, 165, 233, 0.72);
    box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.52);
}

.admin-ticket-avatar img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.admin-ticket-main {
    min-width: 0;
}

.admin-ticket-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.admin-ticket-top strong {
    font-size: 0.86rem;
    color: #0f172a;
}

.admin-ticket-time {
    color: #64748b;
    font-size: 0.73rem;
}

.admin-ticket-sub {
    display: flex;
    gap: 8px;
    margin-top: 3px;
    align-items: center;
}

.admin-status-pill {
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.status-open {
    background: rgba(16, 185, 129, 0.16);
    color: #065f46;
}

.status-pending {
    background: rgba(234, 179, 8, 0.2);
    color: #854d0e;
}

.status-closed {
    background: rgba(248, 113, 113, 0.18);
    color: #991b1b;
}

.admin-ticket-preview {
    margin: 6px 0 0;
    color: #475569;
    font-size: 0.79rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-unread-badge {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #0284c7;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.admin-list-empty,
.admin-list-error {
    padding: 18px 12px;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    border-radius: 12px;
    color: #64748b;
    text-align: center;
    background: rgba(255, 255, 255, 0.72);
}

.admin-list-error button {
    margin-left: 8px;
    border: 0;
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
    background: rgba(14, 165, 233, 0.15);
    color: #075985;
}

.admin-ticket-chat-body {
    position: relative;
}

.admin-ticket-closed-banner {
    margin: 10px 18px 0;
    border: 1px solid rgba(248, 113, 113, 0.38);
    background: rgba(254, 242, 242, 0.88);
    color: #b91c1c;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.82rem;
}

.admin-new-messages-pill {
    position: absolute;
    bottom: 166px;
    right: 22px;
    z-index: 14;
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(14, 165, 233, 0.94);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(2, 132, 199, 0.25);
}

.admin-reply-preview {
    padding: 10px 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.24);
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(241, 245, 249, 0.65);
}

.admin-reply-preview-text {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82rem;
}

.admin-reply-prefix {
    color: #0369a1;
    margin-right: 5px;
}

#admin-ticket-chat-reply-name {
    font-weight: 700;
}

.admin-reply-cancel {
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    padding: 5px;
}

.admin-attachment-tray {
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.78);
    padding: 10px;
    display: grid;
    gap: 8px;
    max-height: 190px;
    overflow: auto;
}

.admin-attachment-item {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.admin-attachment-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
}

.admin-attachment-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.14);
    color: #475569;
}

.admin-attachment-name {
    font-size: 0.8rem;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-attachment-sub {
    font-size: 0.72rem;
    color: #64748b;
}

.admin-upload-progress {
    margin-top: 5px;
    height: 4px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.admin-upload-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
    transition: width 0.15s ease;
}

.admin-attachment-remove {
    border: 0;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
    cursor: pointer;
}

.admin-attachment-item.error .admin-upload-progress span {
    background: #ef4444;
}

.ticket-msg-inner {
    position: relative;
}

.ticket-msg-inner .msg-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity .16s ease;
    pointer-events: none;
}

.ticket-msg-inner:hover .msg-actions {
    opacity: 1;
}

.ticket-msg-inner .msg-actions button {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.95);
    color: #334155;
    cursor: pointer;
    pointer-events: auto;
}

.ticket-msg-text,
.ticket-msg-name,
.ticket-msg-time,
.ticket-msg-role,
.admin-file-name,
.admin-file-sub {
    user-select: text;
    -webkit-user-select: text;
}

.admin-msg-image-btn {
    display: block;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: zoom-in;
    max-width: 100%;
    text-align: left;
}

.admin-msg-image-btn img {
    display: block;
    max-width: min(260px, 100%);
    max-height: 240px;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

.admin-file-card {
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 28px 1fr auto auto;
    align-items: center;
    gap: 10px;
    margin-top: 7px;
}

.admin-file-icon {
    color: #475569;
}

.admin-file-name {
    font-size: 0.82rem;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-file-sub {
    font-size: 0.72rem;
    color: #64748b;
}

.admin-file-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #075985;
    background: rgba(186, 230, 253, 0.6);
    border: 1px solid rgba(125, 211, 252, 0.8);
    border-radius: 999px;
    padding: 2px 7px;
}

.admin-file-download {
    font-size: 0.75rem;
    color: #0369a1;
    text-decoration: none;
    border: 1px solid rgba(14, 165, 233, 0.35);
    border-radius: 8px;
    padding: 4px 8px;
}

.msg-reply-context {
    border: 0;
    width: 100%;
    text-align: left;
    margin-bottom: 8px;
    border-left: 3px solid rgba(14, 165, 233, 0.7);
    background: rgba(240, 249, 255, 0.85);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 0.76rem;
    color: #0f172a;
    cursor: pointer;
}

.admin-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 13000;
    background: rgba(2, 6, 23, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.admin-image-viewer img {
    max-width: min(92vw, 1200px);
    max-height: 88vh;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.4);
}

.admin-image-viewer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: 0;
    border-radius: 999px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    cursor: pointer;
}

/* ===== Internal Admin Chat (admin tab only) ===== */
#admin-tab-chat .admin-internal-chat {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.78));
}

#admin-tab-chat .admin-internal-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.74);
}

#admin-chat-access-denied {
    margin: 14px 18px 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(248, 113, 113, 0.42);
    background: rgba(254, 242, 242, 0.9);
    color: #b91c1c;
    font-size: 0.82rem;
}

#admin-tab-chat #admin-chat-messages {
    position: relative;
    user-select: text;
    -webkit-user-select: text;
}

.admin-chat-members-head {
    position: sticky;
    top: 0;
    z-index: 4;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    padding: 6px 0 10px;
    background: rgba(255, 255, 255, 0.88);
}

.admin-chat-member-row {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.84);
    padding: 8px;
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.admin-chat-member-row img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.admin-chat-member-row strong {
    color: #0f172a;
    font-size: 0.82rem;
}

.admin-chat-member-row span {
    color: #64748b;
    font-size: 0.72rem;
}

.admin-chat-empty,
.admin-chat-error {
    padding: 18px 12px;
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    text-align: center;
    color: #64748b;
    background: rgba(255, 255, 255, 0.74);
}

.admin-chat-error {
    color: #b91c1c;
    border-style: solid;
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(254, 242, 242, 0.86);
}

.admin-room-msg {
    display: flex;
    margin-bottom: 12px;
}

.admin-room-msg--me {
    justify-content: flex-end;
}

.admin-room-msg--them {
    justify-content: flex-start;
}

.admin-room-msg-inner {
    position: relative;
    width: min(72%, 820px);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 12px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.admin-room-msg--me .admin-room-msg-inner {
    border-color: rgba(14, 165, 233, 0.34);
    background: linear-gradient(180deg, rgba(224, 242, 254, 0.92), rgba(240, 249, 255, 0.94));
}

.admin-room-msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-bottom: 6px;
}

.admin-room-msg-avatar img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.28);
    object-fit: cover;
}

.admin-room-msg-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: #0f172a;
    max-width: 190px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-room-msg-time {
    font-size: 0.7rem;
    color: #64748b;
}

.admin-room-role {
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.admin-room-role.role-admin {
    background: rgba(56, 189, 248, 0.2);
    color: #075985;
}

.admin-room-role.role-super_admin {
    background: rgba(99, 102, 241, 0.2);
    color: #3730a3;
}

.admin-room-msg-text {
    margin: 0;
    color: #0f172a;
    line-height: 1.45;
    font-size: 0.86rem;
    overflow-wrap: anywhere;
    user-select: text;
    -webkit-user-select: text;
}

.admin-room-msg-inner .msg-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity .16s ease;
    pointer-events: none;
}

.admin-room-msg-inner:hover .msg-actions,
.admin-room-msg-inner:focus-within .msg-actions {
    opacity: 1;
}

.admin-room-msg-inner .msg-actions .msg-reply-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.95);
    color: #334155;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.admin-room-msg-inner .msg-actions .msg-delete-btn:hover {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.35);
}

.admin-room-reply-context {
    width: 100%;
    border: 0;
    text-align: left;
    margin-bottom: 8px;
    border-left: 3px solid rgba(14, 165, 233, 0.65);
    background: rgba(240, 249, 255, 0.86);
    border-radius: 8px;
    color: #0f172a;
    font-size: 0.75rem;
    padding: 6px 8px;
    cursor: pointer;
}

#admin-chat-new-messages {
    bottom: 110px;
}

.skeleton .skeleton-line {
    height: 9px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(226, 232, 240, 0.8), rgba(203, 213, 225, 0.7), rgba(226, 232, 240, 0.8));
    animation: admin-skeleton 1.2s infinite linear;
    margin: 6px 0;
}

.skeleton .skeleton-line.short {
    width: 52%;
}

.skeleton .skeleton-line.tiny {
    width: 36%;
}

@keyframes admin-skeleton {
    0% {
        background-position: -180px 0;
    }

    100% {
        background-position: 220px 0;
    }
}

@media (max-width: 900px) {
    .admin-ticket-inbox-toolbar {
        position: static;
    }

    .admin-users-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-users-search {
        width: 100%;
    }

    .admin-users-pagination {
        justify-content: space-between;
    }

    .admin-new-messages-pill {
        bottom: 184px;
    }

    .admin-file-card {
        grid-template-columns: 26px 1fr;
    }

    .admin-file-badge,
    .admin-file-download {
        justify-self: start;
    }

    .admin-room-msg-inner {
        width: min(92%, 820px);
    }
}

/* =========================================================
   Liquid Glass Pass - Admin (Light Only)
   ========================================================= */

body[data-page="admin"] {
  color: var(--text-primary);
}

body[data-page="admin"] .admin-container {
  gap: 22px;
}

body[data-page="admin"] .admin-sidebar,
body[data-page="admin"] .admin-content,
body[data-page="admin"] .admin-sidebar-profile,
body[data-page="admin"] .admin-panel .lg-glass-card,
body[data-page="admin"] .admin-users-panel,
body[data-page="admin"] .admin-chat-viewer,
body[data-page="admin"] .admin-internal-chat,
body[data-page="admin"] .finalize-modal-card,
body[data-page="admin"] .block-modal {
  background: var(--theme-surface-shell);
  border: 1px solid var(--theme-border-soft);
  box-shadow: var(--theme-shadow-soft);
}

body[data-page="admin"] .admin-tab {
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text-secondary);
  background: transparent;
}

body[data-page="admin"] .admin-tab:hover {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-soft);
}

body[data-page="admin"] .admin-tab.active {
  background: linear-gradient(145deg, rgba(29, 125, 242, 0.2), rgba(29, 125, 242, 0.1));
  color: var(--accent-blue-strong);
  border-color: rgba(29, 125, 242, 0.34);
  box-shadow: 0 12px 24px rgba(29, 125, 242, 0.2);
}

body[data-page="admin"] .admin-ticket-search,
body[data-page="admin"] .admin-users-search {
  background: var(--theme-surface-elevated);
  border: 1px solid var(--theme-border);
  border-radius: 14px;
}

body[data-page="admin"] .admin-ticket-toolbar-meta,
body[data-page="admin"] .admin-gallery-toolbar-meta {
  color: var(--theme-text-dim);
}

body[data-page="admin"] .admin-gallery-toolbar {
  background: var(--theme-surface-soft);
  border: 1px solid var(--theme-border);
  border-radius: 14px;
}

body[data-page="admin"] .admin-ticket-filter-pills button {
  background: var(--theme-surface-soft);
  border: 1px solid var(--theme-border);
  color: var(--theme-text);
}

body[data-page="admin"] .admin-ticket-filter-pills button.active {
  background: rgba(29, 125, 242, 0.15);
  border-color: rgba(29, 125, 242, 0.35);
  color: var(--accent-blue-strong);
}

body[data-page="admin"] .admin-ticket-row,
body[data-page="admin"] .admin-ticket-card,
body[data-page="admin"] .admin-ticket-card-closed,
body[data-page="admin"] .admin-users-row,
body[data-page="admin"] .admin-chat-member-row,
body[data-page="admin"] .admin-user-row {
  background: var(--theme-surface-elevated);
  border: 1px solid var(--theme-border);
  border-radius: 14px;
}

body[data-page="admin"] .admin-user-avatar img {
  background: var(--theme-surface-elevated);
}

body[data-page="admin"] .admin-ticket-row.selected,
body[data-page="admin"] .admin-ticket-card.selected,
body[data-page="admin"] .admin-users-row.selected {
  border-color: rgba(29, 125, 242, 0.4);
  box-shadow: inset 0 0 0 1px rgba(29, 125, 242, 0.2), 0 12px 24px rgba(29, 125, 242, 0.14);
}

body[data-page="admin"] .admin-chat-header,
body[data-page="admin"] .admin-chat-subheader,
body[data-page="admin"] .admin-internal-chat-header {
  background: var(--theme-surface-soft);
  border-bottom: 1px solid var(--theme-border);
}

body[data-page="admin"] .admin-ticket-chat-body,
body[data-page="admin"] #admin-chat-messages {
  background: transparent;
}

body[data-page="admin"] .ticket-msg,
body[data-page="admin"] .admin-chat-message {
  width: 100%;
}

body[data-page="admin"] .ticket-msg-inner,
body[data-page="admin"] .admin-chat-bubble {
  background: var(--theme-surface-elevated);
  border: 1px solid var(--theme-border);
  box-shadow: var(--theme-shadow-soft);
}

body[data-page="admin"] .ticket-msg.self .ticket-msg-inner,
body[data-page="admin"] .admin-chat-message.own .admin-chat-bubble {
  background: linear-gradient(145deg, rgba(29, 125, 242, 0.19), rgba(29, 125, 242, 0.1));
  border-color: rgba(29, 125, 242, 0.34);
}

/* Light mode: fix white text on light bubble backgrounds */
body[data-page="admin"] .ticket-msg--me .ticket-msg-inner {
  color: var(--theme-text-strong);
}

body[data-page="admin"] .ticket-msg--me .ticket-msg-time {
  color: var(--theme-text-muted);
}

body[data-page="admin"] .ticket-msg-inner,
body[data-page="admin"] .admin-chat-bubble {
  position: relative;
}

body[data-page="admin"] .ticket-msg-inner .msg-actions,
body[data-page="admin"] .admin-chat-bubble .msg-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

body[data-page="admin"] .ticket-msg-inner:hover .msg-actions,
body[data-page="admin"] .ticket-msg-inner:focus-within .msg-actions,
body[data-page="admin"] .admin-chat-bubble:hover .msg-actions,
body[data-page="admin"] .admin-chat-bubble:focus-within .msg-actions {
  opacity: 1;
  transform: translateY(0);
}

body[data-page="admin"] .ticket-msg-inner .msg-actions button,
body[data-page="admin"] .admin-chat-bubble .msg-actions button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--theme-border);
  background: var(--theme-surface-elevated);
  color: var(--theme-text);
  box-shadow: 0 8px 16px rgba(119, 149, 197, 0.12);
}

body[data-page="admin"] .ticket-msg-inner .msg-actions button:hover,
body[data-page="admin"] .admin-chat-bubble .msg-actions button:hover {
  border-color: rgba(29, 125, 242, 0.4);
}

body[data-page="admin"] .admin-reply-preview,
body[data-page="admin"] .msg-reply-context {
  background: var(--theme-surface-tint);
  border: 1px solid var(--theme-border-strong);
}

body[data-page="admin"] .admin-chat-input-area {
  position: sticky;
  bottom: 0;
  background: var(--theme-surface-shell);
  border-top: 1px solid var(--theme-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body[data-page="admin"] .admin-chat-input-area input,
body[data-page="admin"] .admin-chat-input-area textarea {
  background: var(--theme-surface-elevated);
}

body[data-page="admin"] #admin-chat-new-messages,
body[data-page="admin"] #admin-ticket-new-messages {
  background: linear-gradient(145deg, var(--accent-blue), var(--accent-blue-strong));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 20px rgba(29, 125, 242, 0.3);
}

body[data-page="admin"] .admin-chat-access-state,
body[data-page="admin"] .admin-empty-state,
body[data-page="admin"] .admin-users-empty {
  background: var(--theme-surface-soft);
  border: 1px dashed var(--theme-border);
  border-radius: 14px;
}

body[data-page="admin"] .admin-attachment-tray,
body[data-page="admin"] .admin-file-chip,
body[data-page="admin"] .admin-image-chip {
  background: var(--theme-surface-soft);
  border: 1px solid var(--theme-border);
  border-radius: 14px;
}

body[data-page="admin"] .modal-overlay {
  background: var(--theme-overlay);
}

@media (max-width: 1024px) {
  body[data-page="admin"] .admin-container {
    gap: 14px;
  }

  body[data-page="admin"] .admin-sidebar,
  body[data-page="admin"] .admin-content {
    border-radius: 18px;
  }
}

/* =========================================================
   News Image Upload (Admin)
   ========================================================= */
body[data-page="admin"] .news-image-upload {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body[data-page="admin"] .news-image-dropzone {
  border: 1px dashed rgba(29, 125, 242, 0.34);
  border-radius: 16px;
  background: var(--theme-surface-elevated);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

body[data-page="admin"] .news-image-dropzone:hover,
body[data-page="admin"] .news-image-dropzone.news-drop-active {
  border-color: rgba(29, 125, 242, 0.54);
  box-shadow: 0 10px 24px rgba(29, 125, 242, 0.16);
  transform: translateY(-1px);
}

body[data-page="admin"] .news-image-dropzone-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(29, 125, 242, 0.12);
  color: var(--accent-blue-strong);
}

body[data-page="admin"] .news-image-dropzone-title {
  font-weight: 600;
  color: var(--text-primary);
}

body[data-page="admin"] .news-image-dropzone-sub {
  color: var(--text-secondary);
  font-size: 0.83rem;
}

body[data-page="admin"] .news-image-preview-wrap {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(247, 251, 255, 0.78));
  padding: 12px;
}

body[data-page="admin"] .news-image-preview-wrap img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  background: rgba(241, 245, 249, 0.9);
}

body[data-page="admin"] .news-image-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

body[data-page="admin"] .news-image-preview-meta span {
  color: var(--text-secondary);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="admin"] .news-image-progress {
  margin-top: 8px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.22);
}

body[data-page="admin"] .news-image-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--accent-blue), var(--accent-blue-strong));
  transition: width 0.15s ease;
}

body[data-page="admin"] #news-admin-image-status {
  margin-top: 8px;
}

/* =========================================================
   Admin Internal Chat - Outgoing/Incoming Color Guardrails
   ========================================================= */
body[data-page="admin"] .admin-chat #admin-chat-messages {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row {
  width: 100%;
  display: flex;
}

body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row.outgoing {
  justify-content: flex-end;
}

body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row.incoming {
  justify-content: flex-start;
}

body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row .message-bubble {
  display: block;
  min-width: 120px;
  max-width: 70%;
  border-radius: 16px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row.outgoing .message-bubble {
  background: linear-gradient(180deg, rgba(0, 140, 255, 0.22), rgba(0, 140, 255, 0.12));
  border: 1px solid rgba(0, 140, 255, 0.35);
  color: rgba(0, 0, 0, 0.88);
}

body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row.outgoing .admin-room-msg-name,
body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row.outgoing .admin-room-msg-time,
body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row.outgoing .admin-room-msg-text,
body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row.outgoing .admin-room-role {
  color: rgba(0, 0, 0, 0.88);
}

body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row.outgoing .admin-room-role {
  background: rgba(0, 140, 255, 0.18);
  border: 1px solid rgba(0, 140, 255, 0.3);
}

body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row.outgoing .admin-room-msg-avatar img {
  border-color: rgba(255, 255, 255, 0.5);
}

body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row.incoming .message-bubble {
  background: rgba(255, 255, 255, 0.78);
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

@media (max-width: 900px) {
  body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row .message-bubble {
    max-width: 90%;
  }
}

/* =========================================
   ADMIN SUPPORT TICKET ROW STYLES
   ========================================= */
.admin-ticket-row-avatar {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================
   Admin Support Chat Parity
   ========================================= */
body[data-page="admin"] #admin-support-chat-messages {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

body[data-page="admin"] #admin-support-chat-messages > .msg-row {
  width: 100%;
  display: flex;
}

body[data-page="admin"] #admin-support-chat-messages > .msg-row.outgoing {
  justify-content: flex-end;
}

body[data-page="admin"] #admin-support-chat-messages > .msg-row.incoming {
  justify-content: flex-start;
}

body[data-page="admin"] #admin-support-chat-messages > .msg-row > .ticket-msg {
  display: block;
  width: auto;
  max-width: min(520px, 72%);
  min-width: 180px;
  flex: 0 1 auto;
  margin: 0;
}

body[data-page="admin"] #admin-support-chat-messages > .msg-row > .ticket-msg .message-bubble,
body[data-page="admin"] #admin-support-chat-messages > .msg-row > .ticket-msg .ticket-msg-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-width: 180px;
  padding: 12px 16px;
  border-radius: 18px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg--me .ticket-msg-inner {
  background: linear-gradient(145deg, rgba(29, 125, 242, 0.19), rgba(29, 125, 242, 0.1));
  border-color: rgba(29, 125, 242, 0.34);
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-right: 36px;
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg--me .ticket-msg-header {
  justify-content: flex-end;
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg-avatar img,
body[data-page="admin"] #admin-support-chat-messages .ticket-msg-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(226, 232, 240, 0.95);
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg--me .ticket-msg-meta {
  align-items: flex-end;
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg-time {
  font-size: 0.71rem;
  color: #64748b;
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg-text,
body[data-page="admin"] #admin-support-chat-messages .ticket-msg-file-name,
body[data-page="admin"] #admin-support-chat-messages .ticket-msg-file-click {
  user-select: text;
  -webkit-user-select: text;
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg-image {
  margin-top: 8px;
  max-width: 100%;
  border-radius: 12px;
  display: block;
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg-file {
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.96);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg-file-icon,
body[data-page="admin"] #admin-support-chat-messages .ticket-msg-file-dl {
  color: #475569;
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg-file-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}

body[data-page="admin"] #admin-support-chat-messages .ticket-msg-file-click {
  font-size: 0.74rem;
  color: #64748b;
}

body[data-page="admin"] #admin-support-chat-messages .msg-reply-context {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 260px;
  padding: 6px 10px;
  border-radius: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page="admin"] #admin-support-chat-form.is-disabled {
  opacity: 0.62;
}

@media (max-width: 900px) {
  body[data-page="admin"] #admin-support-chat-messages > .msg-row > .ticket-msg,
  body[data-page="admin"] #admin-support-chat-messages > .msg-row > .ticket-msg .message-bubble,
  body[data-page="admin"] #admin-support-chat-messages > .msg-row > .ticket-msg .ticket-msg-inner {
    max-width: 90%;
    min-width: 0;
    width: 100%;
  }

  body[data-page="admin"] #admin-support-chat-messages .msg-reply-context {
    max-width: 200px;
  }
}

.admin-ticket-row-avatar img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.admin-ticket-row-avatar-fallback {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(99, 102, 241, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.admin-ticket-row-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-ticket-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.admin-ticket-row-user {
  font-weight: 600;
  font-size: 0.82rem;
  color: rgba(15, 23, 42, 0.88);
}

.admin-ticket-row-time {
  font-size: 0.7rem;
  color: rgba(100, 116, 139, 0.7);
  white-space: nowrap;
}

.admin-ticket-row-subject {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(15, 23, 42, 0.72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-ticket-row-preview {
  font-size: 0.72rem;
  color: rgba(100, 116, 139, 0.65);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   DELETE MESSAGE BUTTON
   ============================================================ */
.msg-delete-btn i {
  color: rgba(224, 49, 69, 0.72);
}

.msg-delete-btn:hover {
  border-color: rgba(224, 49, 69, 0.38) !important;
}

.msg-delete-btn:hover i {
  color: #e03145;
}

/* Deleted message placeholder */
.ticket-msg--deleted .ticket-msg-inner {
  opacity: 0.48;
  pointer-events: none;
}

.ticket-msg-deleted-label {
  margin: 0;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: rgba(100, 116, 139, 0.7);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   USER ROW — BAN / UNBAN
   ============================================================ */
.admin-user-banned-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e03145;
  background: rgba(224, 49, 69, 0.1);
  border: 1px solid rgba(224, 49, 69, 0.24);
  border-radius: 999px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.admin-user-actions {
  margin-left: auto;
  flex-shrink: 0;
}

.admin-user-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
  white-space: nowrap;
}

.admin-user-action-btn:active {
  transform: scale(0.96);
}

.admin-user-ban-btn {
  background: rgba(224, 49, 69, 0.09);
  color: #e03145;
  border-color: rgba(224, 49, 69, 0.22);
}

.admin-user-ban-btn:hover {
  background: rgba(224, 49, 69, 0.16);
  border-color: rgba(224, 49, 69, 0.4);
}

.admin-user-unban-btn {
  background: rgba(19, 163, 101, 0.09);
  color: #13a365;
  border-color: rgba(19, 163, 101, 0.22);
}

.admin-user-unban-btn:hover {
  background: rgba(19, 163, 101, 0.16);
  border-color: rgba(19, 163, 101, 0.4);
}

/* =====================================================
   MOBILE EXCELLENCE — ADMIN IMPROVEMENTS
   ===================================================== */

/* Admin container — tighter top margin on very small phones */
@media (max-width: 900px) {
    .admin-container {
        margin: 76px 8px 8px;
    }

    /* Admin sidebar — compact scrollable horizontal row */
    .admin-sidebar {
        max-height: none;
        height: auto;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 6px 10px;
        border-radius: 18px;
        margin-bottom: 12px;
    }
    .admin-sidebar::-webkit-scrollbar { display: none; }

    /* Tabs that sit inside the sidebar on mobile */
    .admin-tabs-row,
    .admin-sidebar-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 4px;
    }
    .admin-tabs-row::-webkit-scrollbar,
    .admin-sidebar-tabs::-webkit-scrollbar { display: none; }

    /* Split panes — use dvh if supported */
    .admin-split-left {
        height: 38vh;
    }
    .admin-split-right {
        height: 58vh;
    }
    @supports (height: 100dvh) {
        .admin-split-left  { height: 38dvh; }
        .admin-split-right { height: 58dvh; }
        .admin-content     { height: 76dvh; }
    }

    /* Admin chat form — sticky bottom with safe area */
    .admin-chat-form,
    #admin-chat-form,
    .admin-room-chat-form {
        position: sticky;
        bottom: 0;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        background: var(--lg-glass-bg, rgba(255,255,255,0.92));
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        z-index: 10;
    }

    /* Users toolbar on mobile */
    .admin-users-toolbar {
        gap: 10px;
    }
    .admin-users-search input {
        width: 100%;
        font-size: 16px; /* prevent iOS zoom */
    }

    /* User list items — bigger touch target */
    .admin-user-item {
        min-height: 60px;
        padding: 12px;
    }
    .admin-user-action-btn {
        min-height: 36px;
        padding: 6px 14px;
    }

    /* Notification dropdown — full width on tiny screens */
    .admin-notif-dropdown {
        position: fixed;
        top: auto;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 8px;
        right: 8px;
        width: auto;
        max-height: 60vh;
        border-radius: 20px;
    }
    @supports (height: 100dvh) {
        .admin-notif-dropdown {
            max-height: 60dvh;
        }
    }
}

/* Admin on very small screens — reduce internal spacing */
@media (max-width: 480px) {
    .admin-container {
        margin: 70px 6px 6px;
    }

    .admin-ticket-inbox-toolbar,
    .admin-users-toolbar {
        padding: 10px;
        gap: 8px;
    }

    .admin-split-left {
        height: 36vh;
    }
    .admin-split-right {
        height: 56vh;
    }

    /* Message bubbles — nearly full width */
    body[data-page="admin"] .admin-chat #admin-chat-messages .msg-row .message-bubble {
        max-width: 94%;
    }
}

/* Admin nav actions — touch-friendly icon buttons */
@media (max-width: 768px) {
    .admin-nav-actions button,
    .admin-nav-actions a {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .admin-topbar-right {
        gap: 8px;
    }
}

@media (max-width: 900px) {
    body[data-page="admin"] .admin-container {
        margin: 84px 12px 12px;
        gap: 12px;
        height: auto;
        min-height: calc(100vh - 96px);
    }

    @supports (height: 100dvh) {
        body[data-page="admin"] .admin-container {
            min-height: calc(100dvh - 96px);
        }
    }

    body[data-page="admin"] .admin-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 14px;
        max-height: none;
        overflow: visible;
    }

    body[data-page="admin"] .admin-sidebar-profile {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    body[data-page="admin"] .admin-nav-group {
        margin: 0;
        padding: 12px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.42);
        border: 1px solid rgba(255, 255, 255, 0.55);
    }

    body[data-page="admin"] .admin-content,
    body[data-page="admin"] .admin-panel.active {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    body[data-page="admin"] .admin-split-layout {
        grid-template-columns: 1fr;
        gap: 12px;
        height: auto;
        overflow: visible;
    }

    body[data-page="admin"] .admin-split-left,
    body[data-page="admin"] .admin-split-right {
        height: auto;
        min-height: 0;
        overflow: visible;
        border: none;
    }

    body[data-page="admin"] #admin-open-groups,
    body[data-page="admin"] #admin-support-list,
    body[data-page="admin"] #admin-closed-list,
    body[data-page="admin"] #admin-chat-members {
        max-height: min(42vh, 360px);
        overflow: auto;
        border-radius: 18px;
    }

    @supports (height: 100dvh) {
        body[data-page="admin"] #admin-open-groups,
        body[data-page="admin"] #admin-support-list,
        body[data-page="admin"] #admin-closed-list,
        body[data-page="admin"] #admin-chat-members {
            max-height: min(42dvh, 360px);
        }
    }

    body[data-page="admin"] .admin-right-flex {
        flex-direction: column;
        gap: 12px;
        overflow: visible;
    }

    body[data-page="admin"] .admin-chat-viewer,
    body[data-page="admin"] .admin-internal-chat {
        min-height: min(68vh, 820px);
        border-radius: 20px;
        overflow: hidden;
    }

    @supports (height: 100dvh) {
        body[data-page="admin"] .admin-chat-viewer,
        body[data-page="admin"] .admin-internal-chat {
            min-height: min(68dvh, 820px);
        }
    }

    body[data-page="admin"] .admin-chat-header,
    body[data-page="admin"] .admin-chat-subheader,
    body[data-page="admin"] .admin-users-toolbar,
    body[data-page="admin"] .admin-users-pagination,
    body[data-page="admin"] .admin-chat-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    body[data-page="admin"] .admin-chat-badges {
        display: flex;
        flex-wrap: wrap;
    }

    body[data-page="admin"] .admin-chat-actions {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        padding: 12px 16px 16px;
    }

    body[data-page="admin"] .admin-chat-actions > div {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    body[data-page="admin"] .admin-chat-input-area {
        padding: 12px;
    }

    body[data-page="admin"] .admin-ticket-filter-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    body[data-page="admin"] .admin-ticket-filter-pills::-webkit-scrollbar {
        display: none;
    }

    body[data-page="admin"] .admin-ticket-filter-pills button {
        flex: 0 0 auto;
        min-height: 40px;
    }

    body[data-page="admin"] .admin-mobile-back {
        display: inline-flex;
    }

    body[data-page="admin"] #admin-open-layout.mobile-chat-active .admin-split-left,
    body[data-page="admin"] #admin-support-layout.mobile-chat-active .admin-split-left {
        display: none;
    }

    body[data-page="admin"] #admin-open-layout.mobile-chat-active .admin-split-right,
    body[data-page="admin"] #admin-support-layout.mobile-chat-active .admin-split-right {
        min-height: min(72vh, 860px);
    }

    @supports (height: 100dvh) {
        body[data-page="admin"] #admin-open-layout.mobile-chat-active .admin-split-right,
        body[data-page="admin"] #admin-support-layout.mobile-chat-active .admin-split-right {
            min-height: min(72dvh, 860px);
        }
    }
}

@media (max-width: 640px) {
    body[data-page="admin"] .admin-sidebar {
        grid-template-columns: 1fr;
    }

    body[data-page="admin"] .admin-content {
        padding: 0;
    }

    body[data-page="admin"] .admin-chat-header,
    body[data-page="admin"] .admin-chat-subheader {
        padding-left: 14px;
        padding-right: 14px;
    }

    body[data-page="admin"] .admin-ticket-search input,
    body[data-page="admin"] .admin-users-search input,
    body[data-page="admin"] #admin-ticket-chat-input,
    body[data-page="admin"] #admin-support-chat-input,
    body[data-page="admin"] #admin-chat-input {
        font-size: 16px;
    }

    body[data-page="admin"] .admin-gallery-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    body[data-page="admin"] .admin-gallery-toolbar-meta {
        text-align: right;
    }
}

.admin-notif-settings {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 220, 255, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(56, 189, 248, 0.06));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.admin-notif-settings__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.admin-notif-settings__title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #f8fbff;
}

.admin-notif-settings__sub {
    font-size: 0.75rem;
    line-height: 1.45;
    color: rgba(214, 234, 255, 0.7);
}

.admin-email-notif-status {
    margin-top: 10px;
    color: rgba(214, 234, 255, 0.82);
}

.admin-email-notif-status[data-state="error"] {
    color: #fca5a5;
}

.admin-ticket-alert-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(14, 165, 233, 0.18);
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.96), rgba(240, 249, 255, 0.92));
    box-shadow: 0 16px 28px rgba(14, 165, 233, 0.12);
}

.admin-ticket-alert-strip__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.admin-ticket-alert-strip__label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #075985;
}

.admin-ticket-alert-strip__count {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}

.admin-ticket-row.has-unread {
    border-color: rgba(14, 165, 233, 0.28);
    background: linear-gradient(180deg, rgba(240, 249, 255, 0.98), rgba(255, 255, 255, 0.94));
}

.admin-ticket-user-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.admin-ticket-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #0284c7;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
    flex-shrink: 0;
}

.admin-msg-image-wrap {
    margin-top: 7px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-msg-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-file-download {
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
}

.admin-saved-gallery-block {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.admin-saved-gallery-block__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.admin-saved-gallery-grid {
    min-height: 0;
}

.admin-saved-gallery-card {
    border-color: rgba(14, 165, 233, 0.18);
}

@media (max-width: 720px) {
    .admin-notif-settings,
    .admin-ticket-alert-strip,
    .admin-saved-gallery-block__head {
        flex-direction: column;
        align-items: stretch;
    }
}
