/* Pasteurtrans Work Progress Tracker - gaya dasar */
:root {
    --blue-900: #1255A5;
    --blue-500: #287DE0;
    --blue-100: #EAF3FF;
    --white: #FFFFFF;
    --ink: #17233A;
    --muted: #64748B;
    --line: #E2E8F0;
    --bg: #F5F8FC;
    --green: #16A34A;
    --amber: #D97706;
    --red: #DC2626;
    --radius: 12px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, 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); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 15px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }
a { color: var(--blue-500); }
.icon { flex: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
:focus-visible { outline: 3px solid rgba(40,125,224,.45); outline-offset: 2px; }

/* Tombol */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .65rem 1.15rem; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--blue-500); color: #fff; }
.btn-primary:hover { background: var(--blue-900); }
.btn-ghost { background: #fff; color: var(--blue-900); border-color: var(--line); }
.btn-ghost:hover { background: var(--blue-100); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

/* Form */
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.field small { display: block; color: var(--muted); margin-top: .25rem; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], input[type=file], select, textarea {
    width: 100%; padding: .65rem .8rem; border: 1px solid #CBD5E1; border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--blue-500); outline: 3px solid rgba(40,125,224,.2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

/* Alert & badge */
.alert { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .92rem; border: 1px solid transparent; }
.alert-danger { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.alert-success { background: #F0FDF4; color: #166534; border-color: #BBF7D0; }
.alert-warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.alert-info { background: var(--blue-100); color: var(--blue-900); border-color: #BFDBFE; }
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-blue { background: var(--blue-100); color: var(--blue-900); }
.badge-green { background: #DCFCE7; color: #166534; }
.badge-amber { background: #FEF3C7; color: #92400E; }
.badge-red { background: #FEE2E2; color: #991B1B; }

/* Brand */
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; font-size: 1.1rem; color: var(--blue-900); }
.brand img { border-radius: 10px; }
.brand-light { color: #fff; }

/* Layout split: login & installer */
.split { display: grid; grid-template-columns: minmax(300px, 40%) 1fr; min-height: 100vh; }
.split-side { background: var(--blue-900); color: #fff; padding: 2.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.split-copy h1 { font-size: 2rem; max-width: 18ch; }
.split-copy p { color: #CFE1FA; max-width: 38ch; }
.split-foot { color: #9EC2F0; font-size: .85rem; margin: 0; }
.split-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 420px; background: #fff; padding: 2rem; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(18,85,165,.08); }
.auth-card h2 { font-size: 1.4rem; }

/* Installer */
.install-card { width: 100%; max-width: 620px; background: #fff; padding: 2rem; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(18,85,165,.08); }
.install-card h2 { font-size: 1.4rem; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: .75rem; padding: .45rem 0; color: #9EC2F0; font-size: .92rem; }
.steps li::before { content: counter(s); width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; border: 1px solid #5B8FD0; }
.steps li.is-done { color: #fff; }
.steps li.is-done::before { content: "\2713"; background: var(--blue-500); border-color: var(--blue-500); }
.steps li.is-current { color: #fff; font-weight: 700; }
.steps li.is-current::before { background: #fff; color: var(--blue-900); border-color: #fff; }
.check-table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; font-size: .92rem; }
.check-table th, .check-table td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.check-table small { display: block; color: var(--muted); }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* App shell */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; }
.menu { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.menu-link { display: flex; align-items: center; gap: .75rem; padding: .65rem .85rem; border-radius: 10px; color: #475569; text-decoration: none; font-weight: 500; }
.menu-link:hover { background: var(--bg); }
.menu-link.is-active { background: var(--blue-100); color: var(--blue-900); font-weight: 600; }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 1rem; }
.me-chip { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text strong, .me-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-500); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.app-main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.5rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-title { font-size: 1.1rem; margin: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.icon-btn { background: transparent; border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.only-mobile { display: none; }
.profile-btn { display: flex; align-items: center; gap: .6rem; background: transparent; border: 0; cursor: pointer; font: inherit; color: var(--ink); padding: .25rem .4rem; border-radius: 10px; }
.profile-btn:hover { background: var(--bg); }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + .4rem); min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 28px rgba(15,23,42,.12); padding: .5rem; }
.dropdown-menu[hidden] { display: none; }
.dropdown-head { padding: .5rem .6rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .4rem; display: flex; flex-direction: column; }
.dropdown-head small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.dropdown-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .6rem; background: transparent; border: 0; border-radius: 8px; font: inherit; cursor: pointer; color: var(--ink); text-align: left; }
.dropdown-item:hover { background: var(--bg); }
.content { padding: 1.5rem; flex: 1; }
.app-footer { display: flex; justify-content: space-between; padding: 1rem 1.5rem; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); background: #fff; }
.page-head { margin-bottom: 1.25rem; }
.page-head h2 { font-size: 1.4rem; margin-bottom: .15rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: .2rem; }
.stat-label { color: var(--muted); font-size: .88rem; }
.stat-value { font-size: 1.9rem; color: var(--blue-900); line-height: 1.2; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.card h3 { font-size: 1.05rem; margin-bottom: .9rem; }
.sidebar-backdrop { display: none; }

/* Halaman galat */
.error-body { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.error-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 2.5rem 2rem; max-width: 460px; text-align: center; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--blue-500); margin: 0; }

/* Responsive */
@media (max-width: 900px) {
    .split { grid-template-columns: 1fr; }
    .split-side { padding: 1.5rem; gap: 1rem; }
    .split-copy h1 { font-size: 1.5rem; }
    .steps { display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
    .steps li { padding: .2rem 0; font-size: .82rem; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 40; }
    .sidebar-open .sidebar { transform: none; }
    .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 30; }
    .only-mobile { display: grid; }
    .profile-name { display: none; }
    .content { padding: 1rem; }
    .topbar { padding: .75rem 1rem; }
    .grid-2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Tahap 2: dashboard ---- */
.badge-gray { background: #F1F5F9; color: #475569; }
.badge-orange { background: #FFEDD5; color: #9A3412; }
.badge-dark { background: #E2E8F0; color: #1E293B; }
.stat.is-alert { border-color: #FECACA; background: #FEF2F2; }
.stat.is-alert .stat-value { color: var(--red); }
.grid-charts { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; margin-bottom: 1rem; }
.grid-charts .card { margin-bottom: 0; }
.chart-box { position: relative; height: 260px; }
.grid-lists { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; margin-bottom: 1rem; }
.grid-lists .card { margin-bottom: 0; min-width: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); padding: .5rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .65rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.cell-title { font-weight: 600; max-width: 260px; }
.progress { width: 110px; height: 7px; background: var(--blue-100); border-radius: 999px; overflow: hidden; margin-bottom: .2rem; }
.progress > span { display: block; height: 100%; background: var(--blue-500); border-radius: 999px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.list li > div { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.list small { color: var(--muted); }
.due { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.due.is-late { color: var(--red); font-weight: 600; }
.empty { color: var(--muted); margin: 0; padding: .5rem 0; }
.chart-fallback { margin-bottom: 1rem; }
.card + .card, .grid-lists + .card { margin-top: 0; }
@media (max-width: 900px) {
    .grid-charts, .grid-lists { grid-template-columns: 1fr; }
    .chart-box { height: 230px; }
}

/* ---- Tahap 3-7: tugas, form, laporan, notifikasi ---- */
.btn-sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-danger { background: #fff; color: var(--red); border-color: #FECACA; }
.btn-danger:hover { background: #FEF2F2; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.grow { flex: 1 1 220px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.inline { display: inline-block; }
.pad { padding: .75rem 1rem; }
.top { align-items: start; }
.stack > * + * { margin-top: .75rem; }
.actions.no-top { margin-top: 0; align-items: flex-start; }
.back-link { font-size: .88rem; text-decoration: none; display: inline-block; margin-bottom: .35rem; }
.prewrap { white-space: pre-wrap; word-break: break-word; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.1rem 0; }
.cell-wrap { max-width: 220px; }
.form-card { max-width: 860px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
fieldset.field legend { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; padding: 0; }
textarea { resize: vertical; }
input[type=range] { width: 100%; accent-color: var(--blue-500); padding: 0; }
input[type=date] { min-height: 42px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.check:hover { background: var(--bg); }
.check input { margin-top: .25rem; accent-color: var(--blue-500); }
.check small { display: block; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: flex-end; }
.filters .field { margin-bottom: .6rem; min-width: 150px; }
.filters .field.grow { min-width: 200px; }
.filter-actions { display: flex; gap: .5rem; margin-bottom: .6rem; }
.pagination { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: 1rem; }
.pg { padding: .35rem .75rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); background: #fff; font-size: .88rem; }
.pg.is-on { background: var(--blue-500); color: #fff; border-color: var(--blue-500); }
.pg.is-off { color: #CBD5E1; }
.pg-info { margin-left: auto; color: var(--muted); font-size: .85rem; }
.sort { color: inherit; text-decoration: none; }
.sort:hover { color: var(--blue-500); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1rem; align-items: start; }
.detail-main .card, .detail-side .card { margin-bottom: 1rem; }
.progress.wide { width: 100%; max-width: 260px; display: inline-block; vertical-align: middle; margin-right: .5rem; }
.review-card { border-color: #FDE68A; background: #FFFBEB; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--blue-100); }
.timeline li { position: relative; padding: 0 0 1rem .9rem; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: -1.38rem; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--blue-500); }
.timeline small { display: block; color: var(--muted); }
.note { margin: .25rem 0 0; padding: .4rem .6rem; background: var(--bg); border-radius: 8px; }
.comments { list-style: none; margin: 0 0 1rem; padding: 0; }
.comments li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.comment-head { display: flex; justify-content: space-between; gap: 1rem; }
.comment-head small { color: var(--muted); }
.comments p { margin: .25rem 0 0; }
.upload-form { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.upload-form input[type=file] { flex: 1 1 220px; }
.inline-pop { display: inline-block; position: relative; }
.inline-pop > summary { list-style: none; cursor: pointer; }
.inline-pop > summary::-webkit-details-marker { display: none; }
.inline-pop[open] > form { position: absolute; right: 0; z-index: 15; width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; box-shadow: 0 12px 28px rgba(15,23,42,.14); text-align: left; }
.person { display: flex; align-items: center; gap: .65rem; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar { overflow: hidden; }
.avatar.sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar.xl { width: 80px; height: 80px; font-size: 1.6rem; margin: 0 auto .75rem; }
.profile-card { text-align: center; }
.profile-card .kv { text-align: left; margin: 1rem 0; }
.profile-head { display: flex; gap: 1rem; align-items: center; }
.profile-head .avatar.xl { margin: 0; flex: none; }
.me-link { text-decoration: none; color: inherit; }
.btn.btn-ghost.btn-sm svg { margin-right: .15rem; }
.bell { position: relative; }
.bell-count { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.dropdown-wide { width: 340px; max-width: calc(100vw - 2rem); padding: 0; overflow: hidden; }
.dropdown-wide .dropdown-head { padding: .75rem 1rem; margin: 0; }
.dropdown-wide .dropdown-item { justify-content: center; border-top: 1px solid var(--line); border-radius: 0; color: var(--blue-500); font-weight: 600; text-decoration: none; }
.dropdown-wide > form { border-bottom: 1px solid var(--line); }
.notif-item { display: flex; flex-direction: column; gap: .15rem; width: 100%; text-align: left; background: #fff; border: 0; padding: .7rem 1rem; font: inherit; cursor: pointer; color: var(--ink); }
.notif-item:hover { background: var(--bg); }
.notif-item.is-unread { background: var(--blue-100); }
.notif-item span { color: #475569; font-size: .88rem; }
.notif-item small { color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--blue-500); font: inherit; font-size: .85rem; cursor: pointer; padding: 0; }
.dropdown-item { text-decoration: none; }
.btn-ghost svg { flex: none; }
.perm-table th, .perm-table td { white-space: nowrap; }
.perm-table td:first-child { white-space: normal; min-width: 220px; }
.group-row td { background: var(--blue-100); color: var(--blue-900); font-weight: 700; }
.grid-charts.equal, .grid-lists.equal { grid-template-columns: 1fr 1fr; }
.table.narrow { min-width: 0; }
.list .grow { flex: 1; }
.list form.grow { margin: 0; }
@media (max-width: 900px) {
    .detail-grid, .grid-charts.equal, .grid-lists.equal { grid-template-columns: 1fr; }
    .filters .field { min-width: 100%; }
    .profile-head { flex-direction: column; align-items: flex-start; }
    .inline-pop[open] > form { position: static; width: 100%; margin-top: .5rem; }
}
@media print { .sidebar, .topbar, .app-footer, .filters, .actions { display: none !important; } .app-shell { display: block; } }
