/* app.css — gaya bersama untuk semua halaman menu (Transaction, Transaction Group, Master Account, Music).
   Bahasa visual mengikuti halaman Transaction: header putih, latar abu muda, list-group, ikon bulat. */

:root {
    --orange-1: #ff9a4a;
    --orange-2: #ff7a1a;
    --orange-3: #f5590b;
    --orange-4: #c0430a;
    --orange-5: #8f2f08;
    --peach: #ffe9d2;
    --app-border: #e6e6e6;
}

html {
    font-size: 14px;
}

[hidden] {
    display: none !important;
}

/* ===== Loading screen ===== */
#loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    position: fixed;
    inset: 0;
    background: rgba(75, 70, 92, 0.5);
}

/* ===== Page shell: header tetap, konten scroll sendiri ===== */
.app-shell {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bs-light);
}

.app-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    padding-top: calc(1rem + env(safe-area-inset-top));
    background: #fff;
    border-bottom: 1px solid var(--app-border);
    flex-shrink: 0;
}

.app-header .app-title {
    font-weight: 700;
    margin: 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header .app-subtitle {
    font-size: 0.8rem;
    color: gray;
    line-height: 1;
}

.btn-icon {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-back {
    color: #555;
    background: #f1f1f1;
    border: none;
}

.btn-back:hover,
.btn-back:active {
    background: #e5e5e5 !important;
}

.app-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    overscroll-behavior-y: contain;
}

/* ===== Search ===== */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-box > .bi {
    position: absolute;
    left: 1rem;
    pointer-events: none;
}

.search-box .form-control {
    padding-left: 2.5rem;
}

/* ===== List item ===== */
.icon-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.bg-orange {
    background-color: #ff6600;
}

.bg-blue {
    background-color: #007bff;
}

.bg-muted {
    background-color: #adb5bd;
}

.text-small {
    font-size: 0.9rem;
}

.text-tiny {
    font-size: 0.8rem;
    color: gray;
}

.list-group-item.clickable:hover,
.list-group-item[data-clickable]:hover {
    background-color: rgb(248, 248, 248);
    cursor: pointer;
}

.list-group-item.is-inactive .item-body {
    opacity: 0.55;
}

.empty-state {
    text-align: center;
    color: var(--bs-secondary-color);
    padding: 3rem 1rem;
}

.empty-state > .bi {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* ===== Modal (seragam dengan form Transaction) ===== */
.btn-modal-delete {
    height: 1.97rem;
    width: 1.97rem;
    padding: 0.15rem;
}

.min-w-0 {
    min-width: 0;
}

/* ===== Asset (Asset Category, Master Asset, Asset Depreciation) ===== */
.num {
    font-variant-numeric: tabular-nums;
}

.bg-teal {
    background-color: #1baf7a;
}

/* Chip filter yang bisa digeser mendatar */
.chip-scroll {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0 1rem 0.25rem;
    scrollbar-width: none;
}

.chip-scroll::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    flex-shrink: 0;
    border: 1px solid var(--app-border);
    background: #fff;
    color: #555;
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-chip.active {
    background: var(--orange-2);
    border-color: var(--orange-2);
    color: #fff;
    font-weight: 600;
}

.filter-chip .count {
    opacity: 0.7;
    margin-left: 0.25rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--peach);
    color: var(--orange-4);
}

.pill.pill-muted {
    background: #ececec;
    color: #6c757d;
}

.pill.pill-green {
    background: #e8f5ee;
    color: #198754;
}

/* Thumbnail foto aset */
.asset-thumb {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--peach);
    color: var(--orange-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* Area pilih foto di form aset */
.photo-drop {
    position: relative;
    width: 100%;
    height: 160px;
    border: 1.5px dashed #cfcfcf;
    border-radius: 0.9rem;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    cursor: pointer;
    overflow: hidden;
}

.photo-drop > .bi {
    font-size: 2rem;
    color: var(--orange-2);
}

.photo-drop img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f1f1f1;
}

.photo-drop.has-photo {
    border-style: solid;
}

.hint-box {
    background: var(--peach);
    color: #7a3b12;
    border-radius: 0.75rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
}

/* Progress penyusutan */
.depr-bar {
    height: 6px;
    border-radius: 999px;
    background: #ececec;
    overflow: hidden;
}

.depr-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--orange-1), var(--orange-3));
}

.depr-bar.is-depleted > span {
    background: #adb5bd;
}

/* Input tanggal transparan di atas tombol ikon (class ini ikut terbawa ke input date bawaan HP dari flatpickr) */
.date-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0; /* input date iOS/Android punya lebar minimum bawaan yang mengabaikan width */
    -webkit-appearance: none;
    appearance: none;
    opacity: 0;
    cursor: pointer;
    border: 0;
    padding: 0;
    font-size: 16px; /* < 16px membuat iOS men-zoom halaman saat input difokus */
}

/* Kartu ringkasan (hero) */
.depr-hero {
    background: linear-gradient(135deg, var(--orange-2) 0%, var(--orange-3) 60%, var(--orange-4) 100%);
    color: #fff;
    border-radius: 1.25rem;
    padding: 1rem;
}

.depr-hero .label-xs {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.3;
}

.depr-hero .hero-value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.15;
}

.depr-hero .depr-bar {
    background: rgba(0, 0, 0, 0.2);
}

.depr-hero .depr-bar > span {
    background: #fff;
}

.depr-hero .hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}

.depr-hero .hero-grid .v {
    font-weight: 700;
}

/* ===== Hide money =====
   Setiap nominal uang dibungkus class "money" (termasuk label Rp dan tanda +/−).
   Saat <html> memiliki class "hide-money", nominal disamarkan tanpa mengubah teks aslinya.
   Toggle: tombol apa pun dengan atribut [data-money-toggle] (lihat template.php). */
.money {
    transition: filter 0.15s ease;
}

.hide-money .money {
    filter: blur(7px);
    user-select: none;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a8a8a;
    padding: 0 1rem;
    margin: 1rem 0 0.4rem;
}

.detail-photo {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    background: #f1f1f1;
    border-radius: 0.9rem;
}

.kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}

.kv-grid .k {
    font-size: 0.8rem;
    color: gray;
}

.kv-grid .v {
    font-weight: 600;
}

.table-schedule {
    font-size: 0.9rem;
}

.table-schedule th {
    font-size: 0.8rem;
    color: gray;
    font-weight: 600;
}

.table-schedule tr.is-current > * {
    background: var(--peach);
    font-weight: 600;
}
