/* ==========================================================================
   TBA Manager - Modern Premium Design System
   ========================================================================== */

/* --- Nền tảng Core --- */
body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #eef5fb;
    background-image:
        radial-gradient(circle at 14% 16%, rgba(96, 165, 250, 0.18) 0, rgba(96, 165, 250, 0) 26%),
        radial-gradient(circle at 86% 14%, rgba(45, 212, 191, 0.14) 0, rgba(45, 212, 191, 0) 24%),
        radial-gradient(circle at 76% 84%, rgba(129, 140, 248, 0.12) 0, rgba(129, 140, 248, 0) 22%),
        linear-gradient(135deg, #f9fbff 0%, #edf5ff 48%, #f8fbff 100%);
    background-attachment: fixed;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-main-stage {
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.74) 0%, rgba(244, 248, 252, 0.68) 100%);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* --- Tối ưu hóa Thanh cuộn (Custom Scrollbar) --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
    transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* --- Kính mờ (Glassmorphism & Shadows) --- */
.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 8px -1px rgba(15, 23, 42, 0.03);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.premium-shadow-sm {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 1px 2px rgba(15, 23, 42, 0.02);
}

.premium-shadow {
    box-shadow: 0 4px 30px rgba(15, 23, 42, 0.05), 0 2px 12px rgba(15, 23, 42, 0.03);
}

.premium-shadow-lg {
    box-shadow: 0 10px 40px -6px rgba(15, 23, 42, 0.08), 0 4px 16px -3px rgba(15, 23, 42, 0.04);
}

/* --- Hoạt ảnh chuyển Tab (Animations & Transitions) --- */
.tab-content {
    animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* --- Sidebar Độc quyền --- */
.sidebar-gradient {
    background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 45%, #0f172a 100%);
}

.app-sidebar-toggle {
    display: none;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.app-sidebar-toggle-pill {
    width: 1.8rem;
    height: 3.6rem;
    border-radius: 0 14px 14px 0;
    border: 1px solid rgba(165, 180, 252, 0.6);
    border-left: none;
    background: rgba(255, 255, 255, 0.95);
    color: #4338ca;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 12px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-sidebar-toggle-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.app-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
    z-index: 34;
}

.sidebar-logo-glow {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

a.nav-link {
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #e2e8f0;
    font-weight: 500;
    text-decoration: none !important;
}

a.nav-link:hover,
a.nav-link:focus,
a.nav-link:active,
a.nav-link:visited {
    text-decoration: none !important;
}

a.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

a.nav-link span,
a.nav-link i {
    text-decoration: none !important;
}

.active-nav {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.16) !important;
    border-left: 4px solid #fbbf24 !important;
    box-shadow: 0 4px 20px -2px rgba(251, 191, 36, 0.2);
    font-weight: 600;
    transform: translateX(0) !important;
}

/* --- Chấm trạng thái API nhấp nháy --- */
.api-pulse-dot {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

.api-pulse-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #10b981;
    animation: apiPulse 1.8s infinite ease-in-out;
}

.api-connection-light {
    position: relative;
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.api-connection-light.is-connected {
    background-color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

.api-connection-light.is-disconnected {
    background-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.65);
}

@keyframes apiPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.8);
        opacity: 0;
    }
}

/* --- Segmented Control (Chuyển mạch bộ lọc báo cáo) --- */
.segmented-control {
    display: flex;
    padding: 0.25rem;
    background: #f1f5f9;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.segmented-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    border: none !important;
    background: transparent !important;
    color: #64748b !important;
}

.segmented-button:hover {
    color: #334155 !important;
}

.segmented-button.bg-indigo-50 {
    background: #ffffff !important;
    color: #4f46e5 !important;
    box-shadow: 0 2px 8px -1px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

/* --- Thiết kế Lịch biểu Lịch Dữ Liệu Tháng --- */
.calendar-day-header {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.25rem;
    border-bottom: 2px solid #e2e8f0;
}

.calendar-day-card {
    background: #ffffff;
    min-height: 110px;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
}

.calendar-day-card:hover {
    background: #fafafa;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -6px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
    z-index: 10;
}

.calendar-day-card.today {
    background: #f0fdf4 !important;
    border: 2px solid #86efac !important;
    box-shadow: inset 0 0 12px rgba(74, 222, 128, 0.1) !important;
}

.calendar-day-card.empty-day {
    background: #f8fafc;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 8px 8px;
    border-color: #f1f5f9;
    cursor: not-allowed;
    pointer-events: none;
}

/* Các nhãn Capsule Badge Lịch biểu */
.data-badge-enabled {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #15803d;
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: 9999px;
    transition: all 0.2s ease;
}

.calendar-day-card:hover .data-badge-enabled {
    transform: scale(1.05);
    background-color: #bbf7d0;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

.data-badge-empty {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3b8;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
}

/* --- Nhập liệu & Form Control cao cấp --- */
.input-premium {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.input-premium:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* --- Thẻ phân loại Thiết bị đóng cắt --- */
.switching-category-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 0.375rem;
    padding: 0.375rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
}

.switching-category-tab {
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
}

.switching-category-tab:hover {
    color: #334155;
    background: rgba(255, 255, 255, 0.5);
}

.switching-category-tab.active {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #4f46e5;
    box-shadow: 0 2px 8px -1px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* --- Thống kê KPI Stats Cards --- */
.kpi-card {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.08);
}

.kpi-icon-container {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    color: #4f46e5;
}

.kpi-icon-container.green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(52, 211, 153, 0.05) 100%);
    color: #10b981;
}

.kpi-icon-container.amber {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
    color: #f59e0b;
}

.kpi-icon-container.rose {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.1) 0%, rgba(251, 113, 133, 0.05) 100%);
    color: #f43f5e;
}

/* --- Bảng dữ liệu Premium (Premium Tables) --- */
.premium-table-container {
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
    overflow: hidden;
}

.premium-table thead {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.premium-table th {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.premium-table tbody tr {
    transition: background 0.15s ease;
}

.premium-table tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.02) !important;
}

.premium-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.premium-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

/* --- Dropdown Lọc trên đầu Bảng (Floating Filter Panels) --- */
.floating-filter-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
    border-radius: 0.75rem;
}

/* --- Hậu cảnh Modal (Modal Backdrop) --- */
.modal-backdrop {
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

/* Hiệu ứng Phóng to tinh tế khi Modal xuất hiện */
.modal-scale-in {
    animation: modalScaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

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

/* --- Thiết kế Logic Builder (Nguồn công thức Báo Cáo) --- */
.formula-builder-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.formula-builder-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.04);
}

.formula-operator-connector {
    position: relative;
    text-align: center;
    margin: 0.5rem 0;
}

.formula-operator-connector::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: 1;
}

.formula-operator-select-wrapper {
    position: relative;
    display: inline-block;
    z-index: 2;
    background: #f8fafc;
    padding: 0 0.5rem;
}

.formula-operator-select {
    font-size: 0.75rem;
    font-weight: 700;
    color: #4f46e5;
    background: #e0e7ff;
    border: 1px solid #c7d2fe;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.formula-operator-select:hover {
    background: #c7d2fe;
    color: #312e81;
}

/* --- Tối ưu hóa phản hồi di động --- */
@media (max-width: 1024px) {
    .switching-category-bar {
        grid-template-columns: 1fr;
    }
}

body.app-sidebar-collapsible {
    position: relative;
}

body.app-sidebar-collapsible #app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(17.5rem, calc(100vw - 3.25rem));
    max-width: calc(100vw - 3.25rem);
    transform: translateX(-100%);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
    z-index: 40;
    overflow: visible;
}

body.app-sidebar-collapsible.app-sidebar-open #app-sidebar {
    transform: translateX(0);
    box-shadow: 0 24px 48px -18px rgba(15, 23, 42, 0.45);
}

body.app-sidebar-collapsible #app-main-content {
    width: 100%;
    min-width: 0;
}

body.app-sidebar-collapsible #app-sidebar-toggle {
    display: flex;
}

body.app-sidebar-collapsible #app-sidebar-toggle:hover .app-sidebar-toggle-pill {
    width: 2.15rem;
    background: #4338ca;
    color: #ffffff;
    border-color: #4338ca;
    box-shadow: 6px 6px 18px rgba(67, 56, 202, 0.35);
}

body.app-sidebar-collapsible #app-sidebar-toggle:active .app-sidebar-toggle-pill {
    width: 1.7rem;
}

body.app-sidebar-collapsible.app-sidebar-open #app-sidebar-backdrop {
    display: block !important;
}

/* --- Phiếu chỉnh định --- */
.ticket-layout {
    position: relative;
}

.ticket-sidebar-panel {
    position: relative;
    overflow: visible !important;
}

.ticket-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ticket-filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.ticket-select-row {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

.ticket-search-select {
    position: relative;
}

.ticket-search-select.open {
    z-index: 35;
}

.ticket-search-select-trigger {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ticket-search-select-trigger:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.ticket-search-select.open .ticket-search-select-trigger,
.ticket-search-select-trigger:not(:disabled):hover {
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
}

.ticket-search-select-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-search-select-caret {
    color: #64748b;
    font-size: 0.7rem;
}

.ticket-search-select-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    z-index: 30;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 30px -12px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.ticket-search-select-search {
    padding: 0.875rem;
    border-bottom: 1px solid #eef2f7;
}

.ticket-search-select-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.875rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.875rem;
    color: #0f172a;
    outline: none;
}

.ticket-search-select-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.ticket-search-select-options {
    max-height: 260px;
    overflow: auto;
    padding: 0.5rem;
}

.ticket-search-select-option {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.75rem 0.9rem;
    border-radius: 0.875rem;
    color: #1e293b;
    font-size: 0.875rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ticket-search-select-option:hover,
.ticket-search-select-option.is-selected {
    background: #eef2ff;
    color: #4338ca;
}

.ticket-search-select-empty {
    padding: 1rem;
    font-size: 0.875rem;
    color: #64748b;
}

.ticket-mini-action {
    width: 3rem;
    min-width: 3rem;
    border-radius: 1rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #4f46e5;
    transition: all 0.2s ease;
}

.ticket-mini-action:hover:not(:disabled) {
    background: #eef2ff;
    border-color: #a5b4fc;
}

.ticket-stat-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 700;
}

.ticket-file-list {
    list-style: none;
    margin: 0;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ticket-file-item {
    border: 1px solid #e2e8f0;
    border-radius: 1.1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 1rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.9rem;
    align-items: start;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.ticket-file-item:hover {
    transform: translateY(-1px);
    border-color: #c7d2fe;
    box-shadow: 0 10px 24px -16px rgba(79, 70, 229, 0.45);
}

.ticket-file-item.is-active {
    border-color: #818cf8;
    box-shadow: 0 14px 28px -18px rgba(79, 70, 229, 0.5);
    background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
}

.ticket-file-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #4338ca;
    font-size: 1.1rem;
}

.ticket-file-info {
    min-width: 0;
}

.ticket-file-name {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ticket-file-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.ticket-file-action {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.8rem;
    border: 1px solid #dbe2ea;
    background: #ffffff;
    color: #475569;
    transition: all 0.2s ease;
}

.ticket-file-action:hover:not(:disabled) {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

.ticket-delete-button {
    color: #dc2626;
    border-color: #fecaca;
}

.ticket-delete-button:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.ticket-file-action:disabled,
.ticket-mini-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ticket-filter-group.hidden,
.ticket-viewer-placeholder.hidden,
.ticket-loading-indicator.hidden,
.ticket-viewer-content.hidden {
    display: none !important;
}

.ticket-empty-state,
.ticket-viewer-placeholder {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #64748b;
    gap: 0.75rem;
}

.ticket-empty-icon,
.ticket-viewer-placeholder-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #4338ca;
    font-size: 1.35rem;
}

.ticket-viewer-shell {
    position: relative;
    min-height: 0;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.45), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.ticket-loading-indicator {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    color: #475569;
}

.ticket-spinner {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    border: 4px solid rgba(99, 102, 241, 0.15);
    border-top-color: #4f46e5;
    animation: ticketSpin 0.8s linear infinite;
}

@keyframes ticketSpin {
    to {
        transform: rotate(360deg);
    }
}

.ticket-viewer-content {
    min-height: 100%;
    padding: 1.5rem;
}

.ticket-viewer-content canvas {
    display: block;
    max-width: 100%;
    margin: 0 auto 1rem;
    border-radius: 0.85rem;
    box-shadow: 0 8px 24px -14px rgba(15, 23, 42, 0.35);
    background: #ffffff;
}

.ticket-word-container .docx-wrapper,
.ticket-word-container .docx {
    background: transparent !important;
}

.ticket-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ticket-image-preview {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 1rem;
    box-shadow: 0 12px 30px -18px rgba(15, 23, 42, 0.4);
    background: #ffffff;
}

.ticket-toast {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 80;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border-radius: 1rem;
    color: #ffffff;
    box-shadow: 0 18px 32px -18px rgba(15, 23, 42, 0.45);
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ticket-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.ticket-toast.info {
    background: #2563eb;
}

.ticket-toast.success {
    background: #059669;
}

.ticket-toast.error {
    background: #dc2626;
}

@media (max-width: 1280px) {
    .ticket-viewer-shell {
        min-height: 560px;
    }
}

@media (max-width: 820px) and (orientation: portrait) {
    .ticket-layout.ticket-mobile-mode {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        height: auto;
    }

    .ticket-layout.ticket-mobile-mode .ticket-sidebar-panel,
    .ticket-layout.ticket-mobile-mode .ticket-viewer-panel {
        width: 100%;
    }

    .ticket-layout.ticket-mobile-mode .ticket-viewer-panel {
        min-height: 68svh;
    }

    .ticket-layout.ticket-mobile-mode .ticket-viewer-shell {
        min-height: 62svh;
    }

    .ticket-layout.ticket-mobile-mode .ticket-viewer-content {
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .ticket-select-row {
        gap: 0.5rem;
    }

    .ticket-mini-action {
        width: 2.75rem;
        min-width: 2.75rem;
    }

    .ticket-file-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .ticket-file-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}
