:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafd;
  --ink: #061a44;
  --ink-2: #18335f;
  --muted: #64748b;
  --line: #d7e0ec;
  --line-strong: #b8c5d6;
  --navy: #00245b;
  --navy-2: #053472;
  --navy-3: #0b4b96;
  --green: #269456;
  --green-bg: #e9f7ef;
  --amber: #f4b400;
  --amber-bg: #fff7df;
  --orange: #f97316;
  --orange-bg: #fff1e7;
  --red: #dc2626;
  --red-bg: #fff0f0;
  --shadow: 0 14px 34px rgba(10, 35, 74, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(215, 224, 236, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(215, 224, 236, 0.2) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
  color: var(--ink);
  font-family: Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(38, 148, 86, 0.22);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
}

.login-brand {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 45%),
    var(--navy);
  color: #ffffff;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.jata {
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 10px 22px rgba(0, 18, 56, 0.16);
}

.app-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
}

.app-subtitle {
  margin-top: 5px;
  color: #d8e6fa;
  font-size: 13px;
  font-weight: 500;
}

.login-brand h1 {
  max-width: 780px;
  font-size: 48px;
  line-height: 1.05;
  margin: 72px 0 18px;
  text-wrap: balance;
}

.login-brand p {
  max-width: 700px;
  color: #d8e6fa;
  line-height: 1.7;
}

.login-card-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0;
  font-size: 28px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.6;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  transition: grid-template-columns 0.22s ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 84px minmax(0, 1fr);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(20, 86, 174, 0.24), transparent 34%),
    var(--navy);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
  transition: padding 0.22s ease;
}

.sidebar-header {
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.unit-card {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.unit-card strong,
.unit-card span {
  display: block;
}

.unit-card strong {
  font-size: 14px;
}

.unit-card span {
  margin-top: 3px;
  color: #d8e6fa;
  font-size: 12px;
}

.unit-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: rgba(50, 120, 218, 0.45);
  border-radius: 8px;
  font-size: 21px;
}

.nav {
  padding: 18px 10px;
  display: grid;
  gap: 6px;
}

.nav button {
  width: 100%;
  min-height: 47px;
  border: 0;
  border-radius: 8px;
  padding: 0 13px;
  background: transparent;
  color: #edf5ff;
  text-align: left;
  cursor: pointer;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav button.active,
.nav button:hover {
  background: #1d55ac;
  color: #ffffff;
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.78);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: currentColor;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px;
  display: grid;
  gap: 14px;
  color: #d8e6fa;
}

.sidebar-mini {
  border: 0;
  background: transparent;
  color: #d8e6fa;
  cursor: pointer;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-self: start;
  padding: 6px 4px;
}

.app-shell.sidebar-collapsed .sidebar-header {
  padding: 16px 12px;
}

.app-shell.sidebar-collapsed .sidebar .brand-row {
  justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar .brand-row > div,
.app-shell.sidebar-collapsed .unit-card > div,
.app-shell.sidebar-collapsed .nav button span:not(.nav-icon),
.app-shell.sidebar-collapsed .sidebar-mini span:last-child,
.app-shell.sidebar-collapsed .sidebar-user-card > div {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar .jata {
  width: 48px;
  height: 48px;
}

.app-shell.sidebar-collapsed .unit-card {
  justify-content: center;
  padding: 10px;
  margin-top: 18px;
}

.app-shell.sidebar-collapsed .unit-icon {
  width: 42px;
  height: 42px;
}

.app-shell.sidebar-collapsed .nav {
  padding: 18px 12px;
}

.app-shell.sidebar-collapsed .nav button {
  justify-content: center;
  padding: 0;
}

.app-shell.sidebar-collapsed .nav button.active,
.app-shell.sidebar-collapsed .nav button:hover {
  box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.78);
}

.app-shell.sidebar-collapsed .sidebar-footer {
  padding: 14px 12px;
}

.app-shell.sidebar-collapsed .sidebar-mini,
.app-shell.sidebar-collapsed .sidebar-user-card {
  justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-mini {
  width: 44px;
  height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0;
}

.app-shell.sidebar-collapsed .sidebar-user-card {
  padding: 10px;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

#sidebarUser {
  font-weight: 750;
  color: #ffffff;
}

#sidebarRole {
  color: #d8e6fa;
  font-size: 12px;
}

.avatar-mini {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--navy);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  text-align: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 78px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 26px;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(14px);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.topbar .meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.topbar-menu {
  font-size: 22px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.header-credit-chip,
.user-chip {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
}

.header-credit-chip {
  min-width: 142px;
  border-color: #c7f0d7;
  background: #f0fdf4;
  color: var(--ink);
}

.header-credit-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--green);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px #bbf7d0;
}

.header-credit-chip span,
.header-credit-chip strong {
  display: block;
}

.header-credit-chip span:not(.header-credit-icon) {
  color: #47745a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.header-credit-chip strong {
  margin-top: 2px;
  color: var(--green);
  font-size: 15px;
  line-height: 1;
}

.user-chip {
  padding: 4px 10px 4px 4px;
}

.user-chip strong,
.user-chip span {
  display: block;
}

.user-chip strong {
  font-size: 13px;
  line-height: 1.2;
}

.user-chip span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-weight: 800;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover,
.header-credit-chip:hover,
.btn.secondary:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 18px rgba(10, 35, 74, 0.08);
}

.content {
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
  padding: 22px 24px 28px;
  display: grid;
  gap: 18px;
}

.app-footer {
  width: 100%;
  max-width: 1640px;
  margin: auto auto 0;
  padding: 20px 24px 24px;
  border-top: 1px solid var(--line);
  color: #73839a;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.panel,
.metric,
.summary-card,
.dashboard-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(10, 35, 74, 0.03);
}

.panel {
  padding: 20px;
}

.panel h2,
.dashboard-card h2 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}

.panel-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.summary-card {
  min-height: 120px;
  padding: 18px 20px;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.summary-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #edf3fb;
  color: var(--navy-2);
  font-weight: 850;
}

.summary-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.summary-value strong {
  font-size: 32px;
  line-height: 1;
  color: var(--ink);
}

.summary-value .green {
  color: var(--green);
}

.summary-value span {
  color: var(--muted);
  font-size: 14px;
}

.progress {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: #dce4ee;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
  transition: width 0.25s ease;
}

.progress-meta {
  margin-top: 7px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.dashboard-workbench {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 1fr) minmax(290px, 0.96fr);
  gap: 18px;
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.65fr);
  gap: 18px;
}

.dashboard-card {
  padding: 18px;
  min-width: 0;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.info-dot {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-card .upload-zone {
  min-height: 178px;
}

.upload-zone {
  border: 1.5px dashed #9aabbe;
  border-radius: 8px;
  padding: 22px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(248, 250, 253, 0.92)),
    var(--panel-soft);
}

.upload-cloud {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border: 2px solid var(--navy-2);
  color: var(--navy-2);
  border-radius: 999px;
  font-size: 25px;
}

.upload-zone strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.upload-zone p {
  color: var(--muted);
  margin: 7px auto 0;
  max-width: 580px;
  line-height: 1.6;
  font-size: 12px;
}

.upload-foot {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.analysis-card .segmented {
  margin-bottom: 16px;
}

.analysis-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.analysis-option {
  display: grid;
  gap: 10px;
  color: #44536a;
  font-size: 13px;
  line-height: 1.35;
}

.analysis-option + .analysis-option {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.check-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
}

.check-item span:first-child {
  color: var(--green);
  font-weight: 850;
}

.analysis-actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.risk-summary {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.risk-row {
  display: grid;
  grid-template-columns: 36px 1fr 54px 54px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
}

.risk-row:first-child {
  border-top: 0;
}

.risk-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: #ffffff;
  font-weight: 850;
}

.risk-mark.red {
  background: var(--red);
}

.risk-mark.orange {
  background: var(--orange);
}

.risk-mark.amber {
  background: var(--amber);
  color: #3f2e00;
}

.risk-mark.green {
  background: var(--green);
}

.risk-name {
  font-weight: 750;
  font-size: 13px;
}

.risk-count {
  text-align: right;
  font-size: 20px;
  font-weight: 750;
}

.risk-percent {
  text-align: right;
  font-size: 12px;
  font-weight: 750;
}

.risk-total {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 43px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 750;
}

.risk-matrix-shell {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
}

.matrix-y {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  color: var(--ink-2);
  font-weight: 750;
  font-size: 13px;
  display: grid;
  place-items: center;
}

.matrix-wrap {
  min-width: 0;
}

.matrix-labels-top,
.matrix-labels-bottom {
  display: grid;
  grid-template-columns: repeat(4, minmax(48px, 1fr));
  gap: 2px;
  color: var(--ink-2);
  font-size: 12px;
  text-align: center;
}

.matrix-labels-top span,
.matrix-labels-bottom span {
  min-height: 22px;
}

.matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(48px, 1fr));
  gap: 2px;
}

.cell {
  border-radius: 4px;
  padding: 9px;
  min-height: 52px;
  display: grid;
  place-items: center;
  font-weight: 850;
  font-size: 17px;
}

.low {
  background: linear-gradient(180deg, #70c66b, #4fae54);
  color: #ffffff;
}

.medium {
  background: linear-gradient(180deg, #ffd54a, #f7be16);
  color: #2b2600;
}

.high {
  background: linear-gradient(180deg, #ff8b2b, #f36b12);
  color: #ffffff;
}

.critical {
  background: linear-gradient(180deg, #fb4646, #e32727);
  color: #ffffff;
}

.matrix-x {
  margin-top: 10px;
  text-align: center;
  color: var(--ink-2);
  font-weight: 750;
  font-size: 13px;
}

.legend {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #475569;
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  display: inline-block;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.credit-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.credit-metric {
  min-height: 112px;
}

.credit-admin-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
}

.credit-form-panel,
.credit-table-panel,
.credit-log-panel {
  min-width: 0;
}

.credit-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.credit-guidance,
.credit-table-note {
  margin-top: 14px;
}

.credit-selected-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.credit-selected-card strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.credit-selected-card span {
  color: var(--muted);
  font-size: 12px;
}

.credit-balance-badge {
  min-width: 104px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  text-align: right;
}

.credit-balance-badge strong {
  margin-top: 3px;
  font-size: 20px;
  color: var(--green);
}

.credit-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.credit-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.credit-preview.minus {
  border-color: #fed7aa;
  background: #fff7ed;
}

.credit-preview.plus {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.credit-preview-item {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(215, 224, 236, 0.8);
}

.credit-preview-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.credit-preview-item strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.credit-preview-item.final strong {
  color: var(--green);
}

.credit-preview-arrow {
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 900;
  font-size: 20px;
}

.credit-warning {
  grid-column: 1 / -1;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 13px;
  font-weight: 750;
}

.credit-table table {
  min-width: 0;
  table-layout: fixed;
}

.credit-table th,
.credit-table td {
  padding: 10px 8px;
}

.credit-table th:nth-child(1),
.credit-table td:nth-child(1) {
  width: 24%;
}

.credit-table th:nth-child(2),
.credit-table td:nth-child(2) {
  width: 15%;
}

.credit-table th:nth-child(3),
.credit-table td:nth-child(3),
.credit-table th:nth-child(4),
.credit-table td:nth-child(4) {
  width: 11%;
}

.credit-table th:nth-child(5),
.credit-table td:nth-child(5) {
  width: 12%;
}

.credit-table th:nth-child(6),
.credit-table td:nth-child(6) {
  width: 15%;
}

.credit-table th:nth-child(7),
.credit-table td:nth-child(7) {
  width: 12%;
}

.credit-table .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.table-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.credit-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.credit-status.ok {
  background: var(--green-bg);
  color: var(--green);
}

.credit-status.low,
.credit-status.loading {
  background: var(--amber-bg);
  color: #8a6500;
}

.credit-status.exhausted {
  background: var(--red-bg);
  color: var(--red);
}

.credit-log-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.credit-log-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.credit-log-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.credit-log-item strong,
.credit-log-item span {
  display: block;
}

.credit-log-item span,
.credit-log-item time {
  color: var(--muted);
  font-size: 12px;
}

.user-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.user-metric {
  min-height: 112px;
}

.user-management-panel,
.user-form-panel {
  min-width: 0;
}

.user-management-header,
.user-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.user-management-header {
  margin-bottom: 16px;
}

.user-table table {
  min-width: 1000px;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.user-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.user-status.active {
  background: var(--green-bg);
  color: var(--green);
}

.user-status.inactive {
  background: var(--red-bg);
  color: var(--red);
}

.user-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.user-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 31px;
  line-height: 1;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  gap: 7px;
}

label {
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c7d3e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(38, 148, 86, 0.14);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0;
  background: #ffffff;
  overflow: hidden;
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
}

.segmented button.active {
  background: var(--navy);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.file-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.file-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.file-row:first-child {
  border-top: 0;
}

.btn {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 15px;
  background: var(--navy);
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  background: var(--navy-2);
  box-shadow: 0 10px 20px rgba(0, 36, 91, 0.16);
}

.btn.secondary {
  background: #ffffff;
  color: var(--ink-2);
  border-color: var(--line-strong);
}

.btn.secondary:hover {
  background: #f8fafd;
}

.btn.warn {
  background: var(--orange);
}

.btn.danger {
  background: #ffffff;
  border-color: #fecaca;
  color: var(--red);
}

.btn.danger:hover {
  background: var(--red-bg);
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.12);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.pill.Rendah {
  background: var(--green-bg);
  color: var(--green);
}

.pill.Sederhana {
  background: var(--amber-bg);
  color: #8a6500;
}

.pill.Tinggi {
  background: var(--orange-bg);
  color: #c2410c;
}

.pill.Kritikal {
  background: var(--red-bg);
  color: var(--red);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th {
  text-align: left;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafd;
}

th:first-child {
  border-left: 1px solid var(--line);
  border-top-left-radius: 8px;
}

th:last-child {
  border-right: 1px solid var(--line);
  border-top-right-radius: 8px;
}

td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  background: #ffffff;
}

td:first-child {
  border-left: 1px solid var(--line);
}

td:last-child {
  border-right: 1px solid var(--line);
}

tbody tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}

tbody tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}

.dashboard-table-card table {
  min-width: 920px;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--panel-soft);
}

.notice {
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #075985;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
}

.error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
}

.report-sheet {
  display: grid;
  gap: 14px;
}

.report-sheet h3 {
  margin: 0;
  font-size: 22px;
}

.risk-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.recent-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.recent-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  display: grid;
  gap: 8px;
}

.recent-item strong {
  display: block;
}

.recent-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mobile-menu {
  display: none;
}

.loading-panel {
  min-height: 220px;
  display: grid;
  gap: 14px;
  align-content: center;
}

.skeleton {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #edf2f7, #f8fafd, #edf2f7);
  background-size: 200% 100%;
  animation: shimmer 1.25s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

.login-loading,
.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 18, 49, 0.42);
  backdrop-filter: blur(10px);
}

.login-loading-card,
.confirm-card {
  width: min(420px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(0, 22, 62, 0.24);
}

.login-loading-card {
  padding: 28px;
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
}

.login-loading-card strong {
  color: var(--ink);
  font-size: 18px;
}

.login-loading-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.loading-ring {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 4px solid #dbe6f3;
  border-top-color: var(--navy);
  animation: spin 0.82s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 90;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  gap: 10px;
  min-height: 58px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(0, 22, 62, 0.16);
  animation: toastIn 0.22s ease-out;
}

.toast.success {
  border-left-color: var(--green);
}

.toast.error {
  border-left-color: var(--red);
}

.toast.warning {
  border-left-color: var(--amber);
}

.toast-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #edf3fb;
  color: var(--navy);
  font-size: 13px;
  font-weight: 850;
}

.toast.success .toast-icon {
  background: var(--green-bg);
  color: var(--green);
}

.toast.error .toast-icon {
  background: var(--red-bg);
  color: var(--red);
}

.toast.warning .toast-icon {
  background: var(--amber-bg);
  color: #8a6500;
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  color: var(--ink);
  font-size: 14px;
}

.toast span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.toast-close {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.confirm-card {
  padding: 22px;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #edf3fb;
  color: var(--navy);
  font-weight: 850;
  margin-bottom: 14px;
}

.confirm-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.confirm-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.confirm-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media print {
  .sidebar,
  .topbar,
  .no-print,
  .app-footer,
  .toast-host,
  .confirm-backdrop,
  .login-loading {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .content {
    padding: 0;
  }

  .panel,
  .dashboard-card {
    border: 0;
    box-shadow: none;
  }
}

@media (max-width: 1180px) {
  .dashboard-grid,
  .dashboard-workbench,
  .dashboard-bottom,
  .credit-summary-grid,
  .credit-admin-layout,
  .user-summary-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .analysis-option + .analysis-option {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 12px;
  }
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding: 26px;
  }

  .login-brand h1 {
    font-size: 34px;
    margin-top: 40px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-menu {
    display: block;
    max-width: 210px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .actions {
    width: 100%;
  }

  .header-credit-chip {
    flex: 1 1 170px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 16px 14px 28px;
  }

  .app-footer {
    flex-direction: column;
    padding: 18px 14px 22px;
  }
}

@media (max-width: 640px) {
  .toast-host {
    top: 12px;
    right: 14px;
  }

  .confirm-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 42px 42px;
    align-items: center;
  }

  .mobile-menu {
    grid-column: 1 / -1;
    max-width: none;
  }

  .header-credit-chip {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .notification-button {
    display: none;
  }

  #refreshBtn {
    grid-column: 2;
    grid-row: 3;
  }

  #logoutBtn {
    grid-column: 3;
    grid-row: 3;
  }

  .user-chip {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
  }

  .analysis-options {
    grid-template-columns: 1fr;
  }

  .upload-foot {
    flex-direction: column;
  }

  .risk-row {
    grid-template-columns: 32px 1fr 44px 44px;
    padding: 7px 9px;
  }

  .summary-value strong {
    font-size: 28px;
  }

  .credit-selected-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .credit-balance-badge {
    grid-column: 1 / -1;
    text-align: left;
  }

  .credit-quick-actions,
  .credit-preview {
    grid-template-columns: 1fr;
  }

  .credit-preview-arrow {
    min-height: 18px;
  }

  .credit-form-header,
  .credit-log-item,
  .user-management-header,
  .user-form-header,
  .user-form-actions {
    display: grid;
  }

  .user-form-grid {
    grid-template-columns: 1fr;
  }

  .user-table table {
    min-width: 0;
  }

  .credit-table table,
  .credit-table tbody,
  .credit-table tr,
  .credit-table td,
  .user-table table,
  .user-table tbody,
  .user-table tr,
  .user-table td {
    display: block;
    width: 100%;
  }

  .credit-table thead,
  .user-table thead {
    display: none;
  }

  .credit-table tr,
  .user-table tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
  }

  .credit-table td,
  .credit-table td:first-child,
  .credit-table td:last-child,
  .user-table td,
  .user-table td:first-child,
  .user-table td:last-child {
    border: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
  }

  .credit-table td + td,
  .user-table td + td {
    border-top: 1px solid var(--line);
  }

  .credit-table td::before,
  .user-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .credit-table td:first-child,
  .user-table td:first-child {
    display: block;
  }

  .credit-table td:first-child::before,
  .user-table td:first-child::before {
    content: "";
    display: none;
  }

  .credit-table .btn,
  .user-table .btn {
    min-width: 76px;
  }

  .row-actions {
    justify-content: flex-end;
  }
}
