:root {
    --primary: #244a8f;
    --primary-dark: #193665;
    --soft: #f4f7fb;
    --text: #18253a;
    --muted: #718096;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--soft);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.app-shell { min-height: 100vh; }

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #193665, #244a8f);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    z-index: 1030;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: rgba(255,255,255,.15); display: grid; place-items: center;
    font-size: 21px;
}
.brand-title { font-weight: 800; letter-spacing: .5px; }
.brand small { opacity: .7; }

.sidebar .nav-link {
    color: rgba(255,255,255,.78);
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 5px;
}
.sidebar .nav-link i { width: 24px; display: inline-block; }
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.14);
}

.sidebar-bottom { margin-top: auto; }
.user-mini { display: flex; gap: 10px; align-items: center; padding: 10px 6px; }
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,.15); display: grid; place-items: center;
}

.main-content { margin-left: 260px; min-height: 100vh; }
.topbar {
    height: 78px; background: #fff; border-bottom: 1px solid #e7ecf3;
    display: flex; align-items: center; gap: 14px; padding: 0 30px;
    position: sticky; top: 0; z-index: 1000;
}
.topbar-title { font-weight: 800; font-size: 20px; }
.content-area { padding: 28px 30px 50px; }

.stat-card {
    background: #fff; border: 0; border-radius: 16px; padding: 20px;
    box-shadow: 0 6px 24px rgba(25,54,101,.06); height: 100%;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 13px;
    display: grid; place-items: center; font-size: 21px;
    background: #edf3ff; color: var(--primary);
}
.stat-value { font-size: 28px; font-weight: 800; margin-top: 14px; }
.stat-label { color: var(--muted); font-size: 13px; }

.card-modern {
    border: 0; border-radius: 16px; background: #fff;
    box-shadow: 0 6px 24px rgba(25,54,101,.06);
}
.card-modern .card-header { background: transparent; border-bottom: 1px solid #edf0f5; padding: 18px 20px; }
.card-modern .card-body { padding: 20px; }

.table > :not(caption) > * > * { padding: 13px 12px; vertical-align: middle; }
.table thead th { white-space: nowrap; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #69778c; }

.badge-status { border-radius: 999px; padding: 7px 10px; font-weight: 600; font-size: 11px; }

.form-control, .form-select { border-radius: 10px; padding: 10px 12px; }
.btn { border-radius: 10px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.empty-state { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty-state i { font-size: 45px; opacity: .45; }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 18, 34, .55);
    z-index: 1020;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.show { transform: translateX(0); }
    .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
    .main-content { margin-left: 0; }
    .content-area { padding: 20px 16px 40px; }
    .topbar { padding: 0 16px; }
}

.badge-mobile {
    font-size: 9px; font-weight: 800; letter-spacing: .4px;
    background: rgba(255,255,255,.18); color: #fff;
    border-radius: 999px; padding: 2px 6px; margin-left: 6px; vertical-align: 1px;
}

/* ===== Mode Cepat (pengayaan mobile — TP 4.5) ===== */
.quick-hint {
    background: #eef4ff; color: var(--primary-dark);
    border-radius: 12px; padding: 12px 14px; font-size: 13px;
    display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px;
}
.quick-hint i { font-size: 18px; margin-top: 1px; }
.quick-search { display: flex; gap: 8px; margin-bottom: 22px; }
.quick-search .form-control { border-radius: 12px; }
.quick-search .btn { border-radius: 12px; }
.quick-section-title {
    text-transform: uppercase; font-size: 12px; letter-spacing: .5px;
    color: var(--muted); margin-bottom: 10px; font-weight: 700;
}
.quick-card {
    background: #fff; border-radius: 14px; padding: 14px 16px;
    box-shadow: 0 4px 16px rgba(25,54,101,.06);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-bottom: 10px;
}
.quick-card-name { font-weight: 700; }
.quick-card-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.quick-toggle { white-space: nowrap; border-radius: 10px; }
.quick-form-wrap { margin: -4px 0 12px; }
.quick-form { background: #f4f7fb; border-radius: 14px; padding: 12px; }

@media (max-width: 575.98px) {
    .quick-card { flex-direction: column; align-items: stretch; }
    .quick-toggle { width: 100%; }
}

/* ===== Editor kondisi cepat (dropdown di halaman Data Alat) ===== */
.kondisi-editor.is-busy { opacity: .55; pointer-events: none; }
.kondisi-option.is-current { font-weight: 700; background-color: #f4f7fb; }
.badge-status.is-saved { animation: stokTersimpan .9s ease-out; }

/* ===== Editor stok inline (halaman Data Alat) ===== */
.stok-editor { display: flex; align-items: center; gap: 4px; }
.stok-editor .stok-input {
    width: 72px; text-align: center; font-weight: 700;
    padding: 5px 6px; border-radius: 8px;
}
.stok-editor .btn { padding: 4px 8px; line-height: 1; }
.stok-editor.is-busy { opacity: .55; pointer-events: none; }
.stok-editor .stok-input.is-invalid { border-color: #dc3545; }

/* Tombol simpan hanya muncul saat angka diubah (khusus mode JS) */
.js-ready .stok-editor [data-stok-simpan] { display: none; }
.js-ready .stok-editor.is-dirty [data-stok-simpan] { display: inline-block; }

@keyframes stokTersimpan {
    0%   { background-color: #d1f2e1; }
    100% { background-color: #fff; }
}
.stok-editor .stok-input.is-saved { animation: stokTersimpan .9s ease-out; }
