/* ========================================================
   TICKET CSS (Full Combined & Synchronized)
   ======================================================== */

/* 1. HEADER & STATS GRID */
.ticket-header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-box {
    background: var(--bg-panel, #121212);
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.08));
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 24px;
    color: #00f2fe;
}

.stat-info h4 {
    margin: 0;
    font-size: 20px;
    color: var(--text-main, #fff);
}

.stat-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-gray, #888);
}

/* 2. TICKET TABLE STYLES */
.ticket-table-wrapper {
    background: var(--bg-panel, #121212);
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 30px;
}

.ticket-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.ticket-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 15px;
    color: var(--text-gray, #aaa);
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-light, rgba(255, 255, 255, 0.08));
}

.ticket-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-light, rgba(255, 255, 255, 0.05));
    color: var(--text-main, #ddd);
}

/* 3. STATUS & PRIORITY BADGES */
.badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
}

.badge-open {
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.badge-closed {
    background: rgba(158, 158, 158, 0.15);
    color: #9e9e9e;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

.badge-high {
    background: rgba(255, 82, 82, 0.15);
    color: #ff5252;
}

.badge-medium {
    background: rgba(255, 171, 0, 0.15);
    color: #ffab00;
}

.badge-low {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
}

/* 4. TOMBOL AKSI TABEL (CHAT & HAPUS SEJAJAR) */
.action-btn-group {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    white-space: nowrap !important;
}

.action-btn-group button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
}

.btn-action-chat {
    background: rgba(0, 242, 254, 0.12) !important;
    border: 1px solid rgba(0, 242, 254, 0.3) !important;
    color: #00f2fe !important;
}

.btn-action-chat:hover {
    background: rgba(0, 242, 254, 0.25) !important;
}

.btn-action-delete {
    background: rgba(255, 82, 82, 0.12) !important;
    border: 1px solid rgba(255, 82, 82, 0.3) !important;
    color: #ff5252 !important;
}

.btn-action-delete:hover {
    background: rgba(255, 82, 82, 0.25) !important;
}

/* 5. MODAL BUAT TIKET & CHAT */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 15px;
}

.modal-card {
    background: var(--bg-panel, #121824);
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* PERBAIKAN TOMBOL CLOSE MODAL (SANGAT PRESISI & BISA DIPENCET) */
.modal-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: transparent !important;
    border: none !important;
    color: #888888 !important;
    font-size: 20px !important;
    cursor: pointer !important;
    z-index: 999 !important;
    padding: 8px !important;
    line-height: 1 !important;
    transition: color 0.2s ease !important;
}

.modal-close:hover {
    color: #ffffff !important;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-gray, #ccc);
    margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    padding: 10px;
    color: var(--text-main, #fff);
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #00f2fe;
}

/* 6. CHAT THREAD BOX */
.chat-box {
    max-height: 280px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.08));
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.chat-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.chat-msg.client {
    align-self: flex-end;
    background: #0084ff;
    color: #fff;
    border-bottom-right-radius: 2px;
}

.chat-msg.admin {
    align-self: flex-start;
    background: #2a2e39;
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-bottom-left-radius: 2px;
}

.chat-meta {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
    text-align: right;
}

/* 7. CUSTOM POP-UP ALERT & CONFIRM MODAL OVERLAY */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-alert-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-alert-box {
    background: var(--bg-panel, #121824);
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
    border-radius: 18px;
    padding: 24px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-alert-overlay.active .custom-alert-box {
    transform: scale(1);
}

.custom-alert-icon {
    width: 55px;
    height: 55px;
    background: rgba(0, 242, 254, 0.15);
    color: #00f2fe;
    font-size: 26px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px auto;
}

.custom-alert-icon.warning {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.custom-alert-box h3 {
    color: var(--text-main, #ffffff);
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
}

.custom-alert-box p {
    color: var(--text-gray, #9ca3af);
    font-size: 13px;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

/* PERBAIKAN TOMBOL MODAL CONFIRM (SEJAJAR / SIDE-BY-SIDE) */
.modal-btn-group {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    margin-top: 15px !important;
}

.modal-btn-group button {
    flex: 1 !important;
    width: auto !important;
    display: inline-block !important;
    padding: 10px 16px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    box-sizing: border-box !important;
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.2s ease;
}

/* Tombol Batal (Abu-abu Gelap) */
.modal-btn-group .btn-cancel {
    background-color: #2b303b !important;
    color: #ffffff !important;
    border: 1px solid #3f4756 !important;
}

.modal-btn-group .btn-cancel:hover {
    background-color: #373e4d !important;
}

/* Tombol Eksekusi / Hapus (Merah) */
.modal-btn-group .btn-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border: 1px solid #ef4444 !important;
}

.modal-btn-group .btn-danger:hover {
    background-color: #dc2626 !important;
}

/* Tombol Single di Custom Alert (Oke) */
.custom-alert-box > button {
    background: #00f2fe;
    color: #0d1117;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
}

.custom-alert-box button:active {
    transform: scale(0.98);
   }
   
