/* Kerangka situs Koperasi (mandiri, tanpa dashboard.css TERA) */
:root { --surface: #fff; --border: #e2e8f0; --text: #0f172a; --text-muted: #64748b; --bg: #f8fafc; }
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Poppins', system-ui, sans-serif; color: var(--text); background: #fffbf5; min-height: 100vh; }
a { color: inherit; }

.app-nav { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid #f1e7d6; }
.app-nav-in { max-width: 1040px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 14px; }
.app-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; color: #92400e; text-decoration: none; font-size: 14.5px; white-space: nowrap; }
.app-brand img { width: 32px; height: 32px; object-fit: contain; }
.app-links { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.app-links::-webkit-scrollbar { display: none; }
.app-links a { padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #475569; text-decoration: none; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.app-links a:hover { background: #fef3c7; }
.app-links a.on { background: #b45309; color: #fff; }
.app-user { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.app-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: #334155; cursor: pointer; text-decoration: none; }
.app-btn.solid { background: #b45309; border-color: #b45309; color: #fff; }

.app-main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 50px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-title { margin: 0; font-size: 22px; font-weight: 800; color: #92400e; }
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.app-pesan { text-align: center; color: var(--text-muted); padding: 50px 16px; }
.app-pesan i { font-size: 34px; color: #d97706; margin-bottom: 10px; }
.app-pesan h2 { margin: 0 0 6px; color: #92400e; font-size: 18px; }
.kp-wrap { max-width: none; }
@media (max-width: 700px) { .app-user .nm { display: none; } .app-brand span { display: none; } }

/* Kotak identitas pengguna */
.app-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; background: #fff7ed; border: 1px solid #fde4c4; border-radius: 999px; }
.app-av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #d97706, #92400e); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.app-chip-t { display: flex; flex-direction: column; line-height: 1.2; max-width: 190px; }
.app-chip-t b { font-size: 12.5px; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-chip-t small { font-size: 11px; color: #b45309; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-chip-out { width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; color: #92400e; cursor: pointer; font-size: 13px; }
.app-chip-out:hover { background: #fde4c4; }
@media (max-width: 700px) { .app-chip-t { display: none; } .app-chip { padding-right: 4px; } }

/* Dialog masuk */
.swal2-popup.kp-login { border-radius: 22px; padding: 28px 26px 22px; font-family: 'Poppins', system-ui, sans-serif; }
.kp-login .swal2-html-container { margin: 0; padding: 0; overflow: visible; }
.kp-login-logo { width: 64px; height: 64px; object-fit: contain; display: block; margin: 0 auto 10px; }
.kp-login-judul { font-size: 20px; font-weight: 800; color: #92400e; text-align: center; }
.kp-login-sub { font-size: 13px; color: #64748b; text-align: center; margin: 4px 0 18px; }
.kp-login-f { display: flex; align-items: center; gap: 10px; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 0 12px; margin-bottom: 12px; background: #f8fafc; transition: .15s; }
.kp-login-f:focus-within { border-color: #b45309; background: #fff; box-shadow: 0 0 0 3px rgba(180,83,9,.15); }
.kp-login-f > i { color: #b45309; width: 16px; text-align: center; }
.kp-login-f input { flex: 1; border: none; outline: none; background: transparent; padding: 13px 0; font: inherit; font-size: 14px; color: #0f172a; min-width: 0; }
.kp-login-mata { border: none; background: transparent; color: #94a3b8; cursor: pointer; padding: 6px; }
.kp-login .swal2-actions { margin-top: 18px; gap: 10px; width: 100%; }
.kp-login-ok, .kp-login-batal { flex: 1; padding: 12px 18px; border-radius: 12px; border: none; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.kp-login-ok { background: #b45309; color: #fff; }
.kp-login-ok:hover { background: #92400e; }
.kp-login-batal { background: #f1f5f9; color: #475569; }
.kp-login .swal2-validation-message { margin: 4px 0 0; border-radius: 10px; font-size: 12.5px; }

/* ── Penyesuaian navbar: muat 7 menu + tombol Keluar yang jelas ── */
.app-nav-in { max-width: 1240px; flex-wrap: wrap; row-gap: 4px; }
.app-brand { margin-right: 4px; }
.app-links a { padding: 8px 11px; }
.app-chip { padding: 4px 4px 4px 4px; }
.app-chip-t b { max-width: 150px; }
.app-chip-out { width: auto; height: 34px; padding: 0 14px; border-radius: 999px; background: #b45309; color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.app-chip-out::after { content: 'Keluar'; }
.app-chip-out:hover { background: #92400e; }
@media (max-width: 1100px) {
    .app-user { margin-left: auto; }
    .app-links { order: 3; flex-basis: 100%; }
}
@media (max-width: 700px) { .app-chip-out::after { content: none; } .app-chip-out { width: 34px; padding: 0; justify-content: center; } }

/* ── HP ── */
@media (max-width: 700px) {
    .app-brand span { display: inline; }
    .app-nav-in { padding: 8px 12px; }
    .app-links a { padding: 7px 10px; font-size: 12.5px; }
}

/* Menu sedikit (belum login / non-pengurus): satu baris, sejajar dengan tombol Masuk */
.app-nav-in.sedikit .app-links { order: 0; flex: 1; flex-basis: auto; }
.app-nav-in.sedikit .app-user { margin-left: 0; }

/* ── Menu dropdown (Toko, Pengaturan) ── */
.app-links { overflow: visible; }
.app-dd { position: relative; }
.app-dd-btn { padding: 8px 11px; border-radius: 999px; border: none; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: #475569; cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.app-dd-btn:hover { background: #fef3c7; }
.app-dd-btn.on { background: #b45309; color: #fff; }
.app-dd-ch { font-size: 9px; opacity: .7; transition: transform .15s; }
.app-dd.buka .app-dd-ch { transform: rotate(180deg); }
.app-dd-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 190px; background: #fff; border: 1px solid #f1e7d6; border-radius: 14px; padding: 6px; box-shadow: 0 14px 30px -10px rgba(0,0,0,.2); z-index: 30; }
.app-dd.buka .app-dd-menu { display: block; }
.app-dd-menu a { display: flex; border-radius: 10px; }

/* Pilihan mode masuk (Pegawai / Kasir siswa) */
.kp-mode { display: flex; gap: 4px; background: #f1f5f9; border-radius: 12px; padding: 4px; margin: 12px 0 10px; }
.kp-mode button { flex: 1; border: none; background: transparent; padding: 8px 6px; border-radius: 9px; font: inherit; font-size: 12.5px; font-weight: 700; color: #64748b; cursor: pointer; }
.kp-mode button.on { background: #fff; color: #92400e; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
