/* Dashboard admin control plane. Nilai dari tokens.json design system Mantiq (ADR-002 butir 1). */
@import url("https://fonts.googleapis.com/css2?family=Michroma&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --mantiq-blue: #1428a0;
  --mantiq-deep: #0d1c70;
  --near-black: #111827;
  --steel-blue: #3d4f7c;
  --cloud-grey: #f4f6fc;
  --grey-200: #e7ebf5;
  --grey-300: #d4daec;
  --grey-400: #b4bedd;
  --grey-600: #64719c;
  --grey-800: #24304f;
  --brand-soft: #eaeefa;
  --success: #1f9d6b;
  --warning: #c7871b;
  --danger: #c4442e;
  --font-display: "Michroma", "Trebuchet MS", Arial, sans-serif;
  --font-body: "Inter", Calibri, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow-sm: 0 2px 6px rgba(20, 40, 160, 0.06);
  --shadow-brand: 0 12px 32px rgba(20, 40, 160, 0.28);
  --ring-focus: 0 0 0 3px rgba(20, 40, 160, 0.35);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--cloud-grey);
  font-family: var(--font-body);
  color: var(--grey-800);
  font-size: 14px;
  line-height: 1.6;
}
a {
  color: var(--mantiq-blue);
}
a:hover {
  color: var(--mantiq-deep);
}
:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
  border-radius: 4px;
}
h1,
h2,
h3 {
  margin: 0;
  color: var(--near-black);
}
p {
  margin: 0;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
}
.nav {
  flex: 1 1 240px;
  max-width: 280px;
  min-width: 220px;
  background: #fff;
  border-right: 1px solid var(--grey-200);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.nav-brand {
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-brand img {
  height: 64px;
  width: auto;
  align-self: flex-start;
}
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--steel-blue);
  text-decoration: none;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--mantiq-blue);
  background: var(--brand-soft);
}
.nav-links a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--mantiq-blue);
  font-weight: 600;
}
.nav-links span.soon {
  color: var(--grey-600);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
}
.nav-user {
  margin-top: auto;
  padding: 12px;
  border-radius: 12px;
  background: var(--cloud-grey);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-user strong {
  color: var(--near-black);
}
.nav-user small {
  color: var(--grey-600);
  font-size: 13px;
}
.main {
  flex: 999 1 560px;
  min-width: 0;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1440px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mantiq-blue);
}
.title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--mantiq-blue);
}
.title.sm {
  font-size: 26px;
}
.accent {
  width: 48px;
  height: 3px;
  background: var(--mantiq-blue);
  border-radius: 2px;
}
.muted {
  color: var(--grey-600);
  font-size: 13px;
}
.secondary {
  color: var(--steel-blue);
}
.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.page-head > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.card {
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.card h2 {
  font-size: 18px;
  font-weight: 600;
}
.card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.grid-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.kpi {
  padding: 20px;
  gap: 8px;
}
.kpi .value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--near-black);
}
.split {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: stretch;
}
.split > .wide {
  flex: 2 1 480px;
}
.split > .narrow {
  flex: 1 1 320px;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
  border-bottom: 1px solid var(--grey-300);
}
.chart .col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  height: 100%;
}
.chart .bar {
  width: 100%;
  max-width: 40px;
  border-radius: 6px 6px 0 0;
  background: var(--grey-400);
}
.chart .bar.today {
  background: var(--mantiq-blue);
}
.chart .num {
  font-size: 11px;
  color: var(--steel-blue);
}
.chart-days {
  display: flex;
  gap: 8px;
}
.chart-days span {
  flex: 1 1 0;
  text-align: center;
  font-size: 11px;
  color: var(--grey-600);
}
.empty {
  padding: 24px;
  text-align: center;
  color: var(--grey-600);
}

.action {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--grey-200);
  border-radius: 12px;
  text-decoration: none;
  color: var(--grey-800);
}
.action:hover {
  border-color: var(--grey-400);
  color: var(--grey-800);
}
.action .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.action strong {
  color: var(--near-black);
}

.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  color: var(--grey-600);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid var(--grey-200);
  white-space: nowrap;
}
td {
  padding: 12px;
  border-bottom: 1px solid var(--grey-200);
  vertical-align: top;
}
td.nowrap {
  white-space: nowrap;
}
.cell-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}
.cell-link {
  min-width: 180px;
}
.cell-link .mono {
  white-space: nowrap;
}
.cell-link strong {
  color: var(--mantiq-blue);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--brand-soft);
  color: var(--mantiq-blue);
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}
.badge.success {
  background: #e3f4ec;
  color: #146b49;
}
.badge.warning {
  background: #fbf0dc;
  color: #7d5410;
}
.badge.danger {
  background: #f8e3df;
  color: #9a3322;
}
.badge.neutral {
  background: var(--cloud-grey);
  color: var(--steel-blue);
}

.meter {
  width: 60px;
  height: 6px;
  border-radius: 999px;
  background: var(--grey-200);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.meter > span {
  display: block;
  height: 100%;
  background: var(--mantiq-blue);
}
.meter.full > span {
  background: var(--danger);
}
.cells {
  display: flex;
  gap: 6px;
}
.cell {
  flex: 1 1 0;
  height: 10px;
  border-radius: 999px;
  background: var(--grey-200);
}
.cell.on {
  background: var(--mantiq-blue);
}
.cells.full .cell.on {
  background: var(--danger);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 12px;
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn.primary {
  background: var(--mantiq-blue);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn.primary:hover {
  background: var(--mantiq-deep);
  color: #fff;
}
.btn.secondary {
  background: #fff;
  color: var(--mantiq-blue);
  border-color: var(--mantiq-blue);
}
.btn.secondary:hover {
  background: var(--brand-soft);
}
.btn.ghost {
  background: transparent;
  color: var(--steel-blue);
}
.btn.ghost:hover {
  background: var(--brand-soft);
  color: var(--mantiq-blue);
}
.btn.sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.form {
  display: flex;
  /* Eksplisit: `.card form` memakai kedua kelas, dan `.card` menyusun ke bawah. */
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
/* Lebar kolom hanya di baris form yang menyamping; di form bertumpuk (login) kolom setinggi isinya. */
.form > .field {
  flex: 1 1 180px;
}
.form > .field.wide {
  flex: 2 1 320px;
}
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--near-black);
}
.field input,
.field select,
.field textarea {
  font: inherit;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--grey-300);
  border-radius: 12px;
  background: #fff;
  color: var(--near-black);
}
.field textarea {
  min-height: 88px;
  resize: vertical;
}
.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--grey-400);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--mantiq-blue);
  box-shadow: var(--ring-focus);
}
.hint {
  font-size: 13px;
  color: var(--grey-600);
}

.notice {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
}
.notice.error {
  background: #f8e3df;
  color: #7a281b;
}
.notice.ok {
  background: #e3f4ec;
  color: #0f5238;
}
.notice.warn {
  background: #fbf0dc;
  color: #6b480d;
}
.banner {
  background: #fbf0dc;
  color: #6b480d;
  padding: 10px 32px;
  font-weight: 600;
  width: 100%;
}
.panel {
  border-radius: 16px;
  background: var(--cloud-grey);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-card img {
  height: 64px;
  width: auto;
  align-self: flex-start;
}
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--grey-600);
  font-size: 13px;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: var(--grey-200);
}
details summary {
  cursor: pointer;
  color: var(--mantiq-blue);
  font-weight: 500;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

@media (max-width: 720px) {
  .main {
    padding: 20px 16px;
  }
  /* Menu ringkas di HP: logo dan tautan menyamping, tautan "segera" disembunyikan, isi langsung terlihat. */
  .nav {
    max-width: none;
    flex-basis: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--grey-200);
    padding: 12px 16px;
    gap: 12px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .nav-brand {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 0;
  }
  .nav-brand img {
    height: 40px;
  }
  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    flex-basis: 100%;
  }
  .nav-links span.soon {
    display: none;
  }
  .nav-user {
    margin-top: 0;
    margin-left: auto;
    flex-direction: row;
    align-items: center;
    padding: 4px 8px;
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
  }
  .nav-user strong,
  .nav-user small {
    display: none;
  }
  .shell {
    position: relative;
  }
  .banner {
    padding: 10px 16px;
  }
  /* Grafik 14 hari di layar sempit: label tanggal selang-seling supaya tidak meluber. */
  .chart {
    gap: 4px;
  }
  .chart-days {
    gap: 4px;
  }
  .chart-days span {
    font-size: 10px;
  }
  .chart-days span:nth-child(even) {
    visibility: hidden;
  }
}
