/* ==========================================================================
   WIDGETS & SIDE PANELS CSS
   ========================================================================== */

/* --- PANEL ENGINE --- */
.modern-side-panel {
    position: fixed; top: 80px; bottom: 20px; right: calc(-1 * 450px - 50px);
    width: 450px; max-width: 90vw; background: #ffffff; border-radius: 20px; 
    box-shadow: -10px 10px 40px rgba(48, 82, 138, 0.3), 0 0 0 1px rgba(0,0,0,0.05);
    z-index: 100200 !important; 
    display: flex; flex-direction: column; overflow: hidden;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease; 
    opacity: 0; pointer-events: none; border: 1px solid #e2e8f0;
}
.modern-side-panel.panel-active { right: 20px; opacity: 1; pointer-events: auto; }

/* --- HEADERS --- */
.modern-panel-header { 
    padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; 
    flex-shrink: 0; color: white; 
    background: linear-gradient(135deg, #30528A 0%, #1e3661 100%); 
    border-bottom: 3px solid #A78759; 
}
.modern-panel-icon { 
    width: 42px; height: 42px; background: rgba(255,255,255,0.15); border-radius: 12px; 
    display: flex; align-items: center; justify-content: center; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); font-size: 1.2rem; color: #A78759; 
    border: 1px solid rgba(167, 135, 89, 0.3);
}
.modern-btn-close { 
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); 
    width: 36px; height: 36px; border-radius: 50%; color: white; 
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; 
}
.modern-btn-close:hover { 
    background: #EC363A; 
    border-color: #EC363A;
    transform: rotate(90deg) scale(1.1); 
    box-shadow: 0 4px 12px rgba(236, 54, 58, 0.4);
}

/* --- BODY & CONTENTS --- */
.modern-panel-body { flex-grow: 1; overflow-y: auto; background: #f8fafc; position: relative; padding: 0; }

/* Log Rows */
.log-row { padding: 12px 16px; border-bottom: 1px solid #e2e8f0; display: flex; gap: 12px; transition: background 0.2s; background: #ffffff; }
.log-row:hover { background-color: rgba(48, 82, 138, 0.03); }
.log-icon-wrapper { width: 36px; height: 36px; font-size: 0.9rem; flex-shrink: 0; margin-top: 2px; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.log-content { flex-grow: 1; font-size: 0.85rem; }
.log-user { font-weight: 800; color: #30528A; display: flex; justify-content: space-between; } 
.log-time { color: #64748b; font-size: 0.7rem; font-weight: 600; }
.log-msg { color: #334155; margin-top: 4px; line-height: 1.4; }
.log-ref { font-family: monospace; color: #A78759; font-weight: bold; background: rgba(167, 135, 89, 0.1); padding: 2px 6px; border-radius: 6px; border: 1px solid rgba(167, 135, 89, 0.2); }

/* Approve Card */
.approve-card {
    background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.approve-card:hover {
    border-color: #A78759; 
    box-shadow: 0 8px 20px rgba(167, 135, 89, 0.15);
    transform: translateY(-3px);
}
.btn-gold {
    background: linear-gradient(135deg, #A78759 0%, #8c714a 100%);
    color: #ffffff; border: none; font-weight: 700;
    box-shadow: 0 4px 12px rgba(167, 135, 89, 0.3); transition: 0.2s;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(167, 135, 89, 0.4); color: white;}

/* Custom Scrollbar */
.panel-scroll::-webkit-scrollbar { width: 6px; }
.panel-scroll::-webkit-scrollbar-track { background: transparent; }
.panel-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.panel-scroll::-webkit-scrollbar-thumb:hover { background: #A78759; }

/* Styling Khusus Chat Advanced */
.chat-announcement { background: linear-gradient(135deg, #A78759 0%, #8c714a 100%) !important; color: white !important; border: none !important; box-shadow: 0 4px 15px rgba(167, 135, 89, 0.4) !important; }
.pinned-banner { background: #fffbeb; border-bottom: 1px solid #fde68a; font-size: 0.75rem; padding: 8px 15px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: 0.3s;}
.pinned-text { color: #d97706; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 85%; }

/* Fitur Reply, Quote & Tanggal */
.chat-action-btns { opacity: 0; transition: opacity 0.2s ease; display: flex; gap: 5px; margin-top: 4px; }
.chat-bubble-container:hover .chat-action-btns { opacity: 1; }
.btn-chat-action { background: rgba(0,0,0,0.05); border: none; border-radius: 4px; padding: 2px 6px; font-size: 0.65rem; color: #64748b; cursor: pointer; transition: 0.2s;}
.btn-chat-action:hover { background: rgba(0,0,0,0.1); color: #0f172a; }
.btn-chat-delete:hover { background: #fee2e2; color: #ef4444; }

.quote-box { border-left: 3px solid rgba(255,255,255,0.4); background: rgba(0,0,0,0.1); padding: 4px 8px; margin-bottom: 6px; border-radius: 0 4px 4px 0; font-size: 0.75rem; cursor: pointer; }
.quote-box-other { border-left: 3px solid var(--tirta-blue); background: rgba(48, 82, 138, 0.05); }
.date-divider { display: flex; align-items: center; text-align: center; margin: 15px 0; color: #94a3b8; font-size: 0.7rem; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.date-divider::before, .date-divider::after { content: ''; flex: 1; border-bottom: 1px dashed #cbd5e1; }
.date-divider:not(:empty)::before { margin-right: .5em; }
.date-divider:not(:empty)::after { margin-left: .5em; }
.reply-preview { position: absolute; bottom: 100%; left: 0; right: 0; background: #f8fafc; border-top: 1px solid #cbd5e1; padding: 8px 15px; display: none; z-index: 11; justify-content: space-between; align-items: center; border-left: 4px solid var(--tirta-gold);}

/* Fitur Mention & Emoji Reactions */
.chat-reaction-chip { display: inline-block; background: rgba(0,0,0,0.05); border: 1px solid #cbd5e1; border-radius: 12px; padding: 1px 6px; font-size: 0.65rem; cursor: pointer; margin-right: 4px; transition: 0.2s; }
.chat-reaction-chip:hover { background: rgba(0,0,0,0.1); }
.chat-reaction-chip.reacted-by-me { background: #dbeafe; border-color: #bfdbfe; color: #1e40af; font-weight: bold; }
.mention-highlight { background: #fef08a; padding: 0 4px; border-radius: 4px; font-weight: bold; color: #854d0e; }
.bubble-mentioned { box-shadow: 0 0 0 2px #fde047; animation: pulseMention 2s infinite; }
@keyframes pulseMention { 0% { box-shadow: 0 0 0 0 rgba(253, 224, 71, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(253, 224, 71, 0); } 100% { box-shadow: 0 0 0 0 rgba(253, 224, 71, 0); } }

.log-item-anim { animation: slideDownLog 0.3s ease-out; }
@keyframes slideDownLog {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tmc Modal Controls */
.tmc-modal-form-control {
    display: block; width: 100%; height: 38px; padding: 0.375rem 0.75rem; font-size: 0.85rem; font-weight: 600;
    color: #1e293b; background-color: #fff; background-clip: padding-box;
    border: 1px solid #cbd5e1; border-radius: 8px; transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    box-shadow: none !important;
}
.tmc-modal-form-control:focus { border-color: var(--tirta-blue); outline: 0; box-shadow: 0 0 0 3px rgba(48,82,138,.1) !important; }
.tmc-modal-form-control::placeholder { color: #94a3b8; font-weight: 500; }
select.tmc-modal-form-control {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 16px 12px; appearance: none;
}
select.tmc-modal-form-control:disabled { background-color: #f8fafc; color: #94a3b8; }
.tmc-modal-form-label { font-size: 0.75rem; font-weight: 800; color: #334155; margin-bottom: 0.3rem; display: flex; justify-content: space-between; align-items: center; width: 100%; }
.tmc-modal-btn-icon { background: #fff; border: 1px solid #cbd5e1; color: #30528A; border-radius: 8px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; transition: 0.2s; cursor: pointer; flex-shrink: 0; padding: 0;}
.tmc-modal-btn-icon:hover { background: #f8fafc; border-color: var(--tirta-gold); color: var(--tirta-gold); }
.tmc-branch-box { display: flex; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; margin-bottom: 0.5rem; height: 38px; }
.tmc-branch-label { background: #ffffff; color: #64748b; font-weight: 800; font-size: 0.8rem; padding: 0 1.2rem; border-right: 1px solid #cbd5e1; display: flex; align-items: center; }
.tmc-branch-input { border: none; border-radius: 0; box-shadow: none !important; flex-grow: 1; background-color: transparent !important;}
.tmc-branch-input:focus { box-shadow: none !important; }
.discord-req-link { font-size: 0.7rem; font-weight: 800; color: #5865F2; text-decoration: none; transition: 0.2s; display: flex; align-items: center; gap: 4px; }
.discord-req-link:hover { color: #404eed; transform: scale(1.05); }

.tmc-switch { position: relative; display: inline-block; width: 36px; height: 20px; margin: 0; }
.tmc-switch input { opacity: 0; width: 0; height: 0; }
.tmc-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .3s; border-radius: 20px; }
.tmc-slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
.tmc-switch input:checked + .tmc-slider { background-color: var(--tirta-gold); }
.tmc-switch input:checked + .tmc-slider:before { transform: translateX(16px); }

.flatpickr-calendar { z-index: 100050 !important; padding-bottom: 44px !important; border-radius: 12px !important; border: none !important; box-shadow: 0 15px 35px rgba(0,0,0,0.15) !important;}
.flatpickr-apply-wrapper { position: absolute; bottom: 0; left: 0; right: 0; padding: 8px; background: #f8fafc; border-top: 1px solid #e2e8f0; border-radius: 0 0 12px 12px; }

/* ==========================================================================
   🚀 TMC ENTERPRISE FLAT UI (KONSISTEN & PROFESIONAL)
   ========================================================================== */
.tmc-list-item {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 16px 20px; background: #ffffff;
    border-bottom: 1px solid #f1f5f9; transition: background 0.2s ease;
}
.tmc-list-item:hover { background: #f8fafc; }
.tmc-list-item:last-child { border-bottom: none; }

.tmc-avatar {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.1rem; flex-shrink: 0; position: relative;
}
.tmc-avatar.primary { background: rgba(48, 82, 138, 0.1); color: var(--tirta-blue); border: 1px solid rgba(48, 82, 138, 0.15); }
.tmc-avatar.warning { background: rgba(167, 135, 89, 0.1); color: var(--tirta-gold); border: 1px solid rgba(167, 135, 89, 0.15); }
.tmc-avatar.success { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.15); }
.tmc-avatar.neutral { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

.tmc-status-dot {
    position: absolute; bottom: -3px; right: -3px;
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid #ffffff;
}
.tmc-status-dot.online { background-color: #10b981; }
.tmc-status-dot.offline { background-color: #94a3b8; }

.tmc-info-block { flex-grow: 1; min-width: 0; padding: 0 14px; display: flex; flex-direction: column; justify-content: center; line-height: 1.4; }
.tmc-title { font-weight: 700; font-size: 0.9rem; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmc-subtitle { font-size: 0.7rem; color: #64748b; font-weight: 600; margin-top: 4px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px;}
.tmc-tag { display: inline-flex; align-items: center; padding: 2px 6px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; font-size: 0.65rem; font-weight: 700; color: #475569; text-transform: uppercase; }

.tmc-action-area { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-start; flex-shrink: 0; gap: 8px;}
.tmc-btn-group { display: flex; gap: 6px; }
.tmc-icon-btn {
    width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    background: #ffffff; border: 1px solid #e2e8f0; color: #64748b; transition: all 0.2s; outline: none; cursor: pointer;
}
.tmc-icon-btn:hover { background: #f8fafc; color: var(--tirta-blue); border-color: #cbd5e1; }
.tmc-icon-btn.danger:hover { background: #fef2f2; color: #ef4444; border-color: #fecaca; }
.tmc-icon-btn.warning:hover { background: #fffbeb; color: #d97706; border-color: #fde68a; }

.tmc-btn-approve {
    background: linear-gradient(135deg, var(--tirta-blue) 0%, #1e3a68 100%);
    color: #fff; border: none; font-size: 0.75rem; font-weight: 700; padding: 6px 14px; border-radius: 8px; transition: 0.2s; cursor: pointer; box-shadow: 0 2px 4px rgba(48, 82, 138, 0.2);
}
.tmc-btn-approve:hover { background: linear-gradient(135deg, var(--tirta-gold) 0%, #8c714a 100%); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }

/* ==========================================================================
   💬 TMC CHAT ADVANCED UI (INFINITE SCROLL & READ RECEIPTS)
   ========================================================================== */
.chat-read-status {
    font-size: 0.6rem;
    color: #94a3b8;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    cursor: help;
}
.chat-read-status i { font-size: 0.7rem; color: var(--tirta-blue); opacity: 0.6; }

.top-loader-chat {
    width: 100%;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--tirta-gold);
    background: rgba(248, 250, 252, 0.5);
    border-radius: 12px;
    margin-bottom: 15px;
}

/* Scrollbar Chat Lebih Halus */
#chatMessageArea::-webkit-scrollbar { width: 4px; }
#chatMessageArea::-webkit-scrollbar-track { background: transparent; }
#chatMessageArea::-webkit-scrollbar-thumb { background: rgba(203, 213, 225, 0.5); border-radius: 10px; }

/* ==========================================================================
   🤖 DISCORD-STYLE SMART COMMAND AUTOCOMPLETE (PREMIUM UI)
   ========================================================================== */
.chat-input-wrapper {
    position: relative !important;
}
.command-suggestion-box {
    position: absolute;
    bottom: calc(100% + 10px); /* Jarak melayang 10px di atas input chat */
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px); /* Efek kaca blur ala iOS */
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 -8px 25px rgba(0,0,0,0.1);
    margin-bottom: 0;
    display: none;
    z-index: 9999;
    overflow: hidden;
}
.command-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}
.command-item:last-child { border-bottom: none; }
.command-item.active-cmd, .command-item:hover {
    background: #f8fafc;
    border-left: 4px solid var(--tirta-blue);
    padding-left: 12px; /* Kompensasi border biar ngga goyang */
}
.cmd-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(48, 82, 138, 0.1); color: var(--tirta-blue);
    display: flex; align-items: center; justify-content: center;
    margin-right: 14px; font-size: 1.1rem; flex-shrink: 0;
}
.cmd-text-container {
    display: flex; flex-direction: column; line-height: 1.3;
}
.cmd-title { font-weight: 800; color: #1e293b; font-size: 0.9rem; }
.cmd-args { font-weight: 600; color: #94a3b8; font-size: 0.7rem; margin-left: 6px; }
.cmd-desc { font-size: 0.75rem; color: #64748b; margin-top: 4px; font-weight: 600; }