/* BIP — mobile app styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #e8efff;
  --bg: #eef2f7;
  --page: #f7f9fc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --info: #0284c7;
  --info-soft: #e0f2fe;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.phone {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--page);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(15, 23, 42, .12);
}

/* App bar */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 14px 12px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb 60%, #3b82f6);
  color: #fff;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .25);
}
.appbar__btn {
  width: 38px; height: 38px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; background: rgba(255,255,255,.16);
  color: #fff; cursor: pointer;
}
.appbar__btn:active { background: rgba(255,255,255,.28); }
.appbar__title { flex: 1; min-width: 0; }
.appbar__branding { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.appbar__branding h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .6px; line-height: 1; }
.appbar__logo {
  width: 38px; height: 38px; flex: none; border-radius: 11px; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
}
.appbar__logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.appbar__title h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar__title p { margin: 1px 0 0; font-size: 11.5px; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar__avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: 1.5px solid rgba(255,255,255,.45);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex: none;
}
.appbar--plain { border-radius: 0 0 18px 18px; }

.content { flex: 1; padding: 14px 14px 92px; }
.content--flush { padding: 0 0 92px; }

/* Bottom nav */
.bottomnav {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 30;
  display: flex; justify-content: space-around; align-items: stretch;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav__item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 2px; color: #94a3b8; font-size: 10.5px; font-weight: 600;
  border-radius: 10px;
}
.bottomnav__item svg { width: 22px; height: 22px; }
.bottomnav__item.active { color: var(--primary); }
.bottomnav__item.active svg { stroke-width: 2.2; }

/* Cards & sections */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px;
  margin-bottom: 12px;
}
.card--flat { box-shadow: none; border: 1px solid var(--line); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card__head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.card__head a { font-size: 12px; color: var(--primary); font-weight: 600; }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 2px 8px; font-size: 12px; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase; color: var(--muted);
}
.section-title a { font-size: 11.5px; color: var(--primary); text-transform: none; letter-spacing: 0; }

.hero {
  background: linear-gradient(135deg, #1e40af, #2563eb 55%, #60a5fa);
  color: #fff; border-radius: 20px; padding: 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .28);
  margin-bottom: 14px;
}
.hero__avatar {
  width: 48px; height: 48px; border-radius: 16px; flex: none;
  background: rgba(255,255,255,.2); border: 1.5px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px;
}
.hero__text { flex: 1; min-width: 0; }
.hero__text p { margin: 0 0 2px; font-size: 12px; opacity: .85; }
.hero__text h2 { margin: 0; font-size: 18px; font-weight: 700; }
.hero__role { display: inline-block; margin-top: 6px; font-size: 11px; padding: 2px 8px; border-radius: 20px; background: rgba(255,255,255,.18); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.stat {
  background: var(--surface); border-radius: 14px; padding: 13px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
}
.stat__icon {
  width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.stat__icon.is-green { background: var(--green-soft); color: var(--green); }
.stat__icon.is-amber { background: var(--amber-soft); color: var(--amber); }
.stat__icon.is-red { background: var(--red-soft); color: var(--red); }
.stat__icon.is-info { background: var(--info-soft); color: var(--info); }
.stat b { font-size: 22px; line-height: 1.1; font-weight: 700; }
.stat span { font-size: 11.5px; color: var(--muted); }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick {
  background: var(--surface); border-radius: 14px; padding: 12px 6px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 600; color: #334155; text-align: center;
}
.quick .qi { color: var(--primary); }
.quick:active { transform: scale(.97); }

/* Lists */
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list__item {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.list__item:last-child { border-bottom: 0; }
.list__item:active { background: #f8fafc; }
.list__body { flex: 1; min-width: 0; }
.list__body b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list__body small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.list__end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.list__end b { font-size: 13px; }
.list__end .arrow { color: #cbd5e1; }
.list__icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.list__icon.green { background: var(--green-soft); color: var(--green); }
.list__icon.amber { background: var(--amber-soft); color: var(--amber); }
.list__icon.red { background: var(--red-soft); color: var(--red); }

/* Chips & badges */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 700;
  background: #f1f5f9; color: #475569; white-space: nowrap;
}
.chip--success { background: var(--green-soft); color: #15803d; }
.chip--warning { background: var(--amber-soft); color: #b45309; }
.chip--info { background: var(--info-soft); color: #0369a1; }
.chip--danger { background: var(--red-soft); color: #b91c1c; }
.chip--muted { background: #f1f5f9; color: #64748b; }
.chip--solid { background: var(--primary); color: #fff; }

.count-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Progress */
.progress { height: 7px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #2563eb, #60a5fa); border-radius: inherit; }
.progress.is-green > span { background: linear-gradient(90deg, #16a34a, #4ade80); }
.progress-row { display: flex; align-items: center; gap: 8px; }
.progress-row small { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Forms */
.form-grid { display: grid; gap: 12px; }
.field { display: block; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.field > span em { color: var(--red); font-style: normal; }
.input, .field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; font-size: 16px; color: var(--text);
  border: 1.5px solid #dbe3ee; border-radius: 11px; background: #fbfdff;
  font-family: inherit; outline: none; appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.field small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.input-qty { display: flex; align-items: center; gap: 6px; }
.input-qty input { text-align: center; }
.stepper {
  width: 36px; height: 40px; flex: none; border-radius: 10px; border: 1.5px solid #dbe3ee;
  background: #f8fafc; color: var(--primary); font-size: 18px; font-weight: 700; cursor: pointer;
}
.stepper:active { background: var(--primary-soft); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 16px; border-radius: 12px; border: 0; cursor: pointer;
  font-size: 14.5px; font-weight: 700; font-family: inherit;
  background: #f1f5f9; color: #334155; text-align: center;
}
.btn:active { transform: scale(.985); }
.btn--primary { background: linear-gradient(135deg, #1d4ed8, #2563eb); color: #fff; box-shadow: 0 8px 18px rgba(37, 99, 235, .28); }
.btn--success { background: linear-gradient(135deg, #15803d, #16a34a); color: #fff; box-shadow: 0 8px 18px rgba(22, 163, 74, .25); }
.btn--danger { background: #fee2e2; color: #b91c1c; }
.btn--ghost { background: transparent; color: var(--primary); border: 1.5px solid #c7d7fe; }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-row { display: flex; gap: 8px; }
.btn-row > .btn { flex: 1; }
.btn:disabled { opacity: .55; pointer-events: none; }

.actionbar {
  position: sticky; bottom: 84px; z-index: 10;
  display: flex; gap: 8px; padding: 10px 0 2px;
  background: linear-gradient(180deg, rgba(247,249,252,0), var(--page) 40%);
}
.actionbar .btn { flex: 1; }

/* Table */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th, .tbl td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { background: #f8fafc; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .wrap { white-space: normal; min-width: 130px; }
.tbl input { width: 76px; padding: 7px 8px; font-size: 14px; border: 1.5px solid #dbe3ee; border-radius: 8px; text-align: right; background: #fff; }
.tbl .muted { color: var(--muted); }

/* Tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; padding: 7px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line);
}
.tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Empty state */
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty .ico { color: #cbd5e1; margin-bottom: 8px; }
.empty b { display: block; color: #475569; font-size: 14px; margin-bottom: 3px; }
.empty small { font-size: 12px; }

/* Detail rows */
.kv { display: grid; grid-template-columns: 104px 1fr; gap: 7px 10px; font-size: 13px; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.note-box { background: #f8fafc; border: 1px dashed #dbe3ee; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: #475569; }

/* Sheet / modal */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0; background: var(--surface); color: var(--text);
  box-shadow: 0 -10px 40px rgba(15, 23, 42, .18);
}
dialog.sheet::backdrop { background: rgba(15, 23, 42, .45); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px; }
.sheet__head h3 { margin: 0; font-size: 16px; }
.sheet__body { padding: 10px 16px 20px; }
.sheet__btn { border: 0; background: #f1f5f9; width: 32px; height: 32px; border-radius: 50%; color: #475569; font-size: 16px; cursor: pointer; }

/* Toast */
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 100; width: 100%; max-width: 440px; padding: 0 14px; display: grid; gap: 8px; pointer-events: none; }
.toast {
  background: #0f172a; color: #fff; border-radius: 12px; padding: 11px 14px; font-size: 13px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .28); display: flex; gap: 8px; align-items: flex-start;
  animation: toastIn .25s ease;
}
.toast--success { background: #15803d; }
.toast--error { background: #b91c1c; }
.toast--info { background: #1d4ed8; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Utility */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mb0 { margin-bottom: 0; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.grow { flex: 1; }
.text-right { text-align: right; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.strong { font-weight: 700; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* Login */
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 26px 18px; background: radial-gradient(circle at 20% 10%, #dbeafe, transparent 45%), radial-gradient(circle at 90% 80%, #e0f2fe, transparent 40%), #f8fbff; }
.auth__brand { text-align: center; margin-bottom: 22px; }
.auth__logo {
  width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 22px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .35);
  padding: 10px;
}
.auth__brand h1 { margin: 0; font-size: 22px; font-weight: 800; }
.auth__brand p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.auth__card { background: var(--surface); border-radius: 22px; padding: 20px 18px; box-shadow: 0 24px 60px rgba(15, 23, 42, .12); }
.auth__hint { margin-top: 14px; text-align: center; font-size: 12px; color: var(--muted); }
.auth__accounts { margin-top: 14px; background: #f8fafc; border: 1px dashed #dbe3ee; border-radius: 12px; padding: 10px 12px; font-size: 11.5px; color: #475569; }
.auth__accounts b { color: var(--text); }
.auth__accounts div { display: flex; justify-content: space-between; padding: 2px 0; }

@media (max-width: 520px) {
  .phone { box-shadow: none; }
  body { background: var(--page); }
}

/* Identitas aplikasi & pengguna pada header */
.appbar__brand { font-weight: 800; letter-spacing: .3px; }
.appbar__sep { opacity: .55; margin: 0 2px; }
.appbar__user { opacity: .72; margin-left: 2px; }

/* Judul halaman di dalam konten */
.page-heading { margin: 2px 2px 12px; font-size: 20px; font-weight: 800; letter-spacing: .2px; }

/* Tombol power pada header */
.appbar__power { color: #fff; }
.appbar__power:active { background: rgba(255,255,255,.3); }

/* Sheet di tengah layar (menu akun) */
dialog.sheet--center {
  margin: auto;
  width: calc(100% - 32px);
  max-width: 360px;
  border-radius: 20px;
}
dialog.sheet--center .sheet__body { padding-bottom: 18px; }
