

.admin-dashboard-wrap {
    background: #0A0D15;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    margin-top: 10px;
}

.admin-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px;
    background: #0E131E;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 16px;
}

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

.admin-shield-icon {
    width: 32px;
    height: 32px;
    color: var(--gold-primary);
}

.admin-nav-tabs-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #0B0E17;
    border-bottom: 1px solid var(--border-subtle);
    width: 100%;
}

.admin-tab-scroll-btn {
    width: 34px;
    height: 48px;
    background: #0B0E17;
    border: none;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s;
    flex-shrink: 0;
}

.admin-tab-scroll-btn:hover {
    color: #F59E0B;
    background: rgba(255, 184, 0, 0.08);
}

.admin-tab-scroll-btn svg {
    width: 18px;
    height: 18px;
}

.admin-nav-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    white-space: nowrap;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 184, 0, 0.35) rgba(255, 255, 255, 0.03);
}

.admin-nav-tabs::-webkit-scrollbar {
    height: 5px;
    display: block;
}

.admin-nav-tabs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.admin-nav-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 184, 0, 0.35);
    border-radius: 999px;
}

.admin-nav-tabs::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

.admin-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.admin-tab-btn:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.05);
}

.admin-tab-btn.active {
    background: var(--gold-bg-subtle);
    border: 1px solid var(--gold-border);
    color: var(--gold-primary);
}

.admin-tab-btn svg {
    width: 17px;
    height: 17px;
}

.admin-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 24px 30px;
}

.admin-metric-card {
    background: #111624;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.metric-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 184, 0, 0.1);
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-icon-box svg {
    width: 24px;
    height: 24px;
}

.metric-info {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-white);
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

.admin-tab-panel {
    display: none;
    padding: 30px;
}

.admin-tab-panel.active {
    display: block;
}

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: #0D111A;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    text-align: left;
}

.admin-table th {
    background: #121826;
    padding: 14px 18px;
    color: var(--text-dim);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

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

.btn-icon-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #151C2C;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon-action:hover {
    color: var(--text-white);
    background: #1E283E;
    border-color: rgba(255, 184, 0, 0.3);
}

.btn-icon-action.action-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.3);
}

@media (max-width: 900px) {
    .admin-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.customer-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.customer-search-input-wrap input {
    padding-right: 70px;
}

.customer-input-badge {
    position: absolute;
    right: 12px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    background: #5865F2;
    color: #FFF;
    padding: 3px 8px;
    border-radius: 6px;
    pointer-events: none;
    letter-spacing: 0.5px;
}

.customer-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #0D121F;
    border: 1.5px solid rgba(255, 184, 0, 0.4);
    border-radius: var(--radius-md);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 184, 0, 0.15);
    max-height: 260px;
    overflow-y: auto;
    z-index: 1000;
    padding: 6px;
    scrollbar-width: thin;
}

.customer-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.customer-dropdown-item:last-child {
    border-bottom: none;
}

.customer-dropdown-item:hover,
.customer-dropdown-item.active {
    background: rgba(255, 184, 0, 0.12);
}

.customer-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.customer-item-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--border-medium);
    flex-shrink: 0;
}

.customer-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.customer-item-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-item-email {
    font-size: 0.75rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-role {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.badge-role-owner {
    background: linear-gradient(135deg, rgba(255, 184, 0, 0.25), rgba(168, 85, 247, 0.3));
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 10px rgba(255, 184, 0, 0.3);
}

.badge-role-admin {
    background: rgba(239, 68, 68, 0.18);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-role-vip {
    background: rgba(255, 184, 0, 0.18);
    color: var(--gold-primary);
    border: 1px solid rgba(255, 184, 0, 0.45);
}

.badge-role-member {
    background: rgba(56, 189, 248, 0.12);
    color: #38BDF8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-owner-only {
    font-size: 0.68rem;
    font-weight: 800;
    background: rgba(239, 68, 68, 0.2);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.owner-locked-card {
    background: #101420;
    border: 1.5px dashed rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    text-align: center;
    max-width: 600px;
    margin: 20px auto;
}

.owner-locked-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.owner-locked-icon svg {
    width: 30px;
    height: 30px;
}

.role-select-box {
    background: #111726;
    border: 1px solid var(--border-medium);
    color: var(--text-white);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
}

.role-select-box:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-chat-card {
    max-width: 680px;
    width: 95vw;
    max-height: min(92vh, 820px);
    height: auto;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    overflow: hidden;
    margin: auto;
}

.chat-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #0E1320;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chat-customer-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.chat-customer-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold-border);
    background: #1E2536;
}

.chat-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10B981;
    border: 2px solid #0D111A;
    box-shadow: 0 0 8px #10B981;
}

.chat-task-statusbar {
    background: #090C14;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.82rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

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

.chat-status-label {
    color: var(--text-dim);
}

.chat-progress-mini {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-left: 4px;
}

.chat-progress-mini div {
    height: 100%;
    background: var(--gold-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.admin-chat-messages-stream {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 180px;
    max-height: calc(92vh - 310px);
    background: #080B12;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 184, 0, 0.3) transparent;
}

.admin-chat-messages-stream::-webkit-scrollbar {
    width: 6px;
}
.admin-chat-messages-stream::-webkit-scrollbar-thumb {
    background: rgba(255, 184, 0, 0.25);
    border-radius: 4px;
}

.chat-msg-row {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    animation: fadeInMsg 0.2s ease-out;
}

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

.chat-msg-row.msg-customer {
    align-self: flex-start;
}

.chat-msg-row.msg-admin,
.chat-msg-row.msg-dev {
    align-self: flex-end;
}

.chat-msg-row.msg-system {
    align-self: center;
    max-width: 90%;
    margin: 6px 0;
}

.chat-msg-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    margin-bottom: 4px;
    color: var(--text-dim);
}

.chat-msg-row.msg-admin .chat-msg-header,
.chat-msg-row.msg-dev .chat-msg-header {
    justify-content: flex-end;
}

.chat-msg-bubble {
    padding: 10px 15px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.45;
    word-break: break-word;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.chat-msg-row.msg-customer .chat-msg-bubble {
    background: #171E2E;
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 3px;
}

.chat-msg-row.msg-admin .chat-msg-bubble,
.chat-msg-row.msg-dev .chat-msg-bubble {
    background: linear-gradient(135deg, #FFB800 0%, #D97706 100%);
    color: #000000;
    font-weight: 600;
    border-bottom-right-radius: 3px;
}

.chat-msg-row.msg-system .chat-msg-bubble {
    background: rgba(255, 184, 0, 0.08);
    border: 1px dashed rgba(255, 184, 0, 0.35);
    color: var(--gold-primary);
    font-size: 0.8rem;
    text-align: center;
    padding: 6px 14px;
    border-radius: 999px;
}

.chat-msg-time {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-msg-row.msg-admin .chat-msg-time,
.chat-msg-row.msg-dev .chat-msg-time {
    justify-content: flex-end;
}

.chat-msg-row.msg-customer .chat-msg-time {
    justify-content: flex-start;
}

.chat-msg-read {
    color: #60A5FA;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    letter-spacing: 0.2px;
}

.chat-quick-replies {
    display: flex;
    gap: 8px;
    padding: 8px 24px;
    background: #0A0D15;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}

.chat-quick-replies::-webkit-scrollbar {
    display: none;
}

.quick-reply-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: rgba(255, 184, 0, 0.15);
    color: var(--gold-primary);
    border-color: rgba(255, 184, 0, 0.35);
}

.chat-modal-footer {
    background: #0E1320;
    padding: 14px 24px;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.chat-input-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.chat-text-input {
    flex: 1;
    background: #131A29;
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-text-input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 12px rgba(255, 184, 0, 0.25);
}

.team-avatar-preview {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 184, 0, 0.4);
    background: #111624;
}

.btn-toggle-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-toggle-online.online {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10B981;
}

.btn-toggle-online.offline {
    background: rgba(100, 116, 139, 0.15);
    border-color: rgba(100, 116, 139, 0.4);
    color: #94A3B8;
}

.admin-ribbon-preview-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #0E131E;
    border: 1px dashed rgba(255, 184, 0, 0.3);
    border-radius: 10px;
}

.admin-ribbon-badge-tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.admin-discount-box {
    background: rgba(255, 184, 0, 0.04);
    border: 1px solid rgba(255, 184, 0, 0.25);
    border-radius: 12px;
    padding: 14px 18px;
    margin-top: 10px;
}

.admin-badge-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.admin-badge-type.type-1 {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #60A5FA;
}

.admin-badge-type.type-2 {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #A78BFA;
}

.admin-badge-type.type-3 {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #F59E0B;
}

.admin-badge-type.type-4 {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10B981;
}

.admin-limit-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #94A3B8;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
}

.admin-limit-pill.unlimited {
    background: rgba(16, 185, 129, 0.08);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.category-icon-display {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 184, 0, 0.1);
    border: 1px solid rgba(255, 184, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    overflow: hidden;
}

.category-icon-display img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.cat-emoji-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.cat-emoji-btn:hover {
    background: rgba(255, 184, 0, 0.15);
    border-color: rgba(255, 184, 0, 0.4);
    transform: scale(1.18);
    box-shadow: 0 4px 12px rgba(255, 184, 0, 0.2);
}

.cat-emoji-btn.active {
    background: rgba(255, 184, 0, 0.25);
    border-color: #F59E0B;
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(255, 184, 0, 0.35);
}

