/* =====================================================
   TAHAP 8 - GLASSMORPHISM LITE CORPORATE DASHBOARD
   (Tailwind CSS dimuat via CDN pada masing-masing view)
   ===================================================== */

:root {
    --glass-bg: rgba(255, 255, 255, 0.30);
    --glass-bg-strong: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.55);
    --glass-shadow: 0 20px 40px -12px rgba(31, 41, 55, 0.18);
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Latar belakang utama aplikasi (glassmorphism lite) */
.app-bg {
    background: linear-gradient(to bottom right, #dbeafe, #f3e8ff, #fce7f3);
    background-attachment: fixed;
    min-height: 100vh;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.6);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.8);
}
::-webkit-scrollbar-track {
    background: transparent;
}

/* ---------- Kartu Kaca (Glass Card) ---------- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.glass-card:hover {
    box-shadow: 0 24px 48px -12px rgba(31, 41, 55, 0.24);
}
.glass-card-hover:hover {
    transform: translateY(-2px);
}

/* Kartu dengan opasitas lebih pekat, untuk form/modal agar tetap terbaca */
.glass-card-strong {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1.25rem;
}

/* ---------- Sidebar Kaca ---------- */
.glass-sidebar {
    background: rgba(255, 255, 255, 0.30);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--glass-border);
}

/* ---------- Header Kaca ---------- */
.glass-header {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}

/* ---------- Bottom Navigation (Mobile) ---------- */
.glass-bottom-nav {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -8px 24px -8px rgba(31, 41, 55, 0.15);
}
.bottom-nav-item {
    transition: color 0.15s ease, transform 0.15s ease;
}
.bottom-nav-item.active {
    color: #4338ca;
}
.bottom-nav-item:active {
    transform: scale(0.92);
}

/* ---------- Menu Sidebar ---------- */
.nav-link {
    color: #4b5563;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out, transform 0.15s ease;
}
.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.55);
    color: #4338ca;
    transform: translateX(2px);
}
.nav-link.active {
    background: linear-gradient(to right, rgba(99, 102, 241, 0.85), rgba(168, 85, 247, 0.85));
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 8px 16px -6px rgba(99, 102, 241, 0.5);
}

/* ---------- Tombol ---------- */
.btn-glass {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-glass:hover {
    background: rgba(255, 255, 255, 0.65);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px -6px rgba(31, 41, 55, 0.18);
}
.btn-primary {
    background: linear-gradient(to right, #4f46e5, #9333ea);
    color: #fff;
    transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 10px 20px -8px rgba(79, 70, 229, 0.55);
}
.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 14px 24px -8px rgba(79, 70, 229, 0.65);
}
.btn-primary:active { transform: translateY(0); }

/* ---------- Badge Jenis Transaksi ---------- */
.badge-income {
    background-color: rgba(220, 252, 231, 0.9);
    color: #16a34a;
}
.badge-expense {
    background-color: rgba(254, 226, 226, 0.9);
    color: #dc2626;
}
.badge-transfer {
    background-color: rgba(219, 234, 254, 0.9);
    color: #2563eb;
}

/* ---------- Toast Notification ---------- */
#toastContainer {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 22rem;
}
.toast-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.1rem;
    border-radius: 1rem;
    color: #fff;
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 12px 24px -8px rgba(31, 41, 55, 0.35);
    animation: toastIn 0.25s ease-out;
}
.toast-item.toast-out {
    animation: toastOut 0.2s ease-in forwards;
}
.toast-success { background-color: rgba(22, 163, 74, 0.92); }
.toast-error   { background-color: rgba(220, 38, 38, 0.92); }
.toast-info    { background-color: rgba(37, 99, 235, 0.92); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(12px) scale(0.96); }
}

/* ---------- Modal Modern ---------- */
.modal-overlay {
    background: rgba(30, 27, 60, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: overlayIn 0.2s ease-out;
}
@keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.modal-panel {
    animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Loading Animation ---------- */
.loader-dots {
    display: inline-flex;
    gap: 0.3rem;
}
.loader-dots span {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: #6366f1;
    animation: loaderBounce 0.6s infinite alternate;
}
.loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.loader-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes loaderBounce {
    from { transform: translateY(0); opacity: 0.5; }
    to   { transform: translateY(-6px); opacity: 1; }
}
.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.25) 25%, rgba(255,255,255,0.5) 37%, rgba(255,255,255,0.25) 63%);
    background-size: 400% 100%;
    animation: skeletonShine 1.4s ease infinite;
    border-radius: 0.75rem;
}
@keyframes skeletonShine {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---------- Empty State ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6b7280;
}
.empty-state .empty-icon {
    font-size: 2.75rem;
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

/* Tab jenis laporan (laporan.php) */
.tab-btn {
    color: #4b5563;
    background: transparent;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}
.tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
}
.tab-btn.tab-active {
    background: linear-gradient(to right, #4f46e5, #9333ea);
    color: #ffffff;
    box-shadow: 0 8px 16px -6px rgba(79, 70, 229, 0.5);
}

/* Animasi fade sederhana untuk modal lama (kompatibilitas) */
.fade-in {
    animation: fadeIn 0.15s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Hover animation generik untuk baris tabel */
.row-hover {
    transition: background-color 0.15s ease;
}
.row-hover:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

@media print {
    .no-print { display: none !important; }
}
