/* ==========================================================================
   ALIE ACCOUNTING - GLOBAL STYLE
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Typography & Basic Elements
   -------------------------------------------------------------------------- */
body {
    font-family: 'Lato', sans-serif !important;
}

/* Form Customization */
.form-control {
    margin-top: -2px;
}

/* Custom Scrollbar for non-overlay views */
.table-responsive {
    overflow-x: auto;
}

/* --------------------------------------------------------------------------
   2. UI Standardization (Forms, Buttons, DataTables)
   -------------------------------------------------------------------------- */
/* Buttons */
.btn {
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #C32019 !important;
    border-color: #C32019 !important;
}

.btn-primary:hover,
.btn-primary:active {
    background-color: #a01a14 !important;
    border-color: #a01a14 !important;
    box-shadow: 0 4px 10px rgba(195, 32, 25, 0.3);
}

.btn-light-primary {
    background-color: rgba(195, 32, 25, 0.1) !important;
    color: #C32019 !important;
}

.btn-light-primary:hover {
    background-color: #C32019 !important;
    color: #ffffff !important;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #C32019;
    box-shadow: 0 0 0 0.25rem rgba(195, 32, 25, 0.25);
}

/* Select2 Standardization */
.select2-container--bootstrap-5 .select2-selection {
    min-height: 40px;
    border-radius: 6px;
    border: 1px solid #ced4da !important;
}

.select2-container--bootstrap-5 .select2-selection:focus {
    border-color: #C32019 !important;
    box-shadow: 0 0 0 0.25rem rgba(195, 32, 25, 0.25) !important;
}

.select2-container--default .select2-selection {
    border-color: #dee2e6 !important;
    height: 38px !important;
    background-color: #f8f9fa !important;
}

.select2-container--default .select2-selection__rendered {
    color: #212529 !important;
    display: block !important;
    line-height: 36px !important;
    padding-left: 12px !important;
}

/* DataTables Standardization */
table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
}

table.dataTable thead th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6 !important;
    padding: 12px 10px;
}

table.dataTable tbody td {
    padding: 10px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

table.dataTable tbody tr:hover {
    background-color: #f8f9fa;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #C32019 !important;
    color: white !important;
    border: 1px solid #C32019 !important;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   3. Custom Glassmorphic Toast System
   -------------------------------------------------------------------------- */
.custom-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.custom-toast {
    min-width: 320px;
    max-width: 440px;
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    color: #ffffff !important;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-left: 5px solid #10b981 !important;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
    opacity: 0;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
}

.custom-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.custom-toast.success {
    border-left-color: #10b981 !important;
    box-shadow: 0 10px 30px -10px rgba(16, 185, 129, 0.25), 0 20px 40px -10px rgba(0, 0, 0, 0.5) !important;
}

.custom-toast.error {
    border-left-color: #ef4444 !important;
    box-shadow: 0 10px 30px -10px rgba(239, 68, 68, 0.25), 0 20px 40px -10px rgba(0, 0, 0, 0.5) !important;
}

.custom-toast.warning {
    border-left-color: #f59e0b !important;
    box-shadow: 0 10px 30px -10px rgba(245, 158, 11, 0.25), 0 20px 40px -10px rgba(0, 0, 0, 0.5) !important;
}

.custom-toast.info {
    border-left-color: #ff5c5c !important;
    box-shadow: 0 10px 30px -10px rgba(255, 92, 92, 0.25), 0 20px 40px -10px rgba(0, 0, 0, 0.5) !important;
}

.custom-toast-icon {
    font-size: 1.4rem !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.custom-toast.success .custom-toast-icon {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.15);
}

.custom-toast.error .custom-toast-icon {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.15);
}

.custom-toast.warning .custom-toast-icon {
    color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.15);
}

.custom-toast.info .custom-toast-icon {
    color: #ff5c5c !important;
    background: rgba(255, 92, 92, 0.15);
}

.custom-toast-content {
    flex-grow: 1 !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

.custom-toast-close {
    background: none !important;
    border: none !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    font-size: 1.1rem !important;
    padding: 0 !important;
    transition: color 0.2s ease !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.custom-toast-progress {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 3px !important;
    width: 100% !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.custom-toast-progress-bar {
    height: 100% !important;
    width: 100% !important;
    transform-origin: left !important;
    animation: toast-progress-anim 4s linear forwards !important;
}

.custom-toast.success .custom-toast-progress-bar {
    background: #10b981 !important;
}

.custom-toast.error .custom-toast-progress-bar {
    background: #ef4444 !important;
}

.custom-toast.warning .custom-toast-progress-bar {
    background: #f59e0b !important;
}

.custom-toast.info .custom-toast-progress-bar {
    background: #ff5c5c !important;
}

@keyframes toast-progress-anim {
    to {
        transform: scaleX(0);
    }
}



/* --------------------------------------------------------------------------
   4. Sidebar Brand Logo - Center & Navbar Height Alignment
   -------------------------------------------------------------------------- */
.sidebar-brand {
    height: 3.5rem !important;
    /* Align exactly with navbar height (56px) */
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sidebar-brand .brand-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
}

.sidebar-brand .brand-link .brand-image {
    max-height: 38px !important;
    width: auto !important;
    display: block !important;
    margin: 0 auto !important;
    float: none !important;
}

/* Helper Classes for Header */
.header-company-container {
    max-width: 280px;
    min-width: 0;
    flex-shrink: 1;
}

.header-year-container {
    max-width: 220px;
    min-width: 0;
    flex-shrink: 1;
}

@media (max-width: 991px) {
    .header-company-container {
        max-width: 200px;
    }

    .header-year-container {
        max-width: 160px;
    }
}

@media (max-width: 767px) {
    .header-company-container {
        max-width: 150px;
    }

    .header-year-container {
        max-width: 120px;
    }
}

@media (max-width: 575px) {
    .header-company-container {
        max-width: 120px;
    }

    .header-year-container {
        max-width: 100px;
    }
}

/* 5. Sidebar Menu Icons - Custom Font Size */
.sidebar-wrapper .nav-icon {
    font-size: calc(var(--app-font-size, 1rem) + 2px) !important;
    /* Font size + 2 */
}

/* 6. Safely Center Sidebar Menu Icons When Collapsed */
body.sidebar-collapse .app-sidebar:not(:hover) .sidebar-wrapper .nav-link {
    justify-content: center !important;
    width: 3rem !important;
    /* Kurangi lebar pill agar tidak menempel di kanan */
    margin: 0 auto !important;
    /* Posisikan pill di tengah sidebar */
}

body.sidebar-collapse .app-sidebar:not(:hover) .sidebar-wrapper .nav-link.gap-2 {
    gap: 0 !important;
}

body.sidebar-collapse .app-sidebar:not(:hover) .sidebar-wrapper .nav-link .end-icon {
    display: none !important;
    /* Sembunyikan arrow saat collapsed */
}

/* 7. Hide Submenus (Treeview) When Collapsed */
body.sidebar-collapse .app-sidebar:not(:hover) .sidebar-wrapper .nav-treeview {
    display: none !important;
    /* Sembunyikan submenu, hanya tampilkan induk */
}

/* 8. Adjust Chevron Arrow Size in Expanded Mode */
.sidebar-wrapper .nav-link .end-icon {
    font-size: 0.8rem !important;
    /* Perkecil ukuran arrow agar sesuai dengan icon utama */
}