/* =========================================================
   QISA THEME - Klinik Akupuntur
   Warna mengikuti logo QISA
   Hijau: #064C43
   Hijau gelap: #033D36
   Gold: #C99A3E
   Cream: #F8F6F1
========================================================= */

/* Subset ikon yang benar-benar dipakai aplikasi. Satu font lokal WOFF2
   menggantikan WebFont loader dan paket ikon lengkap. */
@font-face {
    font-display: block;
    font-family: "Font Awesome 5 Solid";
    font-style: normal;
    font-weight: 900;
    src: url("../fonts/fontawesome/fa-solid-900.woff2") format("woff2");
}

.fa,
.fas {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-family: "Font Awesome 5 Solid";
    font-style: normal;
    font-variant: normal;
    font-weight: 900;
    line-height: 1;
    text-rendering: auto;
}

.fa-arrow-left::before { content: "\f060"; }
.fa-box-open::before { content: "\f49e"; }
.fa-calendar::before { content: "\f133"; }
.fa-calendar-check::before { content: "\f274"; }
.fa-check-circle::before { content: "\f058"; }
.fa-ellipsis-h::before { content: "\f141"; }
.fa-exclamation-circle::before { content: "\f06a"; }
.fa-exclamation-triangle::before { content: "\f071"; }
.fa-file-excel::before { content: "\f1c3"; }
.fa-filter::before { content: "\f0b0"; }
.fa-home::before { content: "\f015"; }
.fa-info-circle::before { content: "\f05a"; }
.fa-money-bill::before { content: "\f0d6"; }
.fa-notes-medical::before { content: "\f481"; }
.fa-pen::before { content: "\f304"; }
.fa-plus::before { content: "\f067"; }
.fa-question::before { content: "\f128"; }
.fa-search::before { content: "\f002"; }
.fa-sign-out-alt::before { content: "\f2f5"; }
.fa-stethoscope::before { content: "\f0f1"; }
.fa-times::before { content: "\f00d"; }
.fa-user::before { content: "\f007"; }
.fa-user-plus::before { content: "\f234"; }
.fa-users::before { content: "\f0c0"; }
.fa-wallet::before { content: "\f555"; }

:root {
    --qisa-green: #064c43;
    --qisa-green-dark: #033d36;
    --qisa-green-soft: #0e6b60;
    --qisa-gold: #c99a3e;
    --qisa-gold-dark: #a87d2f;
    --qisa-cream: #f8f6f1;
    --qisa-text: #263b37;
    --qisa-muted: #6b7c78;
}

/* =========================
   GLOBAL
========================= */

body {
    background: var(--qisa-cream) !important;
    color: var(--qisa-text) !important;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif !important;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

body,
html {
    color: var(--qisa-text) !important;
}

a:not(.btn):not(.dropdown-item) {
    color: var(--qisa-green) !important;
}

a:not(.btn):not(.dropdown-item):hover,
a:not(.btn):not(.dropdown-item):focus {
    color: var(--qisa-gold) !important;
}

:focus-visible {
    outline: 3px solid rgba(201, 154, 62, 0.55) !important;
    outline-offset: 2px;
}

.qisa-skip-link {
    background: #fff;
    border: 2px solid var(--qisa-gold);
    border-radius: 0 0 8px 8px;
    color: var(--qisa-green-dark) !important;
    font-weight: 700;
    left: 1rem;
    padding: 0.65rem 1rem;
    position: fixed;
    top: 0;
    transform: translateY(-120%);
    transition: transform 0.15s ease;
    z-index: 10000;
}

.qisa-skip-link:focus {
    transform: translateY(0);
}

.qisa-guest-body {
    min-height: 100vh;
}

#main-content:focus {
    outline: none !important;
}

.qisa-auth-card {
    max-width: 460px;
    width: 100%;
}

.qisa-public-card {
    max-width: 500px;
}

.page-title,
.card-title,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--qisa-green) !important;
}

/* =========================
   TEXT COLOR
========================= */

.text-primary,
.text-primary a {
    color: var(--qisa-green) !important;
}

.text-secondary,
.text-secondary a,
.text-warning,
.text-warning a {
    color: var(--qisa-gold) !important;
}

.text-success,
.text-success a {
    color: var(--qisa-green-soft) !important;
}

.text-info,
.text-info a {
    color: #2f7c72 !important;
}

.text-danger,
.text-danger a {
    color: #b94a48 !important;
}

/* =========================
   BACKGROUND COLOR
========================= */

.bg-primary {
    background-color: var(--qisa-green) !important;
}

.bg-secondary,
.bg-warning {
    background-color: var(--qisa-gold) !important;
    color: var(--qisa-green-dark) !important;
}

.bg-success {
    background-color: var(--qisa-green-soft) !important;
}

.bg-info {
    background-color: #2f7c72 !important;
}

.bg-danger {
    background-color: #b94a48 !important;
}

/* =========================
   BUTTON
========================= */

.btn {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
    justify-content: center;
    min-height: 40px;
}

.btn.btn-sm {
    min-height: 36px;
}

.btn-icon.btn-icon-sm {
    height: 40px !important;
    min-width: 40px;
    width: 40px !important;
}

.btn:disabled,
.btn.disabled {
    cursor: not-allowed;
    opacity: 0.68;
}

.qisa-wa-icon {
    align-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    display: inline-flex;
    font-size: 0.58rem;
    font-weight: 800;
    height: 1.25rem;
    justify-content: center;
    letter-spacing: -0.03em;
    line-height: 1;
    width: 1.25rem;
}

.btn-primary {
    background: var(--qisa-green) !important;
    border-color: var(--qisa-green) !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--qisa-green-dark) !important;
    border-color: var(--qisa-green-dark) !important;
    color: #fff !important;
}

.btn-secondary,
.btn-warning {
    background: var(--qisa-gold) !important;
    border-color: var(--qisa-gold) !important;
    color: var(--qisa-green-dark) !important;
}

.btn-secondary:hover,
.btn-warning:hover {
    background: var(--qisa-gold-dark) !important;
    border-color: var(--qisa-gold-dark) !important;
    color: var(--qisa-green-dark) !important;
}

.btn-success {
    background: var(--qisa-green-soft) !important;
    border-color: var(--qisa-green-soft) !important;
    color: #fff !important;
}

.btn-info {
    background: #2f7c72 !important;
    border-color: #2f7c72 !important;
    color: #fff !important;
}

.btn-danger {
    background: #b94a48 !important;
    border-color: #b94a48 !important;
    color: #fff !important;
}

.btn-outline-primary {
    border-color: var(--qisa-green) !important;
    color: var(--qisa-green) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--qisa-green) !important;
    color: #fff !important;
}

.btn-outline-secondary {
    border-color: var(--qisa-gold-dark) !important;
    color: var(--qisa-gold-dark) !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--qisa-gold) !important;
    border-color: var(--qisa-gold) !important;
    color: var(--qisa-green-dark) !important;
}

.btn-light {
    background: #fff !important;
    border-color: rgba(6, 76, 67, 0.15) !important;
    color: var(--qisa-green) !important;
}

/* =========================
   SIDEBAR
========================= */

.sidebar,
.sidebar[data-background-color="dark"],
.sidebar[data-background-color="dark2"] {
    background: linear-gradient(
        180deg,
        var(--qisa-green-dark) 0%,
        var(--qisa-green) 100%
    ) !important;
    color: #fff !important;
}

.sidebar .sidebar-wrapper,
.sidebar[data-background-color="dark"] .sidebar-wrapper,
.sidebar[data-background-color="dark2"] .sidebar-wrapper {
    background: transparent !important;
}

.sidebar .nav .nav-section .text-section,
.sidebar[data-background-color="dark"] .nav .nav-section .text-section,
.sidebar[data-background-color="dark2"] .nav .nav-section .text-section {
    color: var(--qisa-gold) !important;
}

.sidebar .nav > .nav-item a,
.sidebar[data-background-color="dark"] .nav > .nav-item a,
.sidebar[data-background-color="dark2"] .nav > .nav-item a {
    align-items: center;
    color: rgba(255, 255, 255, 0.85) !important;
    min-height: 44px;
}

.sidebar .nav > .nav-item a i,
.sidebar[data-background-color="dark"] .nav > .nav-item a i,
.sidebar[data-background-color="dark2"] .nav > .nav-item a i {
    color: rgba(255, 255, 255, 0.75) !important;
}

.sidebar .nav > .nav-item a p,
.sidebar[data-background-color="dark"] .nav > .nav-item a p,
.sidebar[data-background-color="dark2"] .nav > .nav-item a p {
    color: rgba(255, 255, 255, 0.88) !important;
}

.sidebar .nav > .nav-item a:hover,
.sidebar .nav > .nav-item a:focus,
.sidebar[data-background-color="dark"] .nav > .nav-item a:hover,
.sidebar[data-background-color="dark"] .nav > .nav-item a:focus {
    background: rgba(201, 154, 62, 0.18) !important;
}

.sidebar .nav > .nav-item a:hover i,
.sidebar .nav > .nav-item a:hover p,
.sidebar .nav > .nav-item a:focus i,
.sidebar .nav > .nav-item a:focus p {
    color: #fff !important;
}

.sidebar .nav > .nav-item.active > a,
.sidebar .nav > .nav-item.submenu.active > a,
.sidebar[data-background-color="dark"] .nav > .nav-item.active > a,
.sidebar[data-background-color="dark"] .nav > .nav-item.submenu.active > a {
    background: var(--qisa-gold) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(201, 154, 62, 0.28) !important;
}

.sidebar .nav > .nav-item.active > a i,
.sidebar .nav > .nav-item.active > a p,
.sidebar .nav > .nav-item.submenu.active > a i,
.sidebar .nav > .nav-item.submenu.active > a p {
    color: var(--qisa-green-dark) !important;
}

.sidebar .nav > .nav-item.active > a:before,
.sidebar .nav > .nav-item.active:hover > a:before {
    background: #fff !important;
}

.sidebar .nav-collapse li a .sub-item {
    color: rgba(255, 255, 255, 0.78) !important;
}

.sidebar .nav-collapse li a .sub-item:before {
    background: var(--qisa-gold) !important;
}

.sidebar .nav-collapse li.active > a .sub-item,
.sidebar .nav-collapse li a:hover .sub-item {
    color: #fff !important;
}

.sidebar .nav-collapse li.active > a {
    background: rgba(201, 154, 62, 0.16) !important;
}

.sidebar-logout-form {
    margin: 0;
}

.sidebar-logout-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: flex;
    font: inherit;
    min-height: 44px;
    padding: 10px 25px;
    text-align: left;
    width: 100%;
}

.sidebar-logout-button i {
    color: rgba(255, 255, 255, 0.75);
    font-size: 18px;
    margin-right: 15px;
    min-width: 25px;
    text-align: center;
}

.sidebar-logout-button p {
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
}

.sidebar-logout-button:hover,
.sidebar-logout-button:focus-visible {
    background: rgba(201, 154, 62, 0.18);
}

/* =========================
   LOGO HEADER
========================= */

.logo-header,
.logo-header[data-background-color="dark"],
.logo-header[data-background-color="dark2"] {
    background: var(--qisa-green-dark) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.logo-header .logo,
.logo-header .logo p,
.logo-header .logo span {
    color: #fff !important;
}

.logo-header .btn-toggle,
.logo-header .more {
    color: #fff !important;
    min-height: 44px;
    min-width: 44px;
}

/* =========================
   TOP NAVBAR
========================= */

.main-header {
    background: #fff !important;
    box-shadow: 0 2px 14px rgba(6, 76, 67, 0.06) !important;
}

.navbar-header {
    background: #fff !important;
    border-bottom: 1px solid rgba(6, 76, 67, 0.12) !important;
}

.topbar-user .profile-pic {
    align-items: center;
    display: flex;
}

.dropdown-user .dropdown-item.text-danger {
    color: #9f3432 !important;
}

.dropdown-user .dropdown-item.text-danger:hover,
.dropdown-user .dropdown-item.text-danger:focus {
    background: rgba(185, 74, 72, 0.1) !important;
    color: #842f2d !important;
}

.nav-search .input-group {
    border: 1px solid rgba(6, 76, 67, 0.12) !important;
    background: #fff !important;
}

.nav-search .form-control {
    color: var(--qisa-text) !important;
}

.nav-search .form-control::placeholder {
    color: rgba(6, 76, 67, 0.45) !important;
}

.btn-search,
.search-icon {
    color: var(--qisa-green) !important;
}

/* =========================
   NOTIFICATION
========================= */

.notification {
    background: var(--qisa-gold) !important;
    color: #fff !important;
}

.notif-icon.notif-primary,
.notif-icon.notif-success {
    background: var(--qisa-green) !important;
}

.notif-icon.notif-warning {
    background: var(--qisa-gold) !important;
}

.notif-icon.notif-danger {
    background: #b94a48 !important;
}

.dropdown-title {
    color: var(--qisa-green) !important;
    font-weight: 700 !important;
}

.dropdown-menu .dropdown-item:hover {
    background: rgba(6, 76, 67, 0.07) !important;
    color: var(--qisa-green) !important;
}

.dropdown-menu .dropdown-item {
    align-items: center;
    display: flex;
    min-height: 44px;
}

/* =========================
   CARD
========================= */

.card {
    border: 1px solid rgba(6, 76, 67, 0.08) !important;
    box-shadow: 0 8px 24px rgba(6, 76, 67, 0.06) !important;
    border-radius: 14px !important;
}

.card-header {
    background: #fff !important;
    border-bottom: 1px solid rgba(6, 76, 67, 0.08) !important;
}

.card-title {
    color: var(--qisa-green) !important;
    font-weight: 700 !important;
}

.qisa-quick-actions,
.qisa-page-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.qisa-stat-card {
    height: calc(100% - 20px);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.qisa-stat-card:hover,
.qisa-stat-card:focus-visible {
    box-shadow: 0 12px 28px rgba(6, 76, 67, 0.13) !important;
    transform: translateY(-2px);
}

.qisa-stat-card small {
    color: var(--qisa-green-soft);
    display: inline-block;
    margin-top: 0.45rem;
}

/* =========================
   TABLE
========================= */

.table thead th {
    background: #eef6f4 !important;
    color: var(--qisa-green) !important;
    border-color: rgba(6, 76, 67, 0.12) !important;
    font-weight: 700 !important;
}

.table-bordered,
.table-bordered td,
.table-bordered th {
    border-color: rgba(6, 76, 67, 0.12) !important;
}

.table tbody tr:hover {
    background: rgba(6, 76, 67, 0.035) !important;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    overscroll-behavior-inline: contain;
}

.table-responsive:focus-visible {
    box-shadow: 0 0 0 3px rgba(201, 154, 62, 0.45);
    outline: none !important;
}

.table-responsive > .table {
    margin-bottom: 0;
    min-width: 680px;
}

.table-responsive .dataTables_wrapper table.table {
    min-width: 680px;
}

.qisa-table-number {
    text-align: center !important;
    white-space: nowrap;
    width: 58px;
}

.qisa-table-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    white-space: nowrap;
}

.qisa-empty-state {
    padding: 1.25rem !important;
}

.qisa-filter-form .form-label {
    margin-bottom: 0.4rem;
}

.qisa-filter-actions .btn {
    min-width: 92px;
    white-space: nowrap;
}

.qisa-confirm-icon {
    align-items: center;
    background: rgba(201, 154, 62, 0.16);
    border: 2px solid rgba(201, 154, 62, 0.45);
    border-radius: 50%;
    color: var(--qisa-gold-dark);
    display: flex;
    height: 58px;
    justify-content: center;
    width: 58px;
}

/* =========================
   FORM
========================= */

.form-control,
.form-select {
    border-color: rgba(6, 76, 67, 0.16) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--qisa-green) !important;
    box-shadow: 0 0 0 0.2rem rgba(6, 76, 67, 0.14) !important;
}

label {
    color: var(--qisa-green) !important;
}

.qisa-choice-group {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.qisa-choice-option {
    align-items: center;
    border: 1px solid rgba(6, 76, 67, 0.16);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0.55rem 0.7rem;
}

.qisa-choice-option:hover {
    background: rgba(6, 76, 67, 0.045);
    border-color: var(--qisa-green-soft);
}

.qisa-choice-option input {
    accent-color: var(--qisa-green);
    flex: 0 0 auto;
}

.qisa-choice-option input:checked + span {
    color: var(--qisa-green-dark);
    font-weight: 700;
}

.qisa-payment-total {
    background: #eef6f4;
    border: 1px solid rgba(6, 76, 67, 0.16);
    border-radius: 8px;
    color: var(--qisa-green-dark);
    font-size: 1.15rem;
    font-weight: 700;
    padding: 0.7rem 0.85rem;
}

/* =========================
   BADGE
========================= */

.badge-primary {
    background: var(--qisa-green) !important;
    color: #fff !important;
}

.badge-secondary,
.badge-warning {
    background: var(--qisa-gold) !important;
    color: var(--qisa-green-dark) !important;
}

.badge-neutral {
    background: var(--qisa-muted) !important;
    color: #fff !important;
}

.badge-success {
    background: var(--qisa-green-soft) !important;
    color: #fff !important;
}

.badge-danger {
    background: #b94a48 !important;
    color: #fff !important;
}

.badge-info {
    background: #2f7c72 !important;
    color: #fff !important;
}

/* =========================
   ALERT & FEEDBACK
========================= */

.qisa-alert {
    align-items: center;
    border: 0 !important;
    border-left: 4px solid currentColor !important;
    display: flex;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.qisa-alert .btn-close {
    margin-left: auto;
}

.alert-success {
    background: #e8f4f1 !important;
    color: #075c50 !important;
}

.alert-danger {
    background: #faeceb !important;
    color: #8c3432 !important;
}

.alert-warning {
    background: #fff5df !important;
    color: #79591d !important;
}

/* =========================
   DATATABLE & RESPONSIVE
========================= */

.dataTables_wrapper .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid rgba(6, 76, 67, 0.16);
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
}

.card-body canvas {
    max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 991.98px) {
    .page-inner {
        padding-left: 15px;
        padding-right: 15px;
    }

    .card-header.d-flex {
        align-items: flex-start !important;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

@media (max-width: 767.98px) {
    .page-inner {
        padding-left: 10px;
        padding-right: 10px;
    }

    .card-body,
    .card-header {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    .btn,
    .btn.btn-sm,
    .btn-icon.btn-icon-sm {
        min-height: 44px;
    }

    .btn-icon.btn-icon-sm {
        height: 44px !important;
        min-width: 44px;
        width: 44px !important;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        max-height: calc(100vh - 1rem);
    }

    .modal-body {
        overflow-y: auto;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1 1 130px;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        margin-bottom: 0.75rem;
        text-align: left !important;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter label {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .dataTables_wrapper .dataTables_paginate .pagination {
        flex-wrap: wrap;
        justify-content: flex-start !important;
    }

    .dataTables_wrapper .page-link {
        align-items: center;
        display: inline-flex;
        justify-content: center;
        min-height: 44px;
        min-width: 44px;
    }

    .qisa-alert {
        align-items: flex-start;
    }

    .qisa-quick-actions .btn,
    .qisa-page-actions .btn {
        flex: 1 1 145px;
    }

    .qisa-choice-group {
        grid-template-columns: 1fr;
    }

    .qisa-auth-actions {
        align-items: stretch !important;
        flex-direction: column;
    }

    .qisa-auth-actions .btn {
        width: 100%;
    }

    .qisa-public-shell {
        padding-bottom: 1rem !important;
        padding-top: 1rem !important;
    }

    .qisa-table-actions {
        white-space: normal;
    }

    .table > :not(caption) > * > * {
        padding: 0.65rem 0.55rem;
    }

    .profile-username {
        display: none;
    }
}

@media (max-width: 374.98px) {
    .qisa-back-label {
        display: none;
    }

    .qisa-back-link {
        min-width: 44px;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* =========================
   FOOTER
========================= */

.footer {
    background: #fff !important;
    border-top: 1px solid rgba(6, 76, 67, 0.12) !important;
    color: var(--qisa-muted) !important;
}

.footer strong,
.footer a {
    color: var(--qisa-green) !important;
}
