/*
 * Custom CSS - WhatsApp Gateway Dashboard
 * AdminLTE v4 compatible.
 * File ini hanya berisi helper global kecil.
 * Styling besar/polishing UI dilakukan pada tahap akhir.
 */

:root {
    --wag-content-gap: 1rem;
}

.app-main {
    min-height: calc(100vh - 57px);
}

.app-content {
    padding-bottom: 1rem;
}

.app-footer {
    font-size: 0.875rem;
}

.card {
    margin-bottom: var(--wag-content-gap);
}

.card-header .card-title {
    margin-bottom: 0;
}

.table th,
.table td {
    vertical-align: middle;
}

.table-nowrap th,
.table-nowrap td {
    white-space: nowrap;
}

.table-action {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.table-action .btn,
.action-buttons .btn {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.table-action .btn:last-child,
.action-buttons .btn:last-child {
    margin-right: 0;
}

.badge {
    font-weight: 500;
}

.badge+.badge {
    margin-left: 0.25rem;
}

.required-marker {
    font-weight: 700;
}

.form-text-error,
.invalid-feedback {
    font-size: 0.875rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
}

.empty-state-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    margin-bottom: 0;
}

.nav-link-form {
    display: block;
    padding: 0;
    margin: 0;
}

.nav-link-form .nav-link {
    color: var(--bs-secondary-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
}

.nav-link-form .nav-link:hover,
.nav-link-form .nav-link:focus {
    color: var(--bs-body-color);
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-menu .nav-icon {
    display: inline-block;
    width: 1.6rem;
    text-align: center;
}

.sidebar-menu .nav-arrow {
    float: right;
}

.app-sidebar .user-panel .info {
    color: var(--bs-secondary-color);
}

.app-sidebar .user-panel small {
    display: block;
}

.sidebar-brand .brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand .brand-image {
    max-height: 32px;
    width: auto;
}

.dt-buttons {
    text-align: center;
}

.dt-buttons .btn,
.dt-button {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.dataTables_processing {
    z-index: 10;
}

.filter-card .form-label {
    font-weight: 500;
}

.form-control-sm,
.form-select-sm {
    min-height: calc(1.5em + 0.5rem + 2px);
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.text-break-all {
    word-break: break-all;
}

.text-pre-line {
    white-space: pre-line;
}

.cursor-pointer {
    cursor: pointer;
}

.wag-max-width-sm {
    max-width: 480px;
}

.wag-max-width-md {
    max-width: 720px;
}

.wag-max-width-lg {
    max-width: 960px;
}

@media (max-width: 767.98px) {
    .app-content-header h3 {
        font-size: 1.5rem;
    }

    .dt-buttons {
        text-align: left;
        margin-top: 0.5rem;
    }

    .table-action {
        min-width: 120px;
    }
}

/* =========================================================
 * WAG Global Loading & Empty State
 * ========================================================= */

.wag-page-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 249, 250, 0.96);
    opacity: 1;
    visibility: visible;
    transition: opacity .2s ease, visibility .2s ease;
}

.wag-page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.wag-page-loader-box {
    min-width: 240px;
    max-width: 360px;
    padding: 1.5rem;
    text-align: center;
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .08);
}

.wag-section-loading {
    position: relative;
    min-height: 120px;
}

.wag-section-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 10;
    border-radius: .5rem;
    background: rgba(255, 255, 255, .72);
}

.wag-section-loading::before {
    content: "Memperbarui data...";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 11;
    transform: translate(-50%, -50%);
    padding: .5rem .75rem;
    border-radius: .5rem;
    background: #fff;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .08);
    font-size: .875rem;
    color: #6c757d;
}

.wag-dashboard-refresh-indicator {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
}

.wag-empty-state {
    padding: 1.5rem;
    text-align: center;
    color: #6c757d;
}

.wag-empty-state .bi {
    display: block;
    margin-bottom: .5rem;
    font-size: 1.75rem;
}

.wag-chart-empty {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #dee2e6;
    border-radius: .5rem;
    color: #6c757d;
    text-align: center;
    padding: 1rem;
}

button.is-loading,
.btn.is-loading {
    pointer-events: none;
}

.sidebar-brand {
    height: 5rem !important;
}

.sidebar-brand .brand-link .brand-image {
    max-height: 75px !important;
}

.bg-body-tertiary {
    --bs-bg-opacity: 1;
    background-color: rgb(13 110 253 / 7%) !important;
}
