
    /* Base styles - keeping your existing styles */
    .btn {
        padding: 8px 16px;
        border-radius: 6px;
        border: none;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s;
    }

    .btn-primary {
        background: var(--accent);
        color: white;
    }

    .btn-primary:hover {
        background: var(--accent-hover);
    }

    .btn-secondary {
        background: transparent;
        color: var(--text-primary);
        border: 1px solid var(--border);
    }

    .btn-secondary:hover {
        background: var(--gray-700);
    }

    .btn-success {
        background: linear-gradient(135deg, var(--success), #16a34a);
        color: white;
    }

    .btn-success:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(22, 163, 74, 0.3);
    }

    .page-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        padding: 20px;
        background: var(--card-bg);
        border-radius: 12px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .header-left h1 {
        margin: 0;
        font-size: 28px;
        font-weight: 600;
    }

    .header-left p {
        margin: 5px 0 0;
        color: #64748b;
    }

    /* Stats Grid */
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        margin-bottom: 30px;
    }

    .stat-card {
        background: var(--card-bg);
        border-radius: 12px;
        padding: 20px;
        display: flex;
        align-items: center;
        border: 1px solid var(--accent);
        gap: 20px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .stat-card.loading {
        position: relative;
        overflow: hidden;
    }

    .stat-card.loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        animation: loading 1.5s infinite;
    }

    .stat-icon {
        width: 60px;
        height: 60px;
        background: linear-gradient(135deg, var(--primary), var(--primary-hover));
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 30px;
        color: white;
    }

    .stat-card:nth-child(2) .stat-icon {
        background: linear-gradient(135deg, var(--danger), #dc2626);
    }

    .stat-card:nth-child(3) .stat-icon {
        background: linear-gradient(135deg, var(--warning), #d97706);
    }

    .stat-card:nth-child(4) .stat-icon {
        background: linear-gradient(135deg, var(--success), #16a34a);
    }

    .stat-content h4 {
        margin: 0 0 5px;
        font-size: 14px;
        color: #64748b;
    }

    .stat-number {
        font-size: 32px;
        font-weight: 700;
        color: var(--text-primary);
    }

    /* Filters Bar */
    .filters-bar {
        background: var(--card-bg);
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 30px;
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        align-items: flex-end;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .filter-group {
        flex: 1;
        min-width: 150px;
    }

    .filter-group label {
        display: block;
        margin-bottom: 5px;
        font-size: 12px;
        font-weight: 600;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .filter-select,
    .filter-search {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-color);
        color: var(--text-primary);
        font-size: 14px;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .filter-select:focus,
    .filter-search:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

    .search-group {
        position: relative;
        flex: 2;
    }

    .search-icon {
        position: absolute;
        left: 12px;
        top: 38px;
        color: #94a3b8;
        font-size: 14px;
    }

    .search-group .filter-search {
        padding-left: 35px;
    }

    /* Tickets List */
    .tickets-container {
        background: var(--card-bg);
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .tickets-table {
        overflow-x: auto;
    }

    .data-table {
        width: 100%;
        border-collapse: collapse;
    }

    .data-table th {
        background: var(--bg-light);
        padding: 15px;
        text-align: left;
        font-weight: 600;
        font-size: 14px;
        color: #64748b;
        border-bottom: 2px solid var(--border);
    }

    .data-table td {
        padding: 15px;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
    }

    .data-table tbody tr:hover {
        background: var(--bg-light);
    }

    .ticket-subject {
        font-weight: 500;
        margin-bottom: 5px;
    }

    /* Badges */
    .badge {
        display: inline-block;
        padding: 4px 10px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        text-transform: capitalize;
    }

    .priority-critical {
        background: var(--danger);
        color: white;
    }

    .priority-high {
        background: #f97316;
        color: white;
    }

    .priority-medium {
        background: var(--warning);
        color: white;
    }

    .priority-low {
        background: var(--success);
        color: white;
    }

    .status-open {
        background: var(--info);
        color: white;
    }

    .status-in_progress {
        background: #8b5cf6;
        color: white;
    }

    .status-resolved {
        background: var(--success);
        color: white;
    }

    .status-closed {
        background: #64748b;
        color: white;
    }

    .badge.category {
        background: var(--bg-light);
        color: var(--text-primary);
        border: 1px solid var(--border);
    }

    /* Pagination */
    .pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        padding: 20px;
        border-top: 1px solid var(--border);
    }

    .page-info {
        font-size: 14px;
        color: #64748b;
    }

    /* Empty State */
    .empty-state {
        text-align: center;
        padding: 60px 20px;
    }

    .empty-state i {
        font-size: 80px;
        color: #cbd5e1;
        margin-bottom: 20px;
    }

    .empty-state h3 {
        margin: 0 0 10px;
        font-size: 24px;
        color: var(--text-primary);
    }

    .empty-state p {
        margin: 0 0 20px;
        color: #64748b;
    }

    /* Login Required State */
    .login-required {
        text-align: center;
        padding: 80px 20px;
        background: var(--card-bg);
        border-radius: 12px;
        margin: 20px 0;
    }

    .login-required i {
        font-size: 100px;
        color: var(--primary);
        margin-bottom: 20px;
        opacity: 0.5;
    }

    .login-required h2 {
        margin: 0 0 15px;
        font-size: 32px;
        color: var(--text-primary);
    }

    .login-required p {
        margin: 0 0 30px;
        color: #64748b;
        font-size: 16px;
    }

    .login-buttons {
        display: flex;
        gap: 15px;
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Loading State */
    .loading-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 60px 20px;
    }

    .loading-spinner {
        width: 50px;
        height: 50px;
        border: 3px solid var(--border);
        border-top-color: var(--primary);
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin-bottom: 20px;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    @keyframes loading {
        0% {
            transform: translateX(-100%);
        }

        100% {
            transform: translateX(100%);
        }
    }

    /* Modals - Fixed Version */
    .modal {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 2000;
        background: var(--card-bg);
        border-radius: 20px;
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
        max-width: 600px;
        width: 90%;
        max-height: 90vh;
        overflow: hidden;
        animation: modalFadeIn 0.2s ease;
    }

    @keyframes modalFadeIn {
        from {
            opacity: 0;
            transform: translate(-50%, -48%);
        }

        to {
            opacity: 1;
            transform: translate(-50%, -50%);
        }
    }

    .modal-lg {
        max-width: 900px;
    }

    .modal-content {
        padding: 0;
        display: flex;
        flex-direction: column;
        height: 100%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 18px 24px;
        border-bottom: 1px solid var(--border);
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--primary);
        border-radius: 20px 20px 0 0;
        flex-shrink: 0;
    }

    .modal-header h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-primary);
        line-height: 1.4;
    }

    .header-actions {
        display: flex;
        gap: 12px;
        align-items: center;
    }

    .close-modal {
        background: transparent;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--text-secondary);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        transition: all 0.2s ease;
    }

    .close-modal:hover {
        background: rgba(0, 0, 0, 0.05);
        color: var(--text-primary);
    }

    .modal-body {
        padding: 24px;
        overflow-y: auto;
        flex: 1;
        background: var(--primary);
        scrollbar-width: thin;
        scrollbar-color: var(--primary-color) var(--border);
    }

    .modal-body::-webkit-scrollbar {
        width: 8px;
    }

    .modal-body::-webkit-scrollbar-track {
        background: var(--border);
        border-radius: 10px;
        margin: 4px 0;
    }

    .modal-body::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 10px;
        border: 2px solid var(--border);
    }

    .modal-body::-webkit-scrollbar-thumb:hover {
        background: var(--primary-hover);
    }

    .modal-footer {
        padding: 18px 24px;
        border-top: 1px solid var(--border);
        display: flex;
        justify-content: flex-end;
        gap: 12px;
        background: var(--primary);
        border-radius: 0 0 20px 20px;
        flex-shrink: 0;
    }

    .modal-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 1999;
        animation: backdropFadeIn 0.2s ease;
    }

    @keyframes backdropFadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    .modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
        backdrop-filter: blur(3px);
    }

    .close-btn {
        background: none;
        border: none;
        font-size: 28px;
        cursor: pointer;
        color: #64748b;
        transition: color 0.2s;
        line-height: 1;
    }

    .close-btn:hover {
        color: var(--danger);
    }

    /* Forms */
    .form-group {
        margin-bottom: 20px;
    }

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        font-size: 14px;
        color: var(--text-primary);
    }

    .form-group .required {
        color: var(--danger);
        margin-left: 3px;
    }

    .form-control {
        width: 100%;
        padding: 12px 15px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-color);
        color: var(--text-primary);
        font-size: 14px;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .form-control:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

    .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    /* File Upload */
    .file-upload-area {
        border: 2px dashed var(--border);
        border-radius: 8px;
        padding: 30px;
        text-align: center;
        cursor: pointer;
        transition: border-color 0.2s, background 0.2s;
    }

    .file-upload-area:hover {
        border-color: var(--primary);
        background: var(--bg-light);
    }

    .file-upload-area i {
        font-size: 40px;
        color: var(--primary);
        margin-bottom: 10px;
    }

    .file-upload-area p {
        margin: 0 0 5px;
        font-weight: 500;
    }

    .file-upload-area small {
        color: #64748b;
    }

    .file-list {
        margin-top: 15px;
    }

    .file-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
        background: var(--bg-light);
        border-radius: 8px;
        margin-bottom: 8px;
    }

    .file-item i {
        font-size: 20px;
        color: var(--primary);
    }

    .file-name {
        flex: 1;
        font-size: 14px;
        word-break: break-all;
    }

    .file-size {
        color: #64748b;
        font-size: 12px;
    }

    /* Messages */
    .messages-container {
        margin: 20px 0;
    }

    .message {
        display: flex;
        gap: 15px;
        margin-bottom: 20px;
    }

    .message-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0;
    }

    .message-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .message-content {
        flex: 1;
        background: var(--bg-light);
        border-radius: 12px;
        padding: 15px;
        position: relative;
    }

    .message.staff-message .message-content {
        background: #1e3a8a20;
        border-left: 4px solid var(--primary);
    }

    .message-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 8px;
        flex-wrap: wrap;
    }

    .staff-badge {
        background: var(--primary);
        color: white;
        padding: 2px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
    }

    .message-time {
        color: #64748b;
        font-size: 12px;
        margin-left: auto;
    }

    .message-body {
        line-height: 1.6;
        font-size: 14px;
    }

    .message-attachments {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }

    .attachment-link {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 5px 10px;
        background: var(--bg-color);
        border-radius: 6px;
        color: var(--text-primary);
        text-decoration: none;
        font-size: 12px;
        margin-right: 8px;
        margin-bottom: 5px;
        transition: background 0.2s;
    }

    .attachment-link:hover {
        background: var(--border);
    }

    /* Reply Box */
    .reply-box {
        margin-top: 30px;
        border: 1px solid var(--border);
        border-radius: 12px;
        overflow: hidden;
    }

    .reply-box .card-header {
        padding: 15px 20px;
        background: var(--bg-light);
        border-bottom: 1px solid var(--border);
    }

    .reply-box .card-body {
        padding: 20px;
    }

    .reply-actions {
        display: flex;
        gap: 10px;
        margin-top: 15px;
        flex-wrap: wrap;
    }

    /* Attachments Grid */
    .attachments-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .attachment-item {
        background: var(--bg-light);
        border-radius: 8px;
        padding: 12px;
        display: flex;
        align-items: center;
        gap: 10px;
        border: 1px solid var(--border);
    }

    .attachment-item i {
        font-size: 24px;
        color: var(--primary);
    }

    /* Star Rating */
    .star-rating {
        display: flex;
        gap: 5px;
        font-size: 30px;
        color: #cbd5e1;
        cursor: pointer;
    }

    .star-rating i {
        transition: color 0.2s;
    }

    .star-rating i.star-highlight,
    .star-rating i.star-selected {
        color: var(--warning);
    }

    .star-rating i:hover {
        color: var(--warning);
    }

    /* Radio Group */
    .radio-group {
        display: flex;
        gap: 20px;
    }

    .radio-group label {
        display: flex;
        align-items: center;
        gap: 5px;
        font-weight: normal;
        cursor: pointer;
    }

    /* Notifications */
    .notification {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 10000;
        padding: 15px 20px;
        border-radius: 8px;
        color: white;
        font-size: 14px;
        font-weight: 500;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        display: flex;
        align-items: center;
        gap: 10px;
        animation: slideInRight 0.3s ease;
        max-width: 400px;
    }

    .notification-success {
        background: linear-gradient(135deg, var(--success), #16a34a);
    }

    .notification-error {
        background: linear-gradient(135deg, var(--danger), #dc2626);
    }

    .notification-warning {
        background: linear-gradient(135deg, var(--warning), #d97706);
    }

    .notification-info {
        background: linear-gradient(135deg, var(--info), #2563eb);
    }

    .notification.fade-out {
        animation: slideOutRight 0.3s ease forwards;
    }

    @keyframes slideInRight {
        from {
            transform: translateX(100%);
            opacity: 0;
        }

        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes slideOutRight {
        from {
            transform: translateX(0);
            opacity: 1;
        }

        to {
            transform: translateX(100%);
            opacity: 0;
        }
    }

    /* Responsive */
    @media (max-width: 1024px) {
        .stats-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    @media (max-width: 768px) {
        .page-header {
            flex-direction: column;
            gap: 15px;
            text-align: center;
        }

        .filters-bar {
            flex-direction: column;
        }

        .filter-group {
            width: 100%;
        }

        .stats-grid {
            grid-template-columns: 1fr;
        }

        .form-row {
            grid-template-columns: 1fr;
        }

        .modal-content {
            width: 95%;
        }
    }

    .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 48px 24px;
        background-color: var(--card-bg);
        border-radius: 16px;
        margin: 20px;
        border: 1px solid var(--border);
    }

    .empty-state i {
        font-size: 64px;
        color: #a0b8cc;
        margin-bottom: 16px;
        opacity: 0.7;
    }

    .empty-state h3 {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        font-size: 20px;
        font-weight: 600;
        color: #64748b;
        margin: 0 0 8px 0;
    }

    .empty-state p {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        font-size: 14px;
        color: #64748b;
        margin: 0 0 24px 0;
        max-width: 280px;
    }

    .empty-state .btn-primary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px 16px;
        background-color: #3b82f6;
        border: none;
        border-radius: 8px;
        color: white;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        min-width: 140px;
        box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    }

    .empty-state .btn-primary i {
        font-size: 14px;
        color: white;
        margin: 0;
        opacity: 1;
    }

    .empty-state .btn-primary:hover {
        background-color: #2563eb;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    }
