/* TASKINDO - Clean Blue & White design system */
:root {
  --primary: #2563EB; --dark: #1D4ED8; --light: #EFF6FF; --soft: #DBEAFE;
  --white: #FFFFFF; --bg: #F8FAFC; --text: #172554; --muted: #64748B; --border: #E2E8F0;
  --ok: #16A34A; --warn: #F59E0B; --danger: #DC2626;
  --r: 16px; --r-sm: 12px;
  --shadow: 0 1px 2px rgba(23,37,84,.04), 0 6px 20px rgba(23,37,84,.06);
  --shadow-lg: 0 20px 50px rgba(23,37,84,.18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
h2 { font-size: 17px; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.ic { flex: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-sm); font-weight: 600; cursor: pointer; transition: background .15s, transform .08s, box-shadow .15s, border-color .15s; text-align: center; position: relative; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.25); }
.btn-primary:hover:not(:disabled) { background: var(--dark); }
.btn-soft { background: var(--light); color: var(--primary); }
.btn-soft:hover:not(:disabled) { background: var(--soft); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover:not(:disabled) { background: var(--light); }
.btn-ghost-light { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost-light:hover:not(:disabled) { background: rgba(255,255,255,.26); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.is-busy { color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-soft.is-busy::after, .btn-outline.is-busy::after, .btn-light.is-busy::after { border-color: var(--soft); border-top-color: var(--primary); }
.icon-btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 10px; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--light); color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 13px; font-weight: 600; }
.field .opt { color: var(--muted); font-weight: 500; }
.input, .select, .textarea { width: 100%; min-height: 46px; padding: 0 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-sm); outline: none; transition: border-color .15s, box-shadow .15s; }
.textarea { padding: 12px 14px; min-height: 92px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.input.invalid { border-color: var(--danger); }
.hint { font-size: 12.5px; color: var(--muted); }
.err { font-size: 12.5px; color: var(--danger); min-height: 0; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-wrap .icon-btn { position: absolute; right: 4px; top: 4px; }

/* Cards, badges */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: #DCFCE7; color: #15803D; }
.badge-warn { background: #FEF3C7; color: #B45309; }
.badge-danger { background: #FEE2E2; color: #B91C1C; }
.badge-info { background: var(--soft); color: var(--dark); }

/* Modal (selalu di tengah layar) */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(23,37,84,.45); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .2s; backdrop-filter: blur(2px); }
.modal-backdrop.show { opacity: 1; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); transform: translateY(10px) scale(.97); transition: transform .22s cubic-bezier(.2,.8,.3,1); }
.modal-backdrop.show .modal { transform: none; }
.modal-sm { max-width: 380px; }
.modal-lg { max-width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 16px 4px 20px; }
.modal-head h3 { font-size: 18px; font-weight: 700; }
.modal-body { padding: 12px 20px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* Toast */
#toast-root { position: fixed; top: 12px; left: 0; right: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 420px; width: 100%; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-lg); font-size: 14px; opacity: 0; transform: translateY(-8px); transition: .25s; }
.toast.show { opacity: 1; transform: none; }
.toast.success { border-left-color: var(--ok); } .toast.success .ic { color: var(--ok); }
.toast.error { border-left-color: var(--danger); } .toast.error .ic { color: var(--danger); }
.toast.info .ic { color: var(--primary); }

/* Skeleton, states */
.skeleton { height: 72px; border-radius: var(--r); margin-bottom: 10px; background: linear-gradient(90deg, #EEF2F7 25%, #F8FAFC 37%, #EEF2F7 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.skeleton.sk-lg { height: 140px; } .skeleton.sk-sm { height: 48px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.state { text-align: center; padding: 32px 16px; color: var(--muted); }
.state-ic { width: 56px; height: 56px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--light); color: var(--primary); }
.state-error .state-ic { background: #FEE2E2; color: var(--danger); }
.state h4 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.state p { font-size: 13.5px; margin-bottom: 12px; }

/* Boot / loading */
.boot { position: fixed; inset: 0; z-index: 300; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; transition: opacity .3s; }
.boot.hide { opacity: 0; pointer-events: none; }
.boot img { width: 132px; height: 132px; object-fit: contain; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }

/* Shell */
.topbar { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--border); }
.topbar-in { max-width: 720px; margin: 0 auto; padding: 6px 16px; display: flex; align-items: center; justify-content: space-between; }
.brand img { height: 52px; width: 52px; object-fit: contain; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.cur-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; background: var(--light); border-radius: 999px; font-size: 12.5px; color: var(--dark); }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); overflow: hidden; }
.view { max-width: 720px; margin: 0 auto; padding: 16px 16px 104px; min-height: calc(100vh - 120px); }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav-in { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; color: var(--muted); font-size: 11.5px; font-weight: 600; transition: color .15s; position: relative; }
.nav-item.active { color: var(--primary); }
.nav-item.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--primary); }
.section { margin-top: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head a { font-size: 13px; font-weight: 600; }
.page-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.page-sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.tabs { display: flex; gap: 6px; padding: 4px; background: var(--light); border-radius: 12px; }
.tab { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; min-height: 34px; padding: 0 14px; border: 1px solid var(--border); background: #fff; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
@media (min-width: 900px) { .view { padding-top: 24px; } }
