:root {
  --mankin-primary: #196bcd;
  --mankin-primary-dark: #0a489f;
  --mankin-sidebar: #12233d;
  --mankin-sidebar-hover: #1b3354;
  --mankin-accent: #be0000;
  --tblr-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tblr-primary: #196bcd;
  --tblr-primary-rgb: 25, 107, 205;
  --tblr-body-color: #141414;
  --tblr-border-color: #e2e6ea;
  --tblr-body-bg: #f6f8fb;
}

body {
  font-family: var(--tblr-font-sans-serif);
  background: var(--tblr-body-bg);
  color: var(--tblr-body-color);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 1000;
  padding: 12px 16px;
  background: #fff;
  color: var(--mankin-primary-dark);
  border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--mankin-primary);
  outline-offset: 2px;
}

/* Sidebar */
.navbar-vertical {
  background: var(--mankin-sidebar) !important;
  border-right: 0;
}
.navbar-vertical .navbar-brand {
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  color: var(--mankin-accent);
  font-weight: 800;
  font-size: 1.05rem;
  flex: 0 0 auto;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-text strong {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: #fff;
}
.brand-text small {
  font-size: 0.7rem;
  color: #9fb3cc;
  font-weight: 500;
}
.navbar-vertical .nav-link {
  color: #c3d3e6;
  border-radius: 8px;
  margin: 2px 8px;
  padding: 0.6rem 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.navbar-vertical .nav-link:hover {
  background: var(--mankin-sidebar-hover);
  color: #fff;
}
.navbar-vertical .nav-link[aria-current="page"] {
  background: var(--mankin-primary);
  color: #fff;
  box-shadow: inset 3px 0 0 #fff;
}
.navbar-vertical .nav-link .icon {
  opacity: 0.9;
}

.sidebar-foot {
  margin-top: auto;
  padding: 1rem 0.75rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.navbar-vertical .navbar-collapse {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 96px);
}
.who {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.who .avatar {
  background: #27436b;
  color: #fff;
  font-weight: 600;
  flex: 0 0 auto;
}
.who-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.who-name {
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who-role {
  color: #9fb3cc;
  font-size: 0.72rem;
}

/* Page */
.page-body {
  padding-bottom: 1rem;
}
.page-header {
  margin: 0 0 1rem;
}
.page-pretitle {
  color: #525252;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.1rem 0 0;
}

.breadcrumb {
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
}

/* Stats */
.stat-card {
  display: block;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--tblr-border-color);
  border-radius: 12px;
  background: #fff;
  padding: 1rem 1.1rem;
  height: 100%;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-card:hover {
  box-shadow: 0 6px 20px rgba(18, 35, 61, 0.08);
  transform: translateY(-1px);
  color: inherit;
  text-decoration: none;
}
.stat-card .stat-label {
  font-size: 0.78rem;
  color: #525252;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-card .stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 0.35rem;
}
.stat-card .stat-hint {
  font-size: 0.78rem;
  color: #737373;
  margin-top: 0.2rem;
}
.stat-card.is-accent {
  border-left: 4px solid var(--mankin-primary);
}
.stat-card.is-warn {
  border-left: 4px solid #d97706;
}
.stat-card.is-ok {
  border-left: 4px solid #288034;
}
.stat-card.is-danger {
  border-left: 4px solid #be0000;
}

/* Progress */
.progress {
  height: 8px;
  border-radius: 999px;
  background: #eef1f5;
}
.progress-bar {
  border-radius: 999px;
}

.unit-bar {
  margin-bottom: 0.9rem;
}
.unit-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 0.3rem;
}
.unit-bar-head strong {
  font-weight: 600;
}
.unit-bar-head span {
  color: #525252;
}

/* Timeline */
.timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 1.1rem;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 2px;
  background: #e2e6ea;
}
.timeline-item {
  position: relative;
  padding-bottom: 0.9rem;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 0.28rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mankin-primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e2e6ea;
}
.timeline-item.is-ok::before {
  background: #288034;
}
.timeline-item.is-warn::before {
  background: #d97706;
}
.timeline-item.is-danger::before {
  background: #be0000;
}
.timeline-title {
  font-size: 0.86rem;
  font-weight: 600;
}
.timeline-meta {
  font-size: 0.76rem;
  color: #737373;
}

/* Tables */
.table thead th {
  background: #f8fafc;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #525252;
  border-bottom: 1px solid var(--tblr-border-color);
}
.table tbody td {
  vertical-align: top;
}
.cell-title {
  font-weight: 600;
}
.cell-sub {
  font-size: 0.76rem;
  color: #737373;
}
.cell-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.76rem;
  color: #8a5a00;
  background: #fff8e6;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
}

.badge {
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
}

/* Forms */
.form-label {
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}
.form-control,
.form-select,
.btn {
  min-height: 44px;
}
.btn-sm {
  min-height: 36px;
}
.form-text {
  color: #737373;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--tblr-border-color);
  border-radius: 12px;
  background: #fff;
}
.empty .empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  color: #a3a3a3;
}
.empty .empty-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.empty .empty-text {
  color: #525252;
  font-size: 0.86rem;
  max-width: 32rem;
  margin: 0 auto 0.9rem;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #eef3fa 0%, #f6f8fb 60%, #ffffff 100%);
  padding: 2rem 1rem;
}
.login-card {
  width: 100%;
  max-width: 410px;
  background: #fff;
  border: 1px solid var(--tblr-border-color);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(18, 35, 61, 0.12);
  padding: 2rem;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
}
.login-brand .brand-mark {
  width: 44px;
  height: 44px;
  background: var(--mankin-primary);
  color: #fff;
  font-size: 1.25rem;
}
.login-brand strong {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}
.login-brand small {
  color: #525252;
  font-size: 0.74rem;
}

/* Toast */
.toast-manual {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  background: #12233d;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(18, 35, 61, 0.25);
  font-size: 0.86rem;
  max-width: min(92vw, 360px);
}
.toast-manual.is-error {
  background: #8c1d1d;
}

/* Calendar (vanilla-calendar-pro) */
.calendar-wrap {
  background: #fff;
  border: 1px solid var(--tblr-border-color);
  border-radius: 12px;
  padding: 0.75rem;
}
.calendar-wrap .vc {
  --vc-primary-color: #196bcd;
  --vc-primary-color-hover: #0a489f;
  --vc-font-family: var(--tblr-font-sans-serif);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.76rem;
  color: #525252;
}
.legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.3rem;
}

.agenda-day-list .list-group-item {
  border-left: 3px solid transparent;
}
.agenda-day-list .list-group-item.is-selected {
  border-left-color: var(--mankin-primary) ;
}

.chip {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .card-body {
    padding: 0.9rem;
  }
  .page-title {
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

.login-foot {
  font-size: 0.78rem;
}
.alert-danger,
.alert-warning {
  border-radius: 8px;
}

/* Agenda calendar */
.agenda-calendar {
  table-layout: fixed;
}
.agenda-calendar th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #525252;
  background: #f8fafc;
  text-align: center;
  padding: 0.5rem 0.25rem;
}
.agenda-calendar td {
  vertical-align: top;
  height: 96px;
  padding: 0.35rem;
  width: 14.2857%;
}
.agenda-calendar .cal-blank {
  background: #fbfcfd;
}
.agenda-calendar .cal-day.is-today {
  background: #eff5fd;
  box-shadow: inset 0 0 0 2px #196bcd;
}
.cal-date {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #525252;
  margin-bottom: 0.2rem;
}
.cal-day.is-today .cal-date {
  color: #0a489f;
}
.chip {
  display: block;
  margin-bottom: 2px;
  padding: 1px 5px;
  border-radius: 6px;
  font-size: 0.68rem;
  line-height: 1.35;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.chip:hover {
  text-decoration: underline;
  color: inherit;
}
.chip .chip-unit {
  font-weight: 700;
  margin-right: 3px;
}
.tone-approved {
  background: #edfded;
  color: #1a6b3c;
  border-left-color: #288034;
}
.tone-submitted {
  background: #fff9eb;
  color: #855f00;
  border-left-color: #d97706;
}
.tone-returned {
  background: #fdeded;
  color: #8c1d1d;
  border-left-color: #be0000;
}
.tone-draft {
  background: #f2f2f2;
  color: #404040;
  border-left-color: #a3a3a3;
}
.tone-cancelled {
  background: #eef1f5;
  color: #737373;
  border-left-color: #d4d4d4;
  text-decoration: line-through;
}
.tone-more {
  background: transparent;
  color: #0a489f;
  font-weight: 600;
}
.legend .dot[data-tone="approved"] {
  background: #288034;
}
.legend .dot[data-tone="submitted"] {
  background: #d97706;
}
.legend .dot[data-tone="returned"] {
  background: #be0000;
}
.legend .dot[data-tone="draft"] {
  background: #a3a3a3;
}

/* Dialog */
.dlg {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(94vw, 680px);
  max-height: 90vh;
  background: #fff;
  color: var(--tblr-body-color, #141414);
  box-shadow: 0 24px 60px rgba(18, 35, 61, 0.28);
  overflow: hidden;
}
.dlg::backdrop {
  background: rgba(18, 35, 61, 0.45);
}
.dlg-head {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--tblr-border-color);
}
.dlg-body {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 66vh;
}
.dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--tblr-border-color);
  background: #f8fafc;
  border-radius: 0 0 14px 14px;
}

.pre-wrap {
  white-space: pre-wrap;
}
.detail-list dt {
  color: #525252;
  font-weight: 600;
  font-size: 0.84rem;
}
.detail-list dd {
  margin-bottom: 0.6rem;
}

/* Data attribute bridge untuk nilai dinamis (CSP tanpa inline style) */
[data-tone="approved"].dot, .badge[data-tone="approved"] { background-color: #288034; color: #fff; }
[data-tone="submitted"].dot, .badge[data-tone="submitted"] { background-color: #d97706; color: #fff; }
[data-tone="returned"].dot, .badge[data-tone="returned"] { background-color: #be0000; color: #fff; }
[data-tone="draft"].dot, .badge[data-tone="draft"] { background-color: #6b7280; color: #fff; }
[data-tone="cancelled"].dot, .badge[data-tone="cancelled"] { background-color: #9ca3af; color: #fff; }

.agenda-calendar .cal-date {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #525252;
  margin-bottom: 0.2rem;
  text-decoration: none;
}
.agenda-calendar .cal-date:hover {
  color: #0a4895;
  text-decoration: underline;
}

/* Navigasi ponsel: sidebar tersembunyi sampai tombol menu ditekan */


/* Topbar ponsel */
@media (max-width: 991.98px) {
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid var(--tblr-border-color);
  }
  .mobile-menu-btn {
    border: 1px solid var(--tblr-border-color);
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
  }
  .navbar-vertical {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    z-index: 1040;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(18, 35, 61, 0.35);
  }
  .navbar-vertical:not(.is-open) {
    display: none;
  }
}

/* Profil */
.who-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  padding: 0.35rem;
  margin: -0.35rem;
  transition: background-color 120ms ease;
}
.who-link:hover,
.who-link:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}
.who-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.profile-avatar {
  background: var(--tblr-primary, #196bcd);
  color: #fff;
  font-weight: 600;
}
.profile-fact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--tblr-border-color, #e5e5e5);
}
.profile-fact:last-child {
  border-bottom: 0;
}
.profile-fact-label {
  color: var(--tblr-secondary, #525252);
  font-size: 0.875rem;
}
.profile-section {
  border: 1px solid var(--tblr-border-color, #e5e5e5);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 0.5rem;
}
.profile-section-title {
  float: none;
  width: auto;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tblr-body-color, #141414);
}
@media (prefers-reduced-motion: reduce) {
  .who-link {
    transition: none;
  }
}
