/* ============================================
   TICKETS PAGE - Telegram-Style Chat 2025
   Full-screen Split Layout
============================================ */

/* Ограничиваем всю страницу когда открыты тикеты */
body:has(.tickets-page) {
    height: 100vh;
    overflow: hidden;
}

body:has(.tickets-page) main,
body:has(.tickets-page) #app {
    height: calc(100vh - 64px);
    overflow: hidden;
}

.tickets-page {
    position: relative;
    height: calc(100vh - 64px);;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0.95) 0%, 
        rgba(20, 10, 5, 0.98) 50%,
        rgba(0, 0, 0, 0.95) 100%
    );
    overflow: hidden;
}

/* ==================== LAYOUT ==================== */
.tickets-layout {
    display: flex;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

/* ==================== SIDEBAR ==================== */
.tickets-sidebar {
    width: 340px;
    min-width: 300px;
    flex-shrink: 0;
    background: rgba(15, 15, 15, 0.95);
    border-right: 1px solid rgba(255, 140, 66, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(20, 20, 20, 0.9);
    border-bottom: 1px solid rgba(255, 140, 66, 0.15);
}

.sidebar-header h1 {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FF8C42, #FFB347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.btn-new-ticket {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF8C42, #FFB347);
    color: #000;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-new-ticket:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(255, 140, 66, 0.4);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* Filters */
.sidebar-filters {
    display: flex;
    gap: 6px;
    padding: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    background: rgba(255, 140, 66, 0.15);
    border-color: rgba(255, 140, 66, 0.3);
}

.filter-pill.active {
    background: linear-gradient(135deg, #FF8C42, #FFB347);
    color: #000;
    border-color: transparent;
}

.filter-pill .count {
    display: inline-block;
    min-width: 20px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 4px;
}

/* Tickets List */
.tickets-list-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ticket-item {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.ticket-item:hover {
    background: rgba(255, 140, 66, 0.1);
}

.ticket-item.active {
    background: rgba(255, 140, 66, 0.15);
    border-left-color: #FF8C42;
}

.ticket-item.closed {
    opacity: 0.6;
}

.ticket-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ticket-id {
    font-size: 0.75rem;
    font-weight: 700;
    color: #FF8C42;
}

.ticket-status-dot {
    font-size: 0.7rem;
}

.ticket-time {
    margin-left: auto;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.ticket-item-subject {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.ticket-item-author {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.sidebar-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.sidebar-empty p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* ==================== CHAT AREA ==================== */
.tickets-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 10, 0.95);
    min-width: 0;
}

/* Empty State */
.chat-empty-state,
.chat-auth-required {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.chat-empty-state .empty-icon,
.chat-auth-required .auth-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.chat-empty-state h2,
.chat-auth-required h2 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 8px;
}

.chat-empty-state p,
.chat-auth-required p {
    color: rgba(255, 255, 255, 0.5);
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(20, 20, 20, 0.95);
    border-bottom: 1px solid rgba(255, 140, 66, 0.15);
    position: relative;
    min-height: 64px;
}

.btn-back-mobile {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.chat-header-info {
    flex: 1;
    min-width: 0;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.ticket-id-badge {
    font-size: 0.75rem;
    font-weight: 800;
    color: #FF8C42;
    background: rgba(255, 140, 66, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
}

.chat-subject {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
}

.status-badge.status-open { background: rgba(76, 175, 80, 0.2); color: #4CAF50; }
.status-badge.status-progress { background: rgba(255, 193, 7, 0.2); color: #FFC107; }
.status-badge.status-waiting { background: rgba(33, 150, 243, 0.2); color: #2196F3; }
.status-badge.status-closed { background: rgba(158, 158, 158, 0.2); color: #9E9E9E; }

.chat-author,
.chat-assigned {
    color: rgba(255, 255, 255, 0.6);
}

/* Info Toggle Button */
.btn-info-toggle {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-info-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* Legacy - keep for compatibility */
.btn-chat-menu {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-chat-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==================== TICKET ACTION BAR (2025+ Design) ==================== */
.ticket-action-bar {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(25, 25, 25, 0.95) 0%, rgba(18, 18, 18, 0.98) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
    align-items: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.action-btn:hover::before {
    width: 200%;
    height: 200%;
}

.action-btn:active {
    transform: scale(0.96);
}

.action-btn .btn-icon {
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

.action-btn .btn-text {
    display: inline;
    position: relative;
    z-index: 1;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Primary - Take ticket (Golden accent) */
.action-btn.primary {
    background: linear-gradient(135deg, #FF8C42 0%, #FFB347 100%);
    color: #1a1a1a;
    border: none;
    box-shadow: 
        0 2px 4px rgba(255, 140, 66, 0.2),
        0 4px 12px rgba(255, 140, 66, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 8px rgba(255, 140, 66, 0.3),
        0 8px 24px rgba(255, 140, 66, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.action-btn.primary:active {
    transform: translateY(0) scale(0.98);
}

/* Secondary - Status change, Transfer (Ghost style) */
.action-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Success - Close ticket (staff) - Soft green */
.action-btn.success {
    background: rgba(76, 175, 80, 0.12);
    color: #66BB6A;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.action-btn.success:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.35);
    color: #81C784;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.15);
}

/* Danger - Close ticket (player) - Soft red */
.action-btn.danger {
    background: rgba(239, 83, 80, 0.1);
    color: #EF5350;
    border: 1px solid rgba(239, 83, 80, 0.18);
}

.action-btn.danger:hover {
    background: rgba(239, 83, 80, 0.18);
    border-color: rgba(239, 83, 80, 0.3);
    color: #FF7043;
    box-shadow: 0 0 20px rgba(239, 83, 80, 0.12);
}

/* ==================== TICKET INFO PANEL ==================== */
.ticket-info-panel {
    padding: 12px 16px;
    background: rgba(15, 15, 15, 0.95);
    border-bottom: 1px solid rgba(255, 140, 66, 0.1);
    animation: slideDown 0.2s ease;
}

.ticket-info-panel.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.info-value {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Mobile responsive action bar */
@media (max-width: 768px) {
    .ticket-action-bar {
        padding: 8px 12px;
        gap: 6px;
    }
    
    .action-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        border-radius: 16px;
    }
    
    .action-btn .btn-text {
        display: none;
    }
    
    .action-btn .btn-icon {
        font-size: 1.05rem;
    }
    
    .info-grid {
        gap: 12px;
    }
}

/* Chat Menu Dropdown - Legacy */
.chat-menu {
    position: absolute;
    top: 100%;
    right: 16px;
    width: 220px;
    background: rgba(30, 30, 30, 0.98);
    border: 1px solid rgba(255, 140, 66, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.chat-menu.hidden {
    display: none;
}

.menu-item {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item.info {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    cursor: default;
}

.menu-item.action:hover {
    background: rgba(255, 140, 66, 0.15);
}

.menu-item.danger {
    color: #f44336;
}

.menu-item.danger:hover {
    background: rgba(244, 67, 54, 0.15);
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* Chat Attachments */
.chat-attachments {
    padding: 12px 20px;
    background: rgba(255, 140, 66, 0.05);
    border-bottom: 1px solid rgba(255, 140, 66, 0.1);
}

.attachments-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.attachments-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.attachment-thumb {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    position: relative;
}

.attachment-thumb:hover {
    transform: scale(1.05);
    border-color: #FF8C42;
    box-shadow: 0 4px 20px rgba(255, 140, 66, 0.3);
}

.attachment-thumb::after {
    content: '🔍';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.attachment-thumb:hover::after {
    opacity: 1;
}

.attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-thumb.video {
    font-size: 1.5rem;
}

.attachment-thumb.video::after {
    content: '▶️';
}

.attachment-file {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #FF8C42;
    font-size: 0.8rem;
    text-decoration: none;
}

/* ===== Image Lightbox ===== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.2s ease;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-overlay.active .lightbox-image {
    transform: scale(1);
}

.lightbox-zoom-indicator {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.lightbox-zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.lightbox-zoom-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-zoom-btn:hover {
    background: rgba(255, 140, 66, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: #FF8C42;
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: rgba(255, 140, 66, 0.5);
}

.lightbox-nav.prev {
    left: -70px;
}

.lightbox-nav.next {
    right: -70px;
}

.lightbox-counter {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.lightbox-download {
    position: absolute;
    top: -50px;
    left: 0;
    padding: 10px 20px;
    background: rgba(255, 140, 66, 0.2);
    border: 1px solid #FF8C42;
    border-radius: 8px;
    color: #FF8C42;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.lightbox-download:hover {
    background: #FF8C42;
    color: #000;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-nav.prev {
        left: 10px;
    }
    
    .lightbox-nav.next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .lightbox-download {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .lightbox-counter {
        position: absolute;
        bottom: 20px;
    }
}

/* ==================== MESSAGES ==================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-loading,
.chat-error {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
}

.no-messages {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 60px 20px;
}

/* Date Divider */
.date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
}

.date-divider span {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

/* Message Bubbles */
.chat-message {
    display: flex;
    gap: 10px;
    max-width: 80%;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.msg-mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.msg-system {
    align-self: center;
    max-width: 90%;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 140, 66, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
    max-width: 100%;
    word-wrap: break-word;
}

.msg-other .msg-bubble {
    background: rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
}

.msg-mine .msg-bubble {
    background: linear-gradient(135deg, rgba(255, 140, 66, 0.7), rgba(255, 140, 66, 0.5));
    border-bottom-right-radius: 4px;
}

.msg-system .msg-bubble {
    background: rgba(100, 100, 100, 0.3);
    font-style: italic;
    text-align: center;
}

.msg-author {
    font-size: 0.75rem;
    font-weight: 700;
    color: #FF8C42;
    margin-bottom: 4px;
}

.msg-author .staff-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(233, 30, 99, 0.3);
    color: #E91E63;
    border-radius: 4px;
    margin-left: 6px;
}

.msg-text {
    font-size: 0.95rem;
    color: #fff;
    line-height: 1.5;
}

.msg-text a.chat-link {
    color: #64B5F6;
    word-break: break-all;
}

.msg-time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: right;
    margin-top: 4px;
}

.msg-mine .msg-time {
    color: rgba(255, 255, 255, 0.6);
}

/* ==================== INPUT AREA ==================== */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(20, 20, 20, 0.95);
    border-top: 1px solid rgba(255, 140, 66, 0.15);
    transition: opacity 0.3s;
}

.chat-input-area.disabled {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.chat-input-area.disabled::after {
    content: '🔒';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    opacity: 0.5;
}

.btn-attach {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-attach:hover {
    background: rgba(255, 140, 66, 0.2);
    color: #FF8C42;
}

.chat-input-area textarea {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    color: #fff;
    font-size: 0.95rem;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    font-family: inherit;
}

.chat-input-area textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: rgba(255, 140, 66, 0.4);
}

.btn-send {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF8C42, #FFB347);
    color: #000;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 140, 66, 0.4);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Closed/No Access */
.chat-closed-banner,
.chat-no-access {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(100, 100, 100, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.btn-take-inline {
    padding: 8px 16px;
    background: linear-gradient(135deg, #FF8C42, #FFB347);
    color: #000;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-take-inline:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 140, 66, 0.4);
}

.btn-rate {
    padding: 8px 16px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-rate:hover {
    transform: scale(1.05);
}

.rating-stars {
    color: #FFD700;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

/* ==================== MODALS ==================== */
.tickets-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.tickets-modal-overlay.hidden {
    display: none;
}

.tickets-modal {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: rgba(25, 25, 25, 0.98);
    border: 1px solid rgba(255, 140, 66, 0.2);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: rgba(20, 20, 20, 0.9);
    border-bottom: 1px solid rgba(255, 140, 66, 0.15);
}

.modal-header h2 {
    font-size: 1.2rem;
    color: #fff;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.hidden {
    display: none;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 140, 66, 0.5);
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: #1a1a1a;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* File Drop */
.file-drop-zone {
    border: 2px dashed rgba(255, 140, 66, 0.3);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: #FF8C42;
    background: rgba(255, 140, 66, 0.1);
}

.drop-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-preview-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.file-icon {
    font-size: 1.2rem;
}

.file-name {
    flex: 1;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-remove {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    font-size: 0.8rem;
    cursor: pointer;
}

.file-remove:hover {
    background: rgba(244, 67, 54, 0.4);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Transfer Modal */
.transfer-overlay,
.rating-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 20px;
}

.transfer-modal,
.rating-modal {
    background: rgba(25, 25, 25, 0.98);
    border: 1px solid rgba(255, 140, 66, 0.2);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.transfer-modal h3,
.rating-modal h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 20px;
}

.transfer-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.transfer-select option {
    background: #1a1a1a;
}

.transfer-actions,
.rating-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Rating Stars */
.star-rating {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.star-rating .star {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.star-rating .star:hover,
.star-rating .star.active {
    color: #FFD700;
    transform: scale(1.1);
}

.rating-modal textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    resize: none;
    height: 80px;
    margin-bottom: 20px;
}

/* Buttons */
.btn-tickets-primary,
.btn-tickets-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tickets-primary {
    background: linear-gradient(135deg, #FF8C42, #FFB347);
    color: #000;
}

.btn-tickets-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 140, 66, 0.4);
}

.btn-tickets-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.btn-tickets-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Notification */
.ticket-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: rgba(40, 40, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 0.9rem;
    z-index: 2000;
    transition: transform 0.3s ease;
}

.ticket-notification.show {
    transform: translateX(-50%) translateY(0);
}

.ticket-notification.success {
    border-color: rgba(76, 175, 80, 0.5);
    background: rgba(76, 175, 80, 0.2);
}

.ticket-notification.error {
    border-color: rgba(244, 67, 54, 0.5);
    background: rgba(244, 67, 54, 0.2);
}

/* Loader */
.tickets-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 140, 66, 0.2);
    border-top-color: #FF8C42;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tickets-error {
    text-align: center;
    padding: 40px 20px;
    color: #f44336;
}

/* ==================== MOBILE ==================== */
@media (max-width: 768px) {
    .tickets-page {
        position: relative;
        height: calc(100vh - 64px);
    }

    .tickets-layout {
        position: relative;
        height: 100%;
    }

    .tickets-sidebar {
        position: absolute;
        inset: 0;
        width: 100%;
        z-index: 10;
        transition: transform 0.3s ease;
    }

    .tickets-sidebar.hidden-mobile {
        transform: translateX(-100%);
    }

    .tickets-chat {
        position: absolute;
        inset: 0;
        width: 100%;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .tickets-chat.visible-mobile {
        transform: translateX(0);
    }

    .btn-back-mobile {
        display: flex;
    }

    .chat-message {
        max-width: 90%;
    }

    .chat-meta {
        gap: 8px;
    }

    .chat-subject {
        font-size: 0.9rem;
    }

    .tickets-modal {
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }
}
@media (max-width: 480px) {

    .sidebar-header {
        padding: 12px 16px;
    }

    .sidebar-header h1 {
        font-size: 1.1rem;
    }

    .sidebar-filters {
        padding: 6px;
    }

    .filter-pill {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .ticket-item {
        padding: 10px 12px;
    }

    .chat-header {
        padding: 10px 12px;
        min-height: 56px;
    }

    .chat-messages {
        padding: 12px;
    }

    .chat-input-area {
        padding: 10px 12px;
    }

    .btn-attach,
    .btn-send {
        width: 40px;
        height: 40px;
    }

    .chat-input-area textarea {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .msg-bubble {
        padding: 8px 12px;
    }

    .msg-text {
        font-size: 0.9rem;
    }

    .modal-body {
        padding: 16px;
    }
}

@media (max-width: 360px) {
    .sidebar-header h1 {
        font-size: 1rem;
    }

    .ticket-item-subject {
        font-size: 0.85rem;
    }

    .chat-subject {
        font-size: 0.85rem;
    }
}

/* ==================== CONFIRM MODAL ==================== */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.confirm-modal {
    background: linear-gradient(145deg, 
        rgba(30, 25, 20, 0.98) 0%, 
        rgba(20, 15, 10, 0.99) 100%
    );
    border: 1px solid rgba(255, 140, 66, 0.3);
    border-radius: 20px;
    padding: 32px 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 140, 66, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: scale(1) translateY(0);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-modal-overlay.hidden .confirm-modal {
    transform: scale(0.9) translateY(20px);
}

.confirm-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.confirm-modal-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.confirm-modal-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 28px 0;
    line-height: 1.6;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    min-width: 120px;
}

.confirm-btn.cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.confirm-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-2px);
}

.confirm-btn.confirm {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.confirm-btn.confirm:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e04848 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.confirm-btn.confirm.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.confirm-btn.confirm.success:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}
