/* Spike Admin Dark Theme Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark Theme Colors - Spike Admin Style */
    --primary: #5e72e4;
    --primary-dark: #4c63d2;
    --secondary: #8392ab;
    --success: #2dce89;
    --danger: #f5365c;
    --warning: #fb6340;
    --info: #11cdef;
    
    /* Background Colors */
    --bg-primary: #172b4d;
    --bg-secondary: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #2d3748;
    --bg-sidebar: #1a202c;
    
    /* Text Colors */
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    
    /* Border Colors */
    --border-color: #2d3748;
    --border-light: #4a5568;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Login Container */
.login-container {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;
}

.login-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.login-box h2 {
    color: var(--text-primary);
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.login-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.login-box button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.error-message {
    color: var(--danger);
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-secondary);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    height: fit-content;
    min-height: calc(100vh - 48px);
    margin: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 16px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-icon {
    font-size: 18px;
}

.nav-text {
    flex: 1;
}

.sidebar-footer {
    padding: 16px 24px 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.status-info {
    margin-bottom: 16px;
}

.status-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.status-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.status-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
}

.status-value.disconnected {
    color: var(--danger);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.logout-btn-small {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.logout-btn-small:hover {
    background: var(--bg-hover);
    color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
}

.content-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.content-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.stats-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-divider {
    color: var(--text-muted);
    font-size: 14px;
    opacity: 0.5;
}

.logs-controls-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.logs-filter-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.logs-filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.logs-filter-input::placeholder {
    color: var(--text-muted);
}

.btn-clear-all {
    padding: 10px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-clear-all:hover {
    background: #e0315a;
    box-shadow: var(--shadow-md);
}

.btn-primary {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

/* Table Container */
.table-container {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

/* Таблица логов: ID, TIME, USER - auto-width по содержимому, MESSAGE - остальное пространство */
#logsTable {
    table-layout: auto;
}

#logsTable th:nth-child(1),
#logsTable td:nth-child(1) {
    width: 1%;
    white-space: nowrap;
    padding-right: 24px;
}

#logsTable th:nth-child(2),
#logsTable td:nth-child(2) {
    width: 1%;
    white-space: nowrap;
    padding-right: 24px;
}

#logsTable th:nth-child(3),
#logsTable td:nth-child(3) {
    width: 1%;
    white-space: nowrap;
    padding-right: 24px;
}

#logsTable th:nth-child(4),
#logsTable td:nth-child(4) {
    width: auto;
    word-wrap: break-word;
    word-break: break-word;
}

/* Таблица клиентов: все колонки кроме Actions - auto-width по содержимому, Actions - остальное пространство */
#clientsTable {
    table-layout: auto;
}

#clientsTable th:nth-child(1),
#clientsTable td:nth-child(1) {
    width: 1%;
    white-space: nowrap;
    padding-right: 24px;
}

#clientsTable th:nth-child(2),
#clientsTable td:nth-child(2) {
    width: 1%;
    white-space: nowrap;
    padding-right: 24px;
}

#clientsTable th:nth-child(3),
#clientsTable td:nth-child(3) {
    width: 1%;
    white-space: nowrap;
    padding-right: 24px;
}

#clientsTable th:nth-child(4),
#clientsTable td:nth-child(4) {
    width: 1%;
    white-space: nowrap;
    padding-right: 24px;
}

#clientsTable th:nth-child(5),
#clientsTable td:nth-child(5) {
    width: 1%;
    white-space: nowrap;
    padding-right: 24px;
}

#clientsTable th:nth-child(6),
#clientsTable td:nth-child(6) {
    width: auto;
    word-wrap: break-word;
    word-break: break-word;
}

.data-table thead {
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table th.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.data-table th.sortable-header:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sort-indicator {
    margin-left: 4px;
    opacity: 0.5;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table td {
    padding: 16px;
    color: var(--text-primary);
    font-size: 14px;
}

.data-table td.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px;
    font-style: italic;
}

/* Action Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 2px;
}

.action-btn.vac1,
.action-btn.vac2,
.action-btn.showFs {
    min-width: 60px;
    padding: 6px 12px;
}

.action-btn.vac1.active,
.action-btn.vac2.active,
.action-btn.showFs.active {
    background: var(--success);
    color: white;
    border: 1px solid var(--success);
    box-shadow: 0 0 10px rgba(45, 206, 137, 0.3);
}

.action-btn.vac1:not(.active),
.action-btn.vac2:not(.active),
.action-btn.showFs:not(.active) {
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.action-btn.delete {
    background: var(--danger);
    color: white;
    padding: 4px 8px;
    font-size: 16px;
    line-height: 1;
}

.action-btn.delete:hover {
    background: #e0315a;
}

.action-btn.danger-btn {
    background: var(--danger);
    color: white;
}

.action-btn.danger-btn:hover {
    background: #e0315a;
}

.action-btn.transfer {
    background: var(--info);
    color: white;
}

.action-btn.transfer:hover {
    background: #0ea5c6;
}

.status-online {
    color: var(--success);
    font-weight: 600;
}

.status-offline {
    color: var(--text-muted);
}

/* Load More Button */
.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.btn-load-more {
    width: 100%;
    max-width: 400px;
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}

.btn-load-more:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-load-more:active {
    transform: translateY(0);
}

.btn-load-more:disabled,
.btn-load-more.hidden {
    display: none;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    margin: auto;
    position: relative;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close-delete,
.modal-close-transfer,
.modal-close-account,
.modal-close-password,
.modal-close-error,
.modal-close-clear-logs,
.modal-close-ticket {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close-delete:hover,
.modal-close-transfer:hover,
.modal-close-account:hover,
.modal-close-password:hover,
.modal-close-error:hover,
.modal-close-clear-logs:hover,
.modal-close-ticket:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    color: var(--text-primary);
}

.modal-body p {
    margin-bottom: 16px;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-input,
.modal-select {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.modal-input:focus,
.modal-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.modal-input:last-child,
.modal-select:last-child {
    margin-bottom: 0;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn-success,
.modal-btn-primary {
    padding: 10px 20px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.modal-btn-primary {
    background: var(--primary);
}

.modal-btn-primary:hover {
    background: var(--primary-dark);
}

.modal-btn-success:hover {
    background: #28b574;
}

.modal-btn-danger {
    padding: 10px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.modal-btn-danger.rounded {
    border-radius: 20px;
}

.modal-btn-danger:hover {
    background: #e0315a;
}

.modal-btn-secondary {
    padding: 10px 20px;
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.modal-btn-secondary:hover {
    background: var(--border-color);
}

.modal-client-info {
    color: var(--text-muted);
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: auto;
    }
    
    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-bar {
        width: 100%;
    }
}

/* Dropdown стиль для Accounts Type */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
    min-width: 120px;
}

.account-type-select {
    width: 100%;
    padding: 8px 32px 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0aec0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    transition: all 0.2s;
}

.account-type-select:hover {
    border-color: var(--primary);
    background-color: var(--bg-hover);
}

.account-type-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.account-type-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px;
}

/* Dropdown стиль для Accounts Type */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
    min-width: 120px;
}

.account-type-select {
    width: 100%;
    padding: 8px 32px 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0aec0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    transition: all 0.2s;
}

.account-type-select:hover {
    border-color: var(--primary);
    background-color: var(--bg-hover);
}

.account-type-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.account-type-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px;
}

/* ====== Ticket Modal Styles ====== */
.ticket-modal-content {
    max-width: 700px;
}

.ticket-info {
    margin-bottom: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.ticket-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.ticket-info-row + .ticket-info-row {
    border-top: 1px solid var(--border-color);
    margin-top: 6px;
    padding-top: 12px;
}

.ticket-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    min-width: 80px;
}

.ticket-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.ticket-status-btn {
    padding: 5px 14px;
    font-size: 12px;
    margin-left: auto;
}

.ticket-messages {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
}

.ticket-messages::-webkit-scrollbar {
    width: 6px;
}

.ticket-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ticket-messages::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.ticket-msg {
    margin-bottom: 12px;
}

.ticket-msg:last-child {
    margin-bottom: 0;
}

.ticket-msg-support {
    display: flex;
    justify-content: flex-end;
}

.ticket-msg-client {
    display: flex;
    justify-content: flex-start;
}

.ticket-msg-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ticket-msg-support .ticket-msg-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ticket-msg-client .ticket-msg-bubble {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.ticket-msg-meta {
    font-size: 11px;
    margin-bottom: 4px;
    opacity: 0.7;
}

.ticket-msg-support .ticket-msg-meta {
    color: rgba(255, 255, 255, 0.7);
    text-align: right;
}

.ticket-msg-client .ticket-msg-meta {
    color: var(--text-muted);
}

.ticket-msg-text {
    word-break: break-word;
}

.ticket-msg-attachments {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ticket-attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82em;
    color: var(--text-muted);
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    width: fit-content;
}

.ticket-attachment-clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.ticket-attachment-clickable:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--primary);
}

.ticket-attachment-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.ticket-attachment-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.ticket-attachment-size {
    opacity: 0.6;
    font-size: 0.9em;
    white-space: nowrap;
}

/* Image viewer overlay */
.image-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-viewer-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10001;
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ticket-reply {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.ticket-textarea {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 44px;
    max-height: 120px;
    transition: border-color 0.2s;
}

.ticket-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.15);
}

.ticket-textarea::placeholder {
    color: var(--text-muted);
}

.ticket-send-btn {
    padding: 10px 20px;
    white-space: nowrap;
    height: fit-content;
}

/* Ticket NEW badge */
.ticket-new-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    letter-spacing: 0.5px;
    animation: ticket-new-pulse 2s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes ticket-new-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ticket-row-new {
    background: rgba(94, 114, 228, 0.08) !important;
}

.ticket-row-new:hover {
    background: rgba(94, 114, 228, 0.15) !important;
}
