:root {
  --bg: #e9eff5;
  --surface: #f4f7fb;
  --surface-soft: #dde6ef;
  --panel: #ffffff;
  --panel-muted: #f8fafc;
  --panel-raised: #eef3f8;
  --text: #0f172a;
  --text-dark: #0b1220;
  --muted: #475569;
  --line: rgba(15, 23, 42, 0.14);
  --primary: #0f4c81;
  --primary-dark: #0a345a;
  --accent: #d97706;
  --success: #38bdf8;
  --warning: #f59e0b;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(160deg, #f2f6fb 0%, #e8eef5 46%, #dbe4ee 100%);
  color: var(--text);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

a {
  color: inherit;
}

.app-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background:
    linear-gradient(180deg, #f5f8fc 0%, #e8eff7 100%);
  color: var(--text);
  border-right: 1px solid rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

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

.brand-logo {
  width: 120px;
  max-height: 50px;
  display: block;
}

.brand-mark {
  display: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: #64748b;
}

.nav-menu,
.sidebar-links,
.stack-form {
  display: grid;
  gap: 10px;
}

.nav-menu {
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
}

.nav-menu::-webkit-scrollbar {
  width: 8px;
}

.nav-menu::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
}

.nav-menu::-webkit-scrollbar-thumb {
  background: rgba(15, 76, 129, 0.45);
  border-radius: 999px;
}

.menu-scroll-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.menu-scroll-controls button {
  min-height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: var(--radius);
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.menu-scroll-controls button:hover {
  background: #e6eef7;
  color: #0f172a;
}

.nav-button,
.sidebar-links a,
.button-link,
.primary-button {
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.delete-row-button {
  border: 1px solid rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.14);
  color: #f87171;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.delete-row-button:hover {
  background: rgba(248, 113, 113, 0.3);
  color: #ffffff;
  border-color: rgba(248, 113, 113, 0.45);
}

.readonly-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
}

.row-action-form {
  margin: 0;
}

.table-note {
  margin-top: 0;
  margin-bottom: 12px;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.45;
}

.nav-button,
.sidebar-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: #1e293b;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.1);
  text-align: left;
}

.button-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.nav-button .button-icon {
  padding: 3px;
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 7px;
  color: #0f4c81;
  background: #eaf2fb;
  border: 1px solid rgba(15, 76, 129, 0.2);
}

.nav-button:hover,
.nav-button.is-active,
.sidebar-links a:hover {
  background: #dfe9f5;
  border-color: rgba(15, 76, 129, 0.42);
  color: #0f172a;
}

.nav-button:hover .button-icon,
.nav-button.is-active .button-icon {
  color: #ffffff;
  background: #0f4c81;
  border-color: #0f4c81;
}

.sidebar-links {
  margin-top: auto;
}

.main-content,
.standalone-page {
  width: 100%;
  padding: 32px;
}

.top-status-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
}

.online-pill,
.top-status-bar time {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.online-pill {
  gap: 8px;
  color: #bfdbfe;
}

.online-pill span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9);
}

.standalone-page {
  max-width: 1180px;
  margin: 0 auto;
}

.standalone-page.narrow {
  max-width: 880px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 30px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, #ffffff, #f2f6fb);
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.page-header h1 {
  margin: 4px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.2;
  color: #0f172a;
}

#dashboard .page-header .header-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

#dashboard .page-header .ai-control-title {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 10px;
  line-height: 1.05;
  white-space: nowrap;
}

#dashboard .ai-title-word,
#dashboard .integrated-title-word {
  font-size: clamp(1.9rem, 3.6vw, 3.2rem);
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

#dashboard .integrated-title-word {
  color: #e0e7ff;
  white-space: nowrap;
}

#dashboard .system-title-word {
  font-size: clamp(1.9rem, 3.6vw, 3.2rem);
  font-weight: 900;
  color: #cbd5e1;
  white-space: nowrap;
}

.page-header p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.document-flow-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.document-flow-node {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 12px;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.document-flow-node:not(:last-child)::after {
  content: ">";
  position: absolute;
  right: -9px;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #07111f;
  color: #bfdbfe;
  font-size: 0.76rem;
  font-weight: 900;
  border: 1px solid rgba(148, 163, 184, 0.26);
}

.document-flow-node span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
}

.document-flow-node strong,
.document-flow-node small {
  display: block;
}

.document-flow-node strong {
  color: #0f172a;
  font-size: 0.92rem;
}

.document-flow-node small {
  color: #64748b;
  line-height: 1.4;
}

.flow-input span {
  background: #2563eb;
}

.flow-ba span {
  background: #7c3aed;
}

.flow-invoice span {
  background: #0284c7;
}

.flow-kwitansi span {
  background: #d97706;
}

.flow-output span {
  background: #7c3aed;
}

.document-flow-node.is-active {
  transform: translateY(-2px);
  border-color: rgba(125, 211, 252, 0.72);
  background: linear-gradient(180deg, rgba(19, 58, 96, 0.98), rgba(13, 39, 65, 0.98));
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.2);
}

.eyebrow {
  margin: 0;
  color: #7dd3fc;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button-link,
.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), #1d64c8);
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(47, 128, 237, 0.22);
}

.button-link:hover,
.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: rgba(96, 165, 250, 0.12);
  color: #dbeafe;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.secondary-button:hover {
  border-color: rgba(125, 211, 252, 0.58);
  background: rgba(96, 165, 250, 0.22);
}

.danger-button {
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.danger-button:hover {
  border-color: rgba(248, 113, 113, 0.62);
  background: rgba(248, 113, 113, 0.2);
}

.mini-button {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 0.84rem;
}

.document-action-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.document-action-group-left {
  justify-content: flex-start;
}

.document-action-group form {
  margin: 0;
}

.flash-messages {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: grid;
  gap: 8px;
  width: min(720px, calc(100% - 32px));
  margin: 12px auto 0;
}

.flash-message {
  padding: 10px 14px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: var(--radius);
  background: rgba(7, 17, 31, 0.92);
  color: #e2e8f0;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.flash-success {
  border-color: rgba(96, 165, 250, 0.42);
}

.flash-error,
.flash-warning {
  border-color: rgba(248, 113, 113, 0.42);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

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

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

.metric-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-grid.finance-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.metric-grid.engineering-grid {
  margin-bottom: 16px;
}

.dashboard-grid {
  align-items: stretch;
}

.metric-card,
.panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
  border: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.metric-card::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(125, 211, 252, 0.12), transparent 32%),
    linear-gradient(315deg, rgba(139, 92, 246, 0.1), transparent 38%);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.metric-card:hover,
.panel:hover {
  transform: translateY(-3px);
  border-color: rgba(125, 211, 252, 0.38);
  box-shadow:
    0 22px 52px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(125, 211, 252, 0.08);
}

.metric-card:hover::before,
.panel:hover::before {
  opacity: 1;
}

.metric-card {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 20px;
  border-top: 3px solid rgba(96, 165, 250, 0.72);
}

.metric-card:nth-child(4n + 1) {
  border-top-color: #38bdf8;
}

.metric-card:nth-child(4n + 2) {
  border-top-color: #7c3aed;
}

.metric-card:nth-child(4n + 3) {
  border-top-color: #f59e0b;
}

.metric-card:nth-child(4n + 4) {
  border-top-color: #a78bfa;
}

.metric-card > *,
.panel > * {
  position: relative;
  z-index: 1;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.metric-card strong {
  color: var(--text-dark);
  font-size: 1.75rem;
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(125, 211, 252, 0.12);
}

.metric-card small {
  color: var(--muted);
}

.engineering-grid .metric-card strong {
  font-size: 1.45rem;
}

.panel {
  padding: 24px;
}

.panel h2 {
  margin: -24px -24px 18px;
  padding: 14px 18px;
  font-size: 1.25rem;
  color: #0f172a;
  letter-spacing: 0.01em;
  line-height: 1.3;
  background: linear-gradient(135deg, #dfe9f5, #edf3fa);
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

label {
  font-weight: 700;
  color: #1e293b;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(15, 76, 129, 0.82);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.14);
}

input::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

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

pre {
  min-height: 80px;
  margin: 16px 0 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: var(--radius);
  background: rgba(7, 17, 31, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #dbeafe;
  font-family: Consolas, "Courier New", monospace;
}

.image-preview {
  display: block;
  max-width: 100%;
  margin-top: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.status-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.32);
}

.status-box span,
.status-box strong {
  display: block;
}

.status-box span {
  color: #bfdbfe;
  font-weight: 800;
  font-size: 0.82rem;
}

.status-box strong {
  margin-top: 6px;
  color: #e0e7ff;
}

.workflow-list,
.priority-list {
  display: grid;
  gap: 12px;
}

.workflow-list article,
.priority-list div {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(7, 17, 31, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.workflow-list article:hover,
.priority-list div:hover {
  transform: translateX(4px);
  border-color: rgba(125, 211, 252, 0.34);
  background: rgba(15, 35, 61, 0.9);
}

.workflow-list strong,
.workflow-list span {
  display: block;
}

.workflow-list strong {
  margin-bottom: 6px;
  color: #eff6ff;
}

.workflow-list span,
.priority-list div {
  color: var(--muted);
}

.ai-workspace-panel {
  display: grid;
  gap: 16px;
}

.ai-workspace-panel h2 {
  margin: 0;
  padding: 0;
  color: #143447;
  background: transparent;
  border: 0;
  font-size: 1.28rem;
}

.workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.workspace-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.workspace-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.workspace-list {
  display: grid;
  gap: 12px;
}

.workspace-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.15fr) minmax(170px, 0.85fr) minmax(190px, 0.9fr) 112px;
  gap: 16px;
  align-items: center;
  min-height: 86px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid rgba(30, 52, 61, 0.12);
  box-shadow: 0 8px 18px rgba(18, 38, 46, 0.06);
}

.workspace-row strong,
.workspace-row small {
  display: block;
}

.workspace-row strong {
  color: #173b50;
  font-size: 1rem;
}

.workspace-row small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}

.workspace-meta {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #f5f8f7;
  border: 1px solid rgba(30, 52, 61, 0.1);
}

.workspace-meta span {
  color: #4f46e5;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace-meta strong {
  color: #233942;
  font-size: 0.9rem;
  line-height: 1.35;
}

.workspace-ai-action {
  color: #2f4854;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
}

.workspace-row em {
  justify-self: end;
  min-width: 104px;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: #f1f5ff;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-width: 68px;
  justify-content: center;
  margin-right: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.badge.high {
  background: #dc2626;
}

.badge.medium {
  background: #d97706;
}

.badge.low {
  background: #475569;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  text-align: left;
}

th {
  background: #11406e;
  color: #eff6ff;
  position: sticky;
  top: 0;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.78rem;
}

td {
  background: #ffffff;
  color: #0f172a;
}

tr:nth-child(even) td {
  background: #f8fafc;
}

tr:hover td {
  background: #eef2ff;
}

.total-summary-panel {
  margin-top: 16px;
}

.total-summary-table th {
  background: #123f6d;
}

.total-summary-table td {
  background: #eef2ff;
  color: #1e3a8a;
  font-weight: 800;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.report-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.report-form label,
.document-form label,
.document-builder-form label {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

.document-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

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

.document-builder-form {
  display: grid;
  gap: 16px;
}

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

.document-type-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 110px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(7, 17, 31, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.document-type-card:hover,
.document-type-card.is-active {
  transform: translateY(-2px);
  background: rgba(15, 35, 61, 0.92);
  border-color: rgba(125, 211, 252, 0.5);
}

.document-type-card[data-document-card="invoice"] {
  border-top: 3px solid #0284c7;
}

.document-type-card[data-document-card="berita_acara"] {
  border-top: 3px solid #7c3aed;
}

.document-type-card[data-document-card="kwitansi"] {
  border-top: 3px solid #d97706;
}

.document-type-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.document-type-card .button-icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  padding: 6px;
  border-radius: 7px;
  color: #93c5fd;
  background: rgba(125, 211, 252, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.18);
}

.document-type-card.is-active .button-icon {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: rgba(255, 255, 255, 0.2);
}

.document-type-card span,
.document-type-card strong,
.document-type-card small,
.document-next-code {
  display: block;
}

.document-type-card strong {
  color: #eff6ff;
  font-size: 1rem;
}

.document-type-card small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.document-next-code {
  margin-top: 10px;
  color: #bfdbfe;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.document-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(7, 17, 31, 0.46);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.document-section h3 {
  margin: 0;
  font-size: 1rem;
  color: #f8fbff;
}

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

.flow-step-card {
  display: grid;
  gap: 6px;
  min-height: 120px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 35, 61, 0.8);
  position: relative;
}

.flow-step-card:not(:last-child)::after {
  content: ">";
  position: absolute;
  right: -9px;
  top: 50%;
  transform: translateY(-50%);
  color: #60a5fa;
  font-weight: 800;
}

.flow-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2f80ed, #7c3aed);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.flow-step-card strong {
  color: #eff6ff;
  font-size: 0.92rem;
}

.flow-step-card small {
  color: #a8b8d4;
  line-height: 1.35;
}

.workflow-stage-tabs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.workflow-stage-tab {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #ffffff;
  color: #1e293b;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.workflow-stage-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 900;
}

.workflow-stage-tab.is-active {
  border-color: rgba(15, 76, 129, 0.45);
  background: #e6eef7;
  color: #0f172a;
}

.workflow-stage-tab.is-active span {
  background: #0f4c81;
  color: #ffffff;
}

.workflow-stage-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.workflow-stage-panel h3 {
  margin: 0;
}

.workflow-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

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

.workflow-download-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: var(--radius);
  background: #ffffff;
}

.workflow-download-card-latest {
  margin-bottom: 12px;
  border-color: rgba(15, 76, 129, 0.28);
  background: linear-gradient(135deg, #f8fbff, #eef4fb);
}

.document-preview-box {
  max-height: 380px;
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
}

.document-preview-box pre {
  margin: 0;
  white-space: pre-wrap;
  font: 0.95rem/1.55 "Times New Roman", serif;
}

.document-preview-frame {
  width: 100%;
  min-height: 720px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius);
  background: #f8fafc;
}

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

.workflow-download-card span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.document-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.signature-upload-control input[type="file"] {
  min-height: 48px;
  padding: 8px 10px;
}

.document-number-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.16), transparent 45%),
    rgba(7, 17, 31, 0.68);
  border: 1px solid rgba(99, 102, 241, 0.28);
}

.document-number-preview span,
.document-number-preview strong,
.document-number-preview small {
  display: block;
}

.document-number-preview span {
  color: #7dd3fc;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.document-number-preview strong {
  margin-top: 4px;
  color: #f8fbff;
  font-size: 1.08rem;
}

.document-number-preview small {
  margin-top: 3px;
  color: #a8b8d4;
}

.document-template-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
  gap: 14px;
  align-items: end;
}

.input-table td:first-child {
  width: 180px;
  color: #eff6ff;
  font-weight: 800;
}

.input-table td:nth-child(2) {
  min-width: 320px;
}

.input-table textarea {
  min-height: 86px;
}

.document-submit {
  justify-self: start;
}

.document-form-wide {
  grid-column: 1 / -1;
}

.document-form textarea,
.document-builder-form textarea {
  min-height: 130px;
}

.workflow-progress-card {
  grid-column: span 2;
  padding: 12px 14px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(47, 128, 237, 0.2), rgba(124, 58, 237, 0.14)),
    rgba(7, 17, 31, 0.78);
  border: 1px solid rgba(125, 211, 252, 0.36);
}

.workflow-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.workflow-progress-head strong {
  color: #dbeafe;
}

.workflow-progress-head span {
  font-weight: 900;
  color: #7dd3fc;
}

.workflow-progress-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.25);
}

.workflow-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f80ed, #7c3aed);
  transition: width 200ms ease;
}

.document-download {
  margin-top: 14px;
}

canvas {
  width: 100%;
  display: block;
}

.finance-charts {
  align-items: start;
}

.chart-box {
  position: relative;
  width: 100%;
  height: 170px;
  max-height: 170px;
  overflow: hidden;
}

.compact-chart {
  padding-bottom: 18px;
}

.compact-chart canvas {
  width: 100% !important;
  height: 170px !important;
  max-height: 170px !important;
}

.hpu-chart-panel {
  align-self: start;
}

.hpu-chart-box {
  position: relative;
  width: 100%;
  height: 240px;
  max-height: 240px;
  overflow: hidden;
}

.hpu-chart-box canvas {
  width: 100% !important;
  height: 240px !important;
  max-height: 240px !important;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  padding: 18px;
  border-left: 4px solid var(--primary);
  background: var(--panel-muted);
  border-radius: var(--radius);
}

.timeline-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--primary);
  font-weight: 800;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
}

.ai-assistant {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  user-select: none;
}

.ai-orb {
  position: relative;
  width: 76px;
  height: 76px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.62);
  background: #eef6ff;
  box-shadow: 0 14px 34px rgba(47, 128, 237, 0.38);
  cursor: grab;
  overflow: hidden;
}

.ai-orb:active {
  cursor: grabbing;
}

.ai-robot-head {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  transform: scale(1.04);
}

.ai-eye {
  position: absolute;
  top: 24px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ffffff;
}

.ai-eye-left {
  left: 21px;
}

.ai-eye-right {
  right: 21px;
}

.ai-mouth {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 20px;
  height: 9px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  transform: translateX(-50%);
}

.ai-panel {
  width: min(320px, calc(100vw - 24px));
  margin-bottom: 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(7, 17, 31, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.ai-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(47, 128, 237, 0.2);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.ai-panel header button {
  border: 0;
  background: transparent;
  color: #dbeafe;
  cursor: pointer;
  font-weight: 800;
}

.ai-chat-log {
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.ai-chat-log p {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 35, 61, 0.78);
  color: #dbeafe;
  font-size: 0.88rem;
}

.ai-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px 12px;
}

.ai-chat-form input {
  min-height: 38px;
}

.ai-chat-form button {
  border: 0;
  border-radius: var(--radius);
  padding: 0 12px;
  background: linear-gradient(135deg, var(--primary), #1d64c8);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

/* Unified industrial palette: strong navigation contrast and clean work surfaces. */
:root {
  --bg: #edf2f0;
  --surface: #ffffff;
  --surface-soft: #e8eeec;
  --panel: #ffffff;
  --panel-muted: #f5f8f7;
  --panel-raised: #eef4f2;
  --text: #172b34;
  --text-dark: #11222a;
  --muted: #526771;
  --line: rgba(30, 52, 61, 0.14);
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --accent: #d97706;
}

body {
  background: linear-gradient(140deg, #f8fafc 0%, #eef3f9 48%, #e5edf7 100%);
  color: var(--text);
}

.sidebar {
  isolation: isolate;
  background:
    linear-gradient(145deg, rgba(125, 211, 252, 0.18), transparent 34%),
    linear-gradient(210deg, rgba(242, 184, 75, 0.14), transparent 42%),
    linear-gradient(180deg, #1259aa 0%, #0b4488 48%, #062c62 100%);
  color: #f8fbff;
  border-right-color: rgba(191, 219, 254, 0.38);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 12px 0 34px rgba(6, 26, 57, 0.14);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.16;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0) 0%, rgba(2, 6, 23, 0.24) 100%);
}

.sidebar > * {
  position: relative;
}

.brand {
  padding: 13px;
  border: 1px solid rgba(219, 234, 254, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 30px rgba(2, 6, 23, 0.16);
}

.brand strong {
  color: #ffffff;
  letter-spacing: 0.01em;
}

.brand small {
  color: #d9ebff;
}

.menu-scroll-controls button {
  border-color: rgba(219, 234, 254, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #f8fbff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.menu-scroll-controls button:hover {
  background: rgba(219, 234, 254, 0.24);
  border-color: rgba(255, 255, 255, 0.42);
  color: #ffffff;
}

.nav-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.nav-menu::-webkit-scrollbar-thumb {
  background: rgba(191, 219, 254, 0.7);
}

.nav-button,
.sidebar-links a {
  --menu-accent: #7dd3fc;
  --menu-soft: rgba(125, 211, 252, 0.16);
  --menu-line: rgba(125, 211, 252, 0.42);
  --menu-strong: #1d4ed8;
  color: #f5f9ff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(219, 234, 254, 0.16);
  text-shadow: none;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.nav-button .button-icon {
  color: var(--menu-accent);
  background: var(--menu-soft);
  border-color: var(--menu-line);
}

.nav-button:hover,
.sidebar-links a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(219, 234, 254, 0.46);
  box-shadow: inset 3px 0 0 var(--menu-accent), 0 12px 24px rgba(2, 6, 23, 0.13);
  transform: translateX(2px);
}

.nav-button.is-active {
  color: #052f66;
  background: linear-gradient(135deg, #ffffff 0%, #eaf4ff 100%);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: inset 4px 0 0 var(--menu-accent), 0 16px 30px rgba(2, 6, 23, 0.22);
  transform: none;
}

.nav-button:hover .button-icon {
  color: #ffffff;
  background: var(--menu-strong);
  border-color: var(--menu-accent);
}

.nav-button.is-active .button-icon {
  color: #ffffff;
  background: var(--menu-strong);
  border-color: var(--menu-accent);
}

.nav-menu .nav-button:nth-child(1) {
  --menu-accent: #38bdf8;
  --menu-soft: rgba(56, 189, 248, 0.17);
  --menu-line: rgba(56, 189, 248, 0.42);
  --menu-strong: #0284c7;
}

.nav-menu .nav-button:nth-child(2) {
  --menu-accent: #60a5fa;
  --menu-soft: rgba(96, 165, 250, 0.17);
  --menu-line: rgba(96, 165, 250, 0.42);
  --menu-strong: #2563eb;
}

.nav-menu .nav-button:nth-child(3) {
  --menu-accent: #a78bfa;
  --menu-soft: rgba(167, 139, 250, 0.18);
  --menu-line: rgba(167, 139, 250, 0.42);
  --menu-strong: #7c3aed;
}

.nav-menu .nav-button:nth-child(4) {
  --menu-accent: #fbbf24;
  --menu-soft: rgba(251, 191, 36, 0.16);
  --menu-line: rgba(251, 191, 36, 0.38);
  --menu-strong: #d97706;
}

.nav-menu .nav-button:nth-child(5) {
  --menu-accent: #93c5fd;
  --menu-soft: rgba(147, 197, 253, 0.16);
  --menu-line: rgba(147, 197, 253, 0.38);
  --menu-strong: #2563eb;
}

.nav-menu .nav-button:nth-child(6) {
  --menu-accent: #fb7185;
  --menu-soft: rgba(251, 113, 133, 0.17);
  --menu-line: rgba(251, 113, 133, 0.42);
  --menu-strong: #e11d48;
}

.nav-menu .nav-button:nth-child(7) {
  --menu-accent: #fb923c;
  --menu-soft: rgba(251, 146, 60, 0.16);
  --menu-line: rgba(251, 146, 60, 0.38);
  --menu-strong: #ea580c;
}

.nav-menu .nav-button:nth-child(8) {
  --menu-accent: #c084fc;
  --menu-soft: rgba(192, 132, 252, 0.17);
  --menu-line: rgba(192, 132, 252, 0.42);
  --menu-strong: #9333ea;
}

.nav-menu .nav-button:nth-child(9) {
  --menu-accent: #94a3b8;
  --menu-soft: rgba(148, 163, 184, 0.18);
  --menu-line: rgba(148, 163, 184, 0.42);
  --menu-strong: #475569;
}

.nav-menu .nav-button:nth-child(10) {
  --menu-accent: #60a5fa;
  --menu-soft: rgba(96, 165, 250, 0.15);
  --menu-line: rgba(96, 165, 250, 0.38);
  --menu-strong: #1d4ed8;
}

.nav-menu .nav-button:nth-child(11) {
  --menu-accent: #f59e0b;
  --menu-soft: rgba(245, 158, 11, 0.16);
  --menu-line: rgba(245, 158, 11, 0.38);
  --menu-strong: #b45309;
}

.nav-menu .nav-button:nth-child(12) {
  --menu-accent: #818cf8;
  --menu-soft: rgba(129, 140, 248, 0.17);
  --menu-line: rgba(129, 140, 248, 0.42);
  --menu-strong: #4f46e5;
}

.nav-menu .nav-button:nth-child(13) {
  --menu-accent: #f472b6;
  --menu-soft: rgba(244, 114, 182, 0.17);
  --menu-line: rgba(244, 114, 182, 0.4);
  --menu-strong: #db2777;
}

.nav-menu .nav-button:nth-child(14) {
  --menu-accent: #93c5fd;
  --menu-soft: rgba(147, 197, 253, 0.16);
  --menu-line: rgba(147, 197, 253, 0.4);
  --menu-strong: #1d4ed8;
}

.top-status-bar {
  color: #354b55;
}

.online-pill,
.top-status-bar time {
  background: #ffffff;
  border-color: rgba(30, 52, 61, 0.12);
  box-shadow: 0 6px 18px rgba(18, 38, 46, 0.08);
}

.online-pill {
  color: #dbeafe;
}

.page-header {
  background: linear-gradient(118deg, #142c3b 0%, #173b50 58%, #1d4c60 100%);
  border-color: rgba(212, 232, 229, 0.12);
  box-shadow: 0 14px 30px rgba(18, 38, 46, 0.18);
}

.eyebrow {
  color: #bfdbfe;
}

.page-header h1 {
  color: #ffffff;
}

.page-header p {
  color: #d7e5e5;
}

.page-header .button-link {
  background: #ffffff;
  color: #163848;
  box-shadow: 0 10px 22px rgba(7, 20, 29, 0.2);
}

.page-header .button-link:hover {
  background: #eaf2ff;
  color: #102c36;
}

.button-link,
.primary-button {
  background: #1d4ed8;
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.18);
}

.button-link:hover,
.primary-button:hover {
  background: #1e3a8a;
}

.secondary-button {
  border-color: rgba(30, 52, 61, 0.18);
  background: #ffffff;
  color: #233942;
}

.secondary-button:hover {
  border-color: rgba(37, 99, 235, 0.34);
  background: #eff6ff;
}

.danger-button {
  border-color: rgba(185, 28, 28, 0.2);
  background: #fff5f5;
  color: #991b1b;
}

.metric-card,
.panel {
  background: #ffffff;
  border-color: rgba(30, 52, 61, 0.12);
  box-shadow: 0 10px 24px rgba(18, 38, 46, 0.07);
}

.metric-card:hover,
.panel:hover {
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 16px 32px rgba(18, 38, 46, 0.11);
}

.metric-card:nth-child(4n + 1) { border-top-color: #2563eb; }
.metric-card:nth-child(4n + 2) { border-top-color: #7c3aed; }
.metric-card:nth-child(4n + 3) { border-top-color: #d97706; }
.metric-card:nth-child(4n + 4) { border-top-color: #db2777; }

.panel h2 {
  color: #ffffff;
  background: linear-gradient(112deg, #142c3b 0%, #173b50 100%);
  border-bottom-color: rgba(212, 232, 229, 0.14);
}

.workflow-list article,
.priority-list div,
.document-type-card,
.document-section,
.flow-step-card,
.workflow-stage-panel,
.workflow-download-card {
  background: #ffffff;
  border-color: rgba(30, 52, 61, 0.13);
  color: #233942;
}

.workflow-list article:hover,
.priority-list div:hover,
.document-type-card:hover,
.document-type-card.is-active {
  background: #f4f7ff;
  border-color: rgba(99, 102, 241, 0.28);
}

.workflow-list strong,
.document-type-card strong,
.document-section h3,
.flow-step-card strong {
  color: #172b34;
}

.workflow-list span,
.priority-list div,
.document-type-card small,
.flow-step-card small {
  color: #526771;
}

.document-next-code {
  color: #2563eb;
}

.document-type-card .button-icon {
  color: #4f46e5;
  background: #eef2ff;
  border-color: rgba(79, 70, 229, 0.18);
}

.document-type-card.is-active .button-icon {
  background: #4f46e5;
  border-color: #4f46e5;
}

.document-flow-node.is-active {
  background: #eef4ff;
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.1);
}

.flow-step-number {
  background: #2563eb;
}

.flow-step-card:not(:last-child)::after {
  color: #7c3aed;
}

.workflow-stage-tab {
  color: #233942;
  background: #ffffff;
  border-color: rgba(30, 52, 61, 0.14);
}

.workflow-stage-tab span {
  background: #e8eeec;
  color: #3b525b;
}

.workflow-stage-tab.is-active {
  color: #1e3a8a;
  background: #eef4ff;
  border-color: rgba(37, 99, 235, 0.3);
}

.workflow-stage-tab.is-active span {
  background: #2563eb;
}

.workflow-download-card-latest {
  background: #f4f7ff;
  border-color: rgba(99, 102, 241, 0.22);
}

.workflow-progress-card {
  background: #f7f5ff;
  border-color: rgba(124, 58, 237, 0.2);
}

.workflow-progress-head strong {
  color: #172b34;
}

.workflow-progress-head span {
  color: #4f46e5;
}

.workflow-progress-track span {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
}

th,
.total-summary-table th {
  background: #254550;
}

tr:hover td {
  background: #f1f5ff;
}

pre {
  background: #f5f8f7;
  border-color: rgba(30, 52, 61, 0.14);
  color: #233942;
}

.status-box {
  background: #eef4ff;
  border-color: rgba(96, 165, 250, 0.28);
}

.status-box span,
.status-box strong {
  color: #1e3a8a;
}

.flash-message {
  background: #ffffff;
  color: #172b34;
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 10px 22px rgba(18, 38, 46, 0.1);
}

.ai-orb {
  border-color: rgba(147, 197, 253, 0.54);
  background: #eef6ff;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.28);
}

.ai-panel {
  border-color: rgba(30, 52, 61, 0.18);
  background: #ffffff;
  color: #172b34;
  box-shadow: 0 16px 36px rgba(18, 38, 46, 0.16);
}

.ai-panel header {
  background: #e8eeec;
  border-bottom-color: rgba(30, 52, 61, 0.12);
}

.ai-panel header button {
  color: #233942;
}

.ai-chat-log p {
  background: #f2f6f5;
  color: #233942;
}

.ai-chat-form button {
  background: #1d4ed8;
}

/* Final dark gradient theme: no green accents, tuned for a polished control-center feel. */
:root {
  --bg: #080f1f;
  --surface: #0d1728;
  --surface-soft: #13223a;
  --panel: #101d31;
  --panel-muted: #0b1424;
  --panel-raised: #162640;
  --text: #e5edf8;
  --text-dark: #f8fbff;
  --muted: #9fb1c8;
  --line: rgba(148, 163, 184, 0.22);
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --accent: #f59e0b;
  --success: #38bdf8;
}

body {
  background:
    radial-gradient(circle at 18% 12%, rgba(59, 130, 246, 0.18), transparent 32%),
    radial-gradient(circle at 78% 8%, rgba(139, 92, 246, 0.16), transparent 34%),
    linear-gradient(145deg, #07101f 0%, #0b1426 46%, #111827 100%);
  color: var(--text);
}

.sidebar {
  background:
    linear-gradient(145deg, rgba(59, 130, 246, 0.2), transparent 34%),
    linear-gradient(210deg, rgba(245, 158, 11, 0.14), transparent 43%),
    linear-gradient(180deg, #111d35 0%, #0b1730 52%, #070e1f 100%);
  border-right-color: rgba(147, 197, 253, 0.24);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.07), 14px 0 38px rgba(2, 6, 23, 0.28);
}

.nav-button,
.sidebar-links a {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.2);
}

.nav-button:hover,
.sidebar-links a:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--menu-line);
}

.nav-button.is-active {
  color: #f8fbff;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.98), rgba(124, 58, 237, 0.96));
  border-color: rgba(219, 234, 254, 0.3);
}

.nav-menu .nav-button:nth-child(5) {
  --menu-accent: #93c5fd;
  --menu-soft: rgba(147, 197, 253, 0.15);
  --menu-line: rgba(147, 197, 253, 0.38);
  --menu-strong: #2563eb;
}

.nav-menu .nav-button:nth-child(10) {
  --menu-accent: #60a5fa;
  --menu-soft: rgba(96, 165, 250, 0.15);
  --menu-line: rgba(96, 165, 250, 0.38);
  --menu-strong: #1d4ed8;
}

.main-content,
.standalone-page {
  background:
    radial-gradient(circle at 82% 4%, rgba(245, 158, 11, 0.08), transparent 26%),
    radial-gradient(circle at 10% 28%, rgba(124, 58, 237, 0.1), transparent 28%);
}

.top-status-bar {
  color: #cbd5e1;
}

.online-pill,
.top-status-bar time {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.22);
}

.online-pill {
  color: #dbeafe;
}

.online-pill span {
  background: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.85);
}

.page-header {
  background:
    radial-gradient(circle at 86% 10%, rgba(245, 158, 11, 0.16), transparent 32%),
    linear-gradient(118deg, #111d35 0%, #172554 55%, #2e1065 100%);
  border-color: rgba(147, 197, 253, 0.18);
  box-shadow: 0 20px 44px rgba(2, 6, 23, 0.28);
}

.page-header p {
  color: #cbd5e1;
}

.page-header .button-link {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.page-header .button-link:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
}

.button-link,
.primary-button {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.button-link:hover,
.primary-button:hover {
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
}

.secondary-button,
.menu-scroll-controls button {
  background: rgba(15, 23, 42, 0.76);
  border-color: rgba(148, 163, 184, 0.24);
  color: #e5edf8;
}

.secondary-button:hover,
.menu-scroll-controls button:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(147, 197, 253, 0.42);
}

.metric-card,
.panel,
.workflow-list article,
.priority-list div,
.document-type-card,
.document-section,
.flow-step-card,
.workflow-stage-panel,
.workflow-download-card,
.workflow-progress-card,
.ai-panel {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(13, 23, 39, 0.96));
  border-color: rgba(148, 163, 184, 0.18);
  color: #dbeafe;
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.22);
}

.metric-card:hover,
.panel:hover,
.workflow-list article:hover,
.priority-list div:hover,
.document-type-card:hover,
.document-type-card.is-active {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(17, 24, 39, 0.98));
  border-color: rgba(147, 197, 253, 0.35);
}

.metric-card strong,
.panel h3,
.workflow-list strong,
.document-type-card strong,
.document-section h3,
.flow-step-card strong,
.workflow-progress-head strong {
  color: #f8fbff;
}

.metric-card span,
.metric-card small,
.panel p,
.workflow-list span,
.priority-list div,
.document-type-card small,
.flow-step-card small,
.workflow-progress-head span,
.table-note {
  color: #aebfd4;
}

.panel h2 {
  background: linear-gradient(112deg, #111d35 0%, #172554 100%);
  border-bottom-color: rgba(147, 197, 253, 0.18);
}

.document-flow-panel,
.document-flow-node,
.workflow-stage-tab,
.document-flow-node.is-active {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.2);
  color: #dbeafe;
}

.document-flow-node strong,
.workflow-stage-tab,
.workspace-row strong,
.workspace-meta strong {
  color: #f8fbff;
}

.document-flow-node small,
.workflow-stage-tab span,
.workspace-row small {
  color: #aebfd4;
}

.workflow-stage-tab.is-active,
.workflow-download-card-latest {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(96, 165, 250, 0.38);
  color: #dbeafe;
}

.status-box {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(96, 165, 250, 0.34);
}

.status-box span,
.status-box strong {
  color: #dbeafe;
}

.workspace-row,
.workspace-meta,
.document-type-card,
.document-section,
.flow-step-card {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.2);
}

.workspace-head span,
.workspace-row em {
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
}

.workspace-meta span,
.document-next-code,
.workflow-progress-head span {
  color: #93c5fd;
}

th,
.total-summary-table th {
  background: #172554;
  color: #f8fbff;
}

td,
tr:nth-child(even) td,
.total-summary-table td {
  background: rgba(15, 23, 42, 0.82);
  color: #dbeafe;
}

tr:hover td {
  background: rgba(37, 99, 235, 0.16);
}

.table-wrap,
pre,
input,
textarea,
select {
  background: rgba(8, 15, 31, 0.78);
  border-color: rgba(148, 163, 184, 0.22);
  color: #e5edf8;
}

input::placeholder,
textarea::placeholder {
  color: #73849b;
}

.flash-message {
  background: rgba(15, 23, 42, 0.94);
  color: #e5edf8;
  border-color: rgba(96, 165, 250, 0.32);
}

.flash-success {
  border-color: rgba(147, 197, 253, 0.48);
}

.ai-panel header,
.ai-chat-log p {
  background: rgba(15, 23, 42, 0.9);
  color: #e5edf8;
  border-color: rgba(148, 163, 184, 0.18);
}

.ai-panel header button {
  color: #e5edf8;
}

.ai-chat-form button {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}

#dashboard .metric-card span,
#dashboard .metric-card strong,
#dashboard .ai-workspace-panel h2,
#dashboard .workspace-head span,
#dashboard .workspace-row strong,
#dashboard .workspace-meta span,
#dashboard .workspace-meta strong,
#dashboard .workspace-ai-action,
#dashboard .workspace-row em {
  font-weight: 400;
}

#dashboard .workspace-ai-action {
  padding: 10px 12px;
  border: 1px solid rgba(147, 197, 253, 0.26);
  border-radius: var(--radius);
  background: rgba(37, 99, 235, 0.16);
  color: #f8fbff;
  box-shadow: inset 3px 0 0 #60a5fa;
}

#dashboard .metric-card,
#dashboard .workspace-row {
  --box-accent: #60a5fa;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(124, 58, 237, 0.08)),
    rgba(15, 23, 42, 0.82);
  border-color: rgba(147, 197, 253, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 34px rgba(2, 6, 23, 0.2);
}

#dashboard .metric-card {
  border-top-color: var(--box-accent);
}

#dashboard .metric-card:nth-child(1),
#dashboard .workspace-row:nth-child(1) {
  --box-accent: #60a5fa;
}

#dashboard .metric-card:nth-child(2),
#dashboard .workspace-row:nth-child(2) {
  --box-accent: #a78bfa;
}

#dashboard .metric-card:nth-child(3),
#dashboard .workspace-row:nth-child(3) {
  --box-accent: #f59e0b;
}

#dashboard .metric-card:nth-child(4),
#dashboard .workspace-row:nth-child(4) {
  --box-accent: #f472b6;
}

#dashboard .workspace-row:nth-child(5) {
  --box-accent: #818cf8;
}

#dashboard .workspace-row > div:first-child,
#dashboard .workspace-meta,
#dashboard .workspace-ai-action,
#dashboard .workspace-row em,
#dashboard .workspace-head span {
  --box-accent: #60a5fa;
  border: 1px solid rgba(147, 197, 253, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(124, 58, 237, 0.08)),
    rgba(8, 15, 31, 0.58);
  color: #f8fbff;
  box-shadow:
    inset 3px 0 0 var(--box-accent),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#dashboard .workspace-row > div:first-child {
  min-height: 72px;
  padding: 10px 12px;
}

#dashboard .workspace-meta,
#dashboard .workspace-ai-action,
#dashboard .workspace-row em {
  border-color: rgba(147, 197, 253, 0.26);
}

#dashboard .workspace-row em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e5edf8;
}

#dashboard .metric-card:hover,
#dashboard .workspace-row:hover {
  border-color: rgba(219, 234, 254, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 42px rgba(2, 6, 23, 0.28);
}

#dashboard .metric-card span,
#dashboard .workspace-meta span {
  color: #bfdbfe;
}

#dashboard .metric-card strong,
#dashboard .workspace-row strong,
#dashboard .workspace-meta strong,
#dashboard .workspace-ai-action {
  color: #f8fbff;
}

#dashboard .metric-card small,
#dashboard .workspace-row small {
  color: #cbd5e1;
}

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

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .nav-menu,
  .sidebar-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-menu {
    max-height: 260px;
  }

  .metric-grid,
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-row {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 0.8fr);
  }

  .workspace-row em {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .metric-grid.finance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-type-grid,
  .document-form-grid,
  .document-template-grid,
  .workflow-download-grid,
  .flow-steps-grid,
  .workflow-stage-tabs {
    grid-template-columns: 1fr;
  }

  .document-flow-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-flow-node::after {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .main-content,
  .standalone-page,
  .sidebar {
    padding: 18px;
  }

  .top-status-bar {
    justify-content: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .online-pill,
  .top-status-bar time {
    justify-content: center;
  }

  .page-header {
    display: grid;
    padding: 20px;
  }

  #dashboard .page-header .ai-control-title {
    gap: 6px;
  }

  #dashboard .ai-title-word,
  #dashboard .integrated-title-word,
  #dashboard .system-title-word {
    font-size: 1.45rem;
  }

  .nav-menu,
  .sidebar-links,
  .metric-grid,
  .metric-grid.compact,
  .metric-grid.finance-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

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

  .document-form,
  .document-type-grid,
  .document-form-grid,
  .document-template-grid,
  .workflow-download-grid,
  .flow-steps-grid,
  .workflow-stage-tabs,
  .document-flow-panel,
  .header-actions {
    grid-template-columns: 1fr;
  }

  .flow-step-card::after {
    display: none;
  }

  .document-number-preview {
    display: grid;
  }

  .header-actions {
    display: grid;
    justify-content: stretch;
  }

  .hpu-chart-box,
  .hpu-chart-box canvas {
    height: 200px !important;
    max-height: 200px !important;
  }

  .button-link,
  .primary-button {
    width: 100%;
  }

  .workspace-head {
    display: grid;
  }

  .workspace-head span {
    justify-self: start;
  }

  .workspace-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .document-submit {
    justify-self: stretch;
  }
}

/* Finance monitoring cards */
.finance-page {
  max-width: 1320px;
}

.finance-page-header {
  background:
    radial-gradient(circle at 88% 18%, rgba(16, 185, 129, 0.18), transparent 30%),
    radial-gradient(circle at 72% 86%, rgba(59, 130, 246, 0.14), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #eef8ff 100%);
}

.finance-panel {
  margin-bottom: 16px;
  border: 1px solid rgba(8, 47, 99, 0.12);
}

.finance-upload-card {
  background:
    radial-gradient(circle at 92% 20%, rgba(56, 189, 248, 0.2), transparent 32%),
    linear-gradient(135deg, #eaf6ff 0%, #f7fbff 58%, #e7f5ff 100%);
  border-color: rgba(11, 114, 208, 0.22);
  box-shadow: 0 16px 34px rgba(11, 114, 208, 0.12);
}

.finance-report-card {
  background:
    radial-gradient(circle at 94% 12%, rgba(249, 115, 22, 0.14), transparent 30%),
    linear-gradient(135deg, #fffaf4 0%, #ffffff 54%, #fff2e6 100%);
  border-color: rgba(234, 88, 12, 0.18);
  box-shadow: 0 16px 34px rgba(194, 65, 12, 0.09);
}

.finance-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -4px 0 18px;
}

.finance-card-heading h2,
.finance-panel .finance-card-heading h2 {
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #073b73;
  font-size: 1.25rem;
}

.finance-card-kicker {
  color: #0b72d0;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.finance-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(8, 47, 99, 0.16);
}

.finance-card-icon .button-icon {
  width: 22px;
  height: 22px;
}

.finance-card-icon-blue {
  background: linear-gradient(135deg, #0b72d0, #0ea5e9);
}

.finance-card-icon-orange {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.finance-card-icon-green {
  background: linear-gradient(135deg, #10b981, #059669);
}

.finance-card-icon-purple {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
}

.finance-card-icon-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.finance-status-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(11, 114, 208, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: #075aa7;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: pre-line;
}

.finance-report-card input {
  background: rgba(255, 255, 255, 0.86);
}

.finance-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-metric-grid .finance-metric-card {
  min-height: 148px;
  padding: 22px;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(8, 47, 99, 0.16);
}

.finance-metric-grid .finance-metric-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -44px;
  width: 130px;
  height: 130px;
  border: 22px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.finance-metric-grid .finance-metric-card strong {
  font-size: clamp(1.45rem, 2vw, 2rem);
  overflow-wrap: anywhere;
}

.finance-metric-grid .finance-metric-days {
  --metric-bg: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
}

.finance-metric-grid .finance-metric-oil {
  --metric-bg: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}

.finance-metric-grid .finance-metric-water {
  --metric-bg: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
}

.finance-metric-grid .finance-metric-net {
  --metric-bg: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.finance-metric-grid .finance-metric-revenue {
  --metric-bg: linear-gradient(135deg, #059669 0%, #22c55e 100%);
}

.finance-metric-grid .finance-metric-partner {
  --metric-bg: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.finance-metric-grid .finance-metric-pertamina {
  --metric-bg: linear-gradient(135deg, #be123c 0%, #f43f5e 100%);
}

.finance-metric-grid .finance-metric-capex {
  --metric-bg: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
}

.finance-metric-grid .finance-metric-opex {
  --metric-bg: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
}

.finance-chart-card {
  min-height: 285px;
  padding-bottom: 22px;
}

.finance-chart-production {
  background: linear-gradient(145deg, #ffffff 0%, #edf7ff 100%);
  border-color: rgba(14, 165, 233, 0.2);
}

.finance-chart-revenue {
  background: linear-gradient(145deg, #ffffff 0%, #edfff7 100%);
  border-color: rgba(16, 185, 129, 0.2);
}

.finance-chart-card .chart-box {
  height: 190px;
  max-height: 190px;
  padding: 8px;
  border: 1px solid rgba(8, 47, 99, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
}

.finance-chart-card .chart-box canvas {
  height: 174px !important;
  max-height: 174px !important;
}

.finance-detail-card {
  background:
    linear-gradient(180deg, rgba(238, 242, 255, 0.9) 0%, #ffffff 30%);
  border-color: rgba(99, 102, 241, 0.18);
}

.finance-detail-card .table-wrap {
  border: 1px solid rgba(79, 70, 229, 0.12);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.07);
}

.finance-total-card {
  background:
    radial-gradient(circle at 92% 12%, rgba(245, 158, 11, 0.18), transparent 30%),
    linear-gradient(135deg, #fffdf5 0%, #fff7df 100%);
  border-color: rgba(217, 119, 6, 0.22);
  box-shadow: 0 16px 34px rgba(180, 83, 9, 0.1);
}

.finance-total-card .total-summary-table th {
  background: linear-gradient(135deg, #b45309, #d97706);
}

.finance-total-card .total-summary-table td {
  background: rgba(255, 255, 255, 0.82);
  color: #78350f;
  font-weight: 800;
}

@media (max-width: 980px) {
  .finance-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .finance-metric-grid {
    grid-template-columns: 1fr;
  }

  .finance-card-heading {
    align-items: flex-start;
  }
}

/* Final maintenance dashboard palette: light workspace, navy sidebar, colorful metrics. */
:root {
  --bg: #eaf1f7;
  --surface: #f6f9fc;
  --surface-soft: #eef5fb;
  --panel: #ffffff;
  --panel-muted: #f5f9fd;
  --panel-raised: #edf5fc;
  --text: #17233a;
  --text-dark: #082f63;
  --muted: #64748b;
  --line: rgba(8, 47, 99, 0.12);
  --primary: #0b72d0;
  --primary-dark: #064b8f;
  --accent: #f97316;
  --success: #0ea5c6;
}

body {
  background: linear-gradient(180deg, #f8fbfe 0%, #eef5fb 48%, #e5eef7 100%);
  color: var(--text);
}

.main-content,
.standalone-page {
  background: linear-gradient(180deg, #f8fbfe 0%, #edf4fa 100%);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(13, 148, 236, 0.12) 0%, transparent 38%),
    linear-gradient(180deg, #072e5f 0%, #075aa7 52%, #04356e 100%);
  color: #f8fbff;
  border-right-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 10px 0 28px rgba(7, 46, 95, 0.2);
}

.sidebar::before {
  opacity: 0.18;
}

.sidebar::after {
  background: linear-gradient(180deg, rgba(4, 53, 110, 0) 0%, rgba(2, 28, 66, 0.28) 100%);
}

.brand strong {
  color: #ffffff;
}

.brand small {
  color: #d8ecff;
}

.menu-scroll-controls button {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #f8fbff;
}

.menu-scroll-controls button:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.nav-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.12);
}

.nav-menu::-webkit-scrollbar-thumb {
  background: rgba(199, 226, 255, 0.74);
}

.nav-button,
.sidebar-links a {
  background: rgba(4, 33, 76, 0.34);
  border-color: rgba(207, 231, 255, 0.16);
  color: #eef7ff;
}

.nav-button:hover,
.sidebar-links a:hover {
  background: rgba(16, 120, 214, 0.42);
  border-color: rgba(219, 240, 255, 0.5);
  color: #ffffff;
}

.nav-button.is-active {
  background: linear-gradient(135deg, #1188e8 0%, #0b72d0 100%);
  border-color: rgba(255, 255, 255, 0.46);
  color: #ffffff;
  box-shadow: inset 4px 0 0 #38bdf8, 0 12px 24px rgba(3, 53, 110, 0.22);
}

.nav-button .button-icon {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.22);
  color: #d9efff;
}

.nav-button:hover .button-icon,
.nav-button.is-active .button-icon {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.42);
  color: #ffffff;
}

.top-status-bar {
  color: #334155;
}

.online-pill,
.top-status-bar time {
  background: #ffffff;
  border-color: rgba(8, 47, 99, 0.12);
  color: #082f63;
  box-shadow: 0 8px 20px rgba(8, 47, 99, 0.08);
}

.online-pill {
  color: #075aa7;
}

.online-pill span {
  background: #0ea5c6;
  box-shadow: 0 0 12px rgba(14, 165, 198, 0.62);
}

.page-header {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border-color: rgba(8, 47, 99, 0.12);
  box-shadow: 0 12px 28px rgba(8, 47, 99, 0.08);
}

.page-header h1,
#dashboard .ai-title-word,
#dashboard .integrated-title-word,
#dashboard .system-title-word {
  color: #073b73;
  text-shadow: none;
}

#dashboard .integrated-title-word {
  color: #075aa7;
}

#dashboard .system-title-word {
  color: #0a3f78;
}

.page-header .header-kicker,
.eyebrow {
  color: #334155;
}

.page-header p {
  color: #64748b;
}

.button-link,
.primary-button,
.ai-chat-form button,
.page-header .button-link {
  background: linear-gradient(135deg, #0b72d0 0%, #0b8edb 100%);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(11, 114, 208, 0.22);
}

.button-link:hover,
.primary-button:hover,
.page-header .button-link:hover {
  background: linear-gradient(135deg, #064b8f 0%, #0b72d0 100%);
}

.secondary-button,
.menu-scroll-controls button {
  border-color: rgba(8, 47, 99, 0.14);
}

.secondary-button {
  background: #ffffff;
  color: #073b73;
}

.secondary-button:hover {
  background: #edf6ff;
  border-color: rgba(11, 114, 208, 0.34);
}

.panel,
.workflow-list article,
.priority-list div,
.document-type-card,
.document-section,
.flow-step-card,
.workflow-stage-panel,
.workflow-download-card,
.workflow-progress-card,
.ai-panel {
  background: #ffffff;
  border-color: rgba(8, 47, 99, 0.12);
  color: #17233a;
  box-shadow: 0 12px 28px rgba(8, 47, 99, 0.08);
}

.panel:hover,
.workflow-list article:hover,
.priority-list div:hover,
.document-type-card:hover,
.document-type-card.is-active {
  background: #ffffff;
  border-color: rgba(11, 114, 208, 0.28);
}

.panel h2 {
  background: linear-gradient(90deg, #eef7ff 0%, #ffffff 100%);
  border-bottom-color: rgba(8, 47, 99, 0.1);
  color: #073b73;
}

.panel h3,
.workflow-list strong,
.document-type-card strong,
.document-section h3,
.flow-step-card strong,
.workflow-progress-head strong {
  color: #073b73;
}

.panel p,
.workflow-list span,
.priority-list div,
.document-type-card small,
.flow-step-card small,
.workflow-progress-head span,
.table-note {
  color: #64748b;
}

.metric-grid .metric-card,
#dashboard .metric-grid .metric-card {
  --metric-bg: linear-gradient(135deg, #0b72d0 0%, #0b8edb 100%);
  background: var(--metric-bg);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(8, 47, 99, 0.16);
}

.metric-grid .metric-card:hover,
#dashboard .metric-grid .metric-card:hover {
  background: var(--metric-bg);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 18px 34px rgba(8, 47, 99, 0.22);
}

.metric-grid .metric-card:nth-child(1) {
  --metric-bg: linear-gradient(135deg, #0b72d0 0%, #1193e6 100%);
}

.metric-grid .metric-card:nth-child(2) {
  --metric-bg: linear-gradient(135deg, #0a69c7 0%, #1579db 100%);
}

.metric-grid .metric-card:nth-child(3) {
  --metric-bg: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.metric-grid .metric-card:nth-child(4) {
  --metric-bg: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
}

.metric-grid .metric-card:nth-child(5) {
  --metric-bg: linear-gradient(135deg, #315eea 0%, #4f46e5 100%);
}

.metric-grid .metric-card:nth-child(6) {
  --metric-bg: linear-gradient(135deg, #0ea5c6 0%, #0284c7 100%);
}

.metric-grid .metric-card span,
.metric-grid .metric-card strong,
.metric-grid .metric-card small,
#dashboard .metric-card span,
#dashboard .metric-card strong,
#dashboard .metric-card small {
  color: #ffffff;
}

.metric-grid .metric-card small {
  opacity: 0.92;
}

.document-flow-panel,
.document-flow-node,
.workflow-stage-tab,
.document-flow-node.is-active,
.workflow-stage-tab.is-active,
.workflow-download-card-latest,
.status-box,
.workspace-row,
.workspace-meta,
.workspace-head span,
.workspace-row em,
.workspace-ai-action {
  background: #f7fbff;
  border-color: rgba(11, 114, 208, 0.16);
  color: #17233a;
}

.document-flow-node strong,
.workflow-stage-tab,
.workspace-row strong,
.workspace-meta strong,
#dashboard .workspace-row strong,
#dashboard .workspace-meta strong {
  color: #073b73;
}

.document-flow-node small,
.workflow-stage-tab span,
.workspace-row small,
#dashboard .workspace-row small {
  color: #64748b;
}

.workspace-meta span,
.document-next-code,
.workflow-progress-head span,
#dashboard .workspace-meta span {
  color: #0b72d0;
}

.workspace-head span,
.workspace-row em,
.workspace-ai-action,
#dashboard .workspace-head span,
#dashboard .workspace-row em,
#dashboard .workspace-ai-action {
  background: #eaf5ff;
  border-color: rgba(11, 114, 208, 0.2);
  color: #075aa7;
}

#dashboard .workspace-row,
#dashboard .workspace-row > div:first-child,
#dashboard .workspace-meta,
#dashboard .workspace-ai-action,
#dashboard .workspace-row em,
#dashboard .workspace-head span {
  background: #f7fbff;
  border-color: rgba(11, 114, 208, 0.16);
  color: #17233a;
  box-shadow: inset 3px 0 0 #0b72d0;
}

#dashboard .workspace-row:hover {
  border-color: rgba(11, 114, 208, 0.3);
  box-shadow: inset 3px 0 0 #0b72d0, 0 14px 28px rgba(8, 47, 99, 0.1);
}

.table-wrap,
pre,
input,
textarea,
select {
  background: #ffffff;
  border-color: rgba(8, 47, 99, 0.14);
  color: #17233a;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(11, 114, 208, 0.82);
  box-shadow: 0 0 0 3px rgba(11, 114, 208, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

th,
.total-summary-table th {
  background: #073b73;
  color: #ffffff;
}

td,
tr:nth-child(even) td,
.total-summary-table td {
  background: #ffffff;
  color: #17233a;
}

tr:nth-child(even) td {
  background: #f3f8fd;
}

tr:hover td {
  background: #eaf5ff;
}

.flash-message {
  background: #ffffff;
  color: #17233a;
  border-color: rgba(11, 114, 208, 0.26);
  box-shadow: 0 12px 28px rgba(8, 47, 99, 0.1);
}

.ai-panel header,
.ai-chat-log p {
  background: #f3f8fd;
  color: #17233a;
  border-color: rgba(8, 47, 99, 0.1);
}

.ai-panel header button {
  color: #073b73;
}

/* HPU-focused dashboard */
html {
  scroll-behavior: smooth;
}

.hpu-sidebar {
  gap: 20px;
}

.hpu-sidebar .nav-menu {
  max-height: none;
}

.hpu-nav-menu .nav-section-label {
  margin: 10px 4px 0;
  color: #b9dcfb;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hpu-main {
  min-width: 0;
}

.hpu-page-header {
  align-items: center;
  background:
    radial-gradient(circle at 86% 18%, rgba(14, 165, 198, 0.14), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #eef7ff 100%);
}

.hpu-page-header h1 {
  color: #073b73;
}

.hpu-header-badge,
.chart-data-note {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(11, 114, 208, 0.18);
  border-radius: 999px;
  background: #eaf5ff;
  color: #075aa7;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.hpu-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.78fr);
  gap: 16px;
  margin-bottom: 16px;
}

.hpu-chart-panel-hero,
.hpu-status-panel {
  min-height: 430px;
}

.hpu-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.hpu-panel-heading h2 {
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #073b73;
  font-size: 1.3rem;
}

.panel-kicker {
  color: #0b72d0;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hpu-chart-box-hero,
.hpu-chart-box-hero canvas {
  height: 340px !important;
  max-height: 340px !important;
}

.hpu-status-panel {
  display: flex;
  flex-direction: column;
}

.hpu-status-indicator {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  padding: 9px 13px;
  border: 1px solid rgba(100, 116, 139, 0.2);
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}

.hpu-status-indicator span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px rgba(100, 116, 139, 0.12);
}

.hpu-status-indicator.status-stable {
  border-color: rgba(5, 150, 105, 0.2);
  background: #ecfdf5;
  color: #047857;
}

.hpu-status-indicator.status-warning {
  border-color: rgba(217, 119, 6, 0.22);
  background: #fffbeb;
  color: #b45309;
}

.hpu-status-indicator.status-critical {
  border-color: rgba(220, 38, 38, 0.2);
  background: #fef2f2;
  color: #b91c1c;
}

.hpu-status-message {
  min-height: 46px;
  margin: 16px 0;
  color: #64748b;
  line-height: 1.55;
}

.hpu-ai-summary {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid rgba(11, 114, 208, 0.14);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eef7ff, #f8fbff);
}

.hpu-ai-summary span {
  color: #0b72d0;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hpu-ai-summary strong {
  color: #073b73;
  line-height: 1.4;
}

.hpu-quick-stats {
  display: grid;
  gap: 0;
  margin: auto 0 0;
}

.hpu-quick-stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(8, 47, 99, 0.1);
}

.hpu-quick-stats div:last-child {
  border-bottom: 0;
}

.hpu-quick-stats dt {
  color: #64748b;
}

.hpu-quick-stats dd {
  margin: 0;
  color: #073b73;
  font-weight: 800;
}

.hpu-metric-grid {
  margin-bottom: 16px;
}

.hpu-detail-grid {
  align-items: start;
}

#hpu-input,
#hpu-summary {
  scroll-margin-top: 20px;
}

@media (max-width: 1180px) {
  .hpu-hero-grid {
    grid-template-columns: 1fr;
  }

  .hpu-status-panel {
    min-height: auto;
  }

  .hpu-quick-stats {
    margin-top: 18px;
  }
}

@media (max-width: 980px) {
  .hpu-nav-menu .nav-section-label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .hpu-panel-heading {
    display: grid;
  }

  .chart-data-note {
    justify-self: start;
  }

  .hpu-chart-panel-hero {
    min-height: auto;
  }

  .hpu-chart-box-hero,
  .hpu-chart-box-hero canvas {
    height: 260px !important;
    max-height: 260px !important;
  }
}

/* Keep finance colors above the global maintenance palette. */
.finance-page .finance-page-header {
  background:
    radial-gradient(circle at 88% 18%, rgba(16, 185, 129, 0.18), transparent 30%),
    radial-gradient(circle at 72% 86%, rgba(59, 130, 246, 0.14), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #eef8ff 100%);
}

.finance-page .panel.finance-upload-card {
  background:
    radial-gradient(circle at 92% 20%, rgba(56, 189, 248, 0.2), transparent 32%),
    linear-gradient(135deg, #eaf6ff 0%, #f7fbff 58%, #e7f5ff 100%);
  border-color: rgba(11, 114, 208, 0.22);
  box-shadow: 0 16px 34px rgba(11, 114, 208, 0.12);
}

.finance-page .panel.finance-report-card {
  background:
    radial-gradient(circle at 94% 12%, rgba(249, 115, 22, 0.14), transparent 30%),
    linear-gradient(135deg, #fffaf4 0%, #ffffff 54%, #fff2e6 100%);
  border-color: rgba(234, 88, 12, 0.18);
  box-shadow: 0 16px 34px rgba(194, 65, 12, 0.09);
}

.metric-grid.finance-metric-grid .metric-card.finance-metric-days {
  --metric-bg: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
}

.metric-grid.finance-metric-grid .metric-card.finance-metric-oil {
  --metric-bg: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}

.metric-grid.finance-metric-grid .metric-card.finance-metric-water {
  --metric-bg: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
}

.metric-grid.finance-metric-grid .metric-card.finance-metric-net {
  --metric-bg: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.metric-grid.finance-metric-grid .metric-card.finance-metric-revenue {
  --metric-bg: linear-gradient(135deg, #059669 0%, #22c55e 100%);
}

.metric-grid.finance-metric-grid .metric-card.finance-metric-partner {
  --metric-bg: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.metric-grid.finance-metric-grid .metric-card.finance-metric-pertamina {
  --metric-bg: linear-gradient(135deg, #be123c 0%, #f43f5e 100%);
}

.metric-grid.finance-metric-grid .metric-card.finance-metric-capex {
  --metric-bg: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
}

.metric-grid.finance-metric-grid .metric-card.finance-metric-opex {
  --metric-bg: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
}

.finance-page .panel.finance-chart-production {
  background: linear-gradient(145deg, #ffffff 0%, #edf7ff 100%);
  border-color: rgba(14, 165, 233, 0.2);
}

.finance-page .panel.finance-chart-revenue {
  background: linear-gradient(145deg, #ffffff 0%, #edfff7 100%);
  border-color: rgba(16, 185, 129, 0.2);
}

.finance-page .panel.finance-detail-card {
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.9) 0%, #ffffff 30%);
  border-color: rgba(99, 102, 241, 0.18);
}

.finance-page .panel.finance-total-card {
  background:
    radial-gradient(circle at 92% 12%, rgba(245, 158, 11, 0.18), transparent 30%),
    linear-gradient(135deg, #fffdf5 0%, #fff7df 100%);
  border-color: rgba(217, 119, 6, 0.22);
  box-shadow: 0 16px 34px rgba(180, 83, 9, 0.1);
}

.metric-grid.finance-grid.finance-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hpu-page-header > div:first-child {
  min-width: 0;
  flex: 1;
}

.hpu-page-header .hpu-ai-title {
  display: block;
  max-width: 850px;
  margin: 6px 0 12px;
  color: #073b73;
  font-size: clamp(2rem, 4vw, 3.65rem);
  font-weight: 400;
  line-height: 1.05;
}

.hpu-ai-title-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.hpu-ai-word,
.hpu-integrated-word {
  color: #075aa7;
  font-size: clamp(2rem, 4vw, 3.65rem);
  font-weight: 950;
  letter-spacing: -0.04em;
}

.hpu-ai-word {
  color: #0b72d0;
}

.hpu-integrated-word {
  color: #073b73;
}

.hpu-system-title {
  color: #0f5f9f;
  font-size: clamp(1.55rem, 3.1vw, 2.85rem);
  font-weight: 900;
  letter-spacing: 0.015em;
}

.hpu-page-header .hpu-title-tagline {
  margin: 2px 0 0;
  color: #3d668a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.96rem, 1.5vw, 1.2rem);
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.035em;
}

@media (max-width: 980px) {
  .metric-grid.finance-grid.finance-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .metric-grid.finance-grid.finance-metric-grid {
    grid-template-columns: 1fr;
  }

  .hpu-page-header .hpu-ai-title {
    gap: 5px;
  }

  .hpu-ai-title-top {
    gap: 8px;
  }

  .hpu-ai-word,
  .hpu-integrated-word {
    font-size: clamp(1.65rem, 9vw, 2.25rem);
  }

  .hpu-system-title {
    max-width: 12ch;
    font-size: clamp(1.45rem, 7.8vw, 2rem);
    line-height: 1.05;
  }
}

/* Separate HPU input page and dashboard finance chart */
.hpu-finance-panel {
  margin-bottom: 16px;
  background:
    radial-gradient(circle at 92% 16%, rgba(16, 185, 129, 0.14), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #effcf7 100%);
  border-color: rgba(16, 185, 129, 0.2);
}

.hpu-finance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hpu-finance-summary article {
  display: grid;
  gap: 7px;
  padding: 14px 16px;
  border: 1px solid rgba(16, 185, 129, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(5, 150, 105, 0.07);
}

.hpu-finance-summary article:nth-child(2) {
  border-color: rgba(249, 115, 22, 0.18);
}

.hpu-finance-summary article:nth-child(3) {
  border-color: rgba(225, 29, 72, 0.16);
}

.hpu-finance-summary span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.hpu-finance-summary strong {
  color: #047857;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  overflow-wrap: anywhere;
}

.hpu-finance-summary article:nth-child(2) strong {
  color: #c2410c;
}

.hpu-finance-summary article:nth-child(3) strong {
  color: #be123c;
}

.hpu-finance-chart-box,
.hpu-finance-chart-box canvas {
  width: 100% !important;
  height: 320px !important;
  max-height: 320px !important;
}

.hpu-finance-chart-box {
  position: relative;
  padding: 10px;
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.bpe-target-page {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  align-content: start;
}

.bpe-target-page .top-status-bar {
  display: none;
}

.bpe-target-header {
  align-items: center;
  min-height: 62px;
  padding: 10px 16px;
  margin-bottom: 0;
}

.bpe-target-header h1 {
  margin: 0 0 3px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.bpe-target-header p {
  font-size: 0.9rem;
}

.bpe-target-badge,
.bpe-target-chart-note {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef6ff;
  color: #0f4c81;
  border: 1px solid rgba(15, 76, 129, 0.18);
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.bpe-target-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.bpe-target-kpi {
  min-height: 104px;
  padding: 14px 16px;
  gap: 5px;
  overflow: hidden;
  border: 0;
  border-top: 0;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.14);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.bpe-target-kpi::before {
  display: none;
}

.bpe-target-kpi:nth-child(1) {
  background: linear-gradient(135deg, #1e3a5f, #2f5f8f);
}

.bpe-target-kpi:nth-child(2) {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.bpe-target-kpi:nth-child(3) {
  background: linear-gradient(135deg, #b45309, #f59e0b);
}

.bpe-target-kpi:nth-child(4) {
  background: linear-gradient(135deg, #5b4b8a, #7c6db0);
}

.bpe-target-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.18);
}

.bpe-target-kpi span,
.bpe-target-kpi small {
  color: rgba(255, 255, 255, 0.82);
}

.bpe-target-kpi strong {
  color: #ffffff;
  font-size: clamp(1.18rem, 1.8vw, 1.65rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-shadow: none;
}

.bpe-target-progress-card {
  align-content: start;
}

.bpe-target-progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.bpe-target-progress-track span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: #ffffff;
}

.bpe-target-chart-panel {
  align-self: start;
  padding: 14px;
}

.bpe-target-chart-panel .hpu-panel-heading {
  margin-bottom: 8px;
}

.bpe-target-chart-panel .hpu-panel-heading h2 {
  font-size: 1.08rem;
}

.bpe-target-empty-note {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: #fff7ed;
  border: 1px solid rgba(245, 158, 11, 0.24);
  color: #9a3412;
  font-size: 0.88rem;
  font-weight: 800;
}

.bpe-target-chart-box {
  position: relative;
  width: 100%;
  height: 330px;
  max-height: 330px;
  overflow: hidden;
  min-height: 0;
  padding: 8px;
  border: 1px solid rgba(15, 76, 129, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.bpe-target-chart-box canvas {
  width: 100% !important;
  height: 312px !important;
  max-height: 312px !important;
}

.bpe-target-detail-panel {
  margin-top: 8px;
}

.bpe-target-detail-panel summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 12px;
  border-radius: var(--radius);
  background: #eef6ff;
  border: 1px solid rgba(15, 76, 129, 0.18);
  color: #0f4c81;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
  list-style: none;
}

.bpe-target-detail-panel summary::-webkit-details-marker {
  display: none;
}

.bpe-target-detail-panel[open] summary {
  margin-bottom: 10px;
}

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

.bpe-target-table-wrap table {
  min-width: 760px;
}

.bpe-target-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.bpe-target-status.status-no-data {
  background: #e2e8f0;
  color: #475569;
}

.bpe-target-status.status-below {
  background: #fee2e2;
  color: #b91c1c;
}

.bpe-target-status.status-on {
  background: #dbeafe;
  color: #1d4ed8;
}

.bpe-target-status.status-above {
  background: #dcfce7;
  color: #15803d;
}

@media (max-width: 1180px) {
  .bpe-target-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .bpe-target-header,
  .bpe-target-kpi-grid,
  .bpe-target-page .hpu-panel-heading {
    display: grid;
    grid-template-columns: 1fr;
  }

  .bpe-target-chart-box,
  .bpe-target-chart-box canvas {
    height: 300px !important;
    max-height: 300px !important;
  }
}

.hpu-summary-panel {
  margin-bottom: 16px;
}

.hpu-input-header {
  align-items: center;
  background:
    radial-gradient(circle at 88% 20%, rgba(249, 115, 22, 0.14), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
}

.hpu-input-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}

.hpu-input-card {
  background:
    radial-gradient(circle at 92% 12%, rgba(14, 165, 233, 0.12), transparent 30%),
    linear-gradient(145deg, #ffffff 0%, #eef8ff 100%);
  border-color: rgba(14, 165, 233, 0.2);
}

.hpu-input-form .primary-button {
  margin-top: 4px;
}

.hpu-input-result-card {
  background:
    radial-gradient(circle at 92% 12%, rgba(124, 58, 237, 0.12), transparent 30%),
    linear-gradient(145deg, #ffffff 0%, #f5f3ff 100%);
  border-color: rgba(124, 58, 237, 0.18);
}

.hpu-input-result-card .hpu-panel-heading {
  align-items: center;
}

.hpu-input-result-card .hpu-status-indicator {
  flex: 0 0 auto;
}

.hpu-input-result-grid {
  margin-bottom: 16px;
}

.hpu-input-result-grid .metric-card {
  min-height: 118px;
}

@media (max-width: 980px) {
  .hpu-input-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hpu-finance-summary {
    grid-template-columns: 1fr;
  }

  .hpu-finance-chart-box,
  .hpu-finance-chart-box canvas {
    height: 250px !important;
    max-height: 250px !important;
  }

  .hpu-input-result-card .hpu-panel-heading {
    display: grid;
  }
}

/* API-ready 2D Haiwell HMI monitoring */
.hmi-monitor-panel {
  margin-bottom: 16px;
  padding: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 8%, rgba(14, 165, 233, 0.16), transparent 28%),
    linear-gradient(145deg, #061a34 0%, #08294d 54%, #061a34 100%);
  border-color: rgba(56, 189, 248, 0.32);
  box-shadow: 0 18px 38px rgba(2, 24, 50, 0.22);
}

.hmi-monitor-panel:hover {
  background:
    radial-gradient(circle at 88% 8%, rgba(14, 165, 233, 0.2), transparent 30%),
    linear-gradient(145deg, #061a34 0%, #08294d 54%, #061a34 100%);
}

.hmi-monitor-heading {
  align-items: center;
}

.hmi-monitor-heading h2,
.hmi-monitor-panel .hmi-monitor-heading h2 {
  color: #f8fbff;
}

.hmi-monitor-heading p {
  max-width: 720px;
  margin: 7px 0 0;
  color: #b9d8f2;
  line-height: 1.5;
}

.hmi-monitor-panel .panel-kicker {
  color: #38bdf8;
}

.hmi-connection-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hmi-mode-badge,
.hmi-api-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.hmi-mode-badge {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.36);
  color: #fbbf24;
}

.hmi-api-badge {
  gap: 8px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.hmi-api-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.hmi-visual-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 12px;
  background: #03152b;
  box-shadow:
    inset 0 0 42px rgba(14, 165, 233, 0.08),
    0 16px 30px rgba(0, 0, 0, 0.24);
}

.hmi-monitor-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(250px, 3fr);
  gap: 14px;
  align-items: stretch;
}

.hmi-production-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hmi-production-metrics .metric-card {
  min-height: 0;
  align-content: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
}

.hmi-production-metrics .metric-card strong {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.hmi-production-metrics .metric-card small {
  line-height: 1.35;
}

.hmi-monitor-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hmi-live-values {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hmi-value-card {
  position: absolute;
  z-index: 2;
  display: grid;
  min-width: 112px;
  padding: 9px 11px;
  border: 1px solid rgba(125, 211, 252, 0.34);
  border-radius: 8px;
  background: rgba(3, 21, 43, 0.88);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(5px);
}

.hmi-value-card span {
  color: #9fc9e8;
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hmi-value-card strong {
  margin-top: 2px;
  color: #4ade80;
  font-size: clamp(1rem, 1.7vw, 1.42rem);
  line-height: 1.05;
}

.hmi-value-card small {
  margin-top: 2px;
  color: #e0f2fe;
  font-size: 0.65rem;
  font-weight: 700;
}

.hmi-value-motor {
  left: 4%;
  top: 39%;
}

.hmi-value-discharge {
  left: 31%;
  top: 18%;
}

.hmi-value-oil {
  left: 39%;
  bottom: 12%;
}

.hmi-value-status {
  right: 9%;
  top: 12%;
}

.hmi-value-status strong {
  color: #22c55e;
  font-size: clamp(0.86rem, 1.4vw, 1.15rem);
}

.hmi-value-wellhead {
  right: 13%;
  bottom: 18%;
}

.hmi-value-flowline {
  right: 2.5%;
  bottom: 11%;
}

.hmi-integration-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 9px;
  background: rgba(8, 41, 77, 0.72);
  color: #c5e3f8;
  font-size: 0.84rem;
  line-height: 1.45;
}

.hmi-integration-note strong {
  color: #7dd3fc;
}

.hmi-note-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.72);
}

@media (max-width: 980px) {
  .hmi-monitor-layout {
    grid-template-columns: 1fr;
  }

  .hmi-visual-stage {
    aspect-ratio: auto;
    overflow: visible;
  }

  .hmi-monitor-image {
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
  }

  .hmi-live-values {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }

  .hmi-value-card {
    position: static;
    min-width: 0;
    transform: none;
  }

  .hmi-production-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hmi-monitor-panel {
    padding: 16px;
  }

  .hmi-monitor-heading {
    display: grid;
  }

  .hmi-connection-badges {
    justify-content: flex-start;
  }

  .hmi-live-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hmi-production-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hmi-integration-note {
    align-items: flex-start;
  }
}

/* Light presentation for the realtime HMI section. */
.panel.hmi-monitor-panel,
.panel.hmi-monitor-panel:hover {
  background:
    radial-gradient(circle at 91% 7%, rgba(14, 165, 233, 0.12), transparent 26%),
    radial-gradient(circle at 8% 94%, rgba(37, 99, 235, 0.07), transparent 25%),
    linear-gradient(145deg, #ffffff 0%, #f7fbff 100%);
  border-color: rgba(11, 114, 208, 0.2);
  box-shadow:
    0 18px 38px rgba(8, 47, 99, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hmi-monitor-panel .hmi-monitor-heading h2 {
  color: #073b73;
}

.hmi-monitor-panel .hmi-monitor-heading p {
  color: #64748b;
}

.hmi-monitor-panel .panel-kicker {
  color: #0b72d0;
}

.hmi-monitor-panel .hmi-mode-badge {
  background: #fff7e8;
  border-color: rgba(217, 119, 6, 0.28);
  color: #b45309;
}

.hmi-monitor-panel .hmi-api-badge {
  background: #eef5fb;
  border-color: rgba(100, 116, 139, 0.22);
  color: #475569;
}

.hmi-production-metrics .metric-card {
  box-shadow: 0 12px 24px rgba(8, 47, 99, 0.14);
}

.hmi-monitor-panel .hmi-integration-note {
  background: #eef7ff;
  border-color: rgba(11, 114, 208, 0.16);
  color: #475569;
}

.hmi-monitor-panel .hmi-integration-note strong {
  color: #075aa7;
}

.hmi-production-metrics .metric-card {
  --metric-bg: linear-gradient(135deg, #0b72d0 0%, #1597e5 100%);
  background: var(--metric-bg);
  border-color: rgba(255, 255, 255, 0.34);
  color: #ffffff;
}

.hmi-production-metrics .metric-card:nth-child(2) {
  --metric-bg: linear-gradient(135deg, #075aa7 0%, #0ea5e9 100%);
}

.hmi-production-metrics .metric-card:nth-child(3) {
  --metric-bg: linear-gradient(135deg, #2563eb 0%, #168bd2 100%);
}

.hmi-production-metrics .metric-card:nth-child(4) {
  --metric-bg: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
}

.hmi-production-metrics .metric-card:hover {
  background: var(--metric-bg);
  border-color: rgba(255, 255, 255, 0.52);
}

.hmi-production-metrics .metric-card span,
.hmi-production-metrics .metric-card strong,
.hmi-production-metrics .metric-card small {
  color: #ffffff;
}

.hmi-monitor-panel .hmi-production-metrics > .hmi-metric-blue-1 {
  background: linear-gradient(135deg, #0b72d0 0%, #22a7f0 100%) !important;
  background-color: #0b72d0 !important;
}

.hmi-monitor-panel .hmi-production-metrics > .hmi-metric-blue-2 {
  background: linear-gradient(135deg, #075aa7 0%, #0ea5e9 100%) !important;
  background-color: #075aa7 !important;
}

.hmi-monitor-panel .hmi-production-metrics > .hmi-metric-blue-3 {
  background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%) !important;
  background-color: #2563eb !important;
}

.hmi-monitor-panel .hmi-production-metrics > .hmi-metric-blue-4 {
  background: linear-gradient(135deg, #1d4ed8 0%, #60a5fa 100%) !important;
  background-color: #1d4ed8 !important;
}

.hmi-monitor-panel .hmi-production-metrics > .metric-card:hover {
  filter: brightness(1.06);
}

/* Integrated AI BPE layout guard */
.ai-bpe-page {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

.ai-bpe-page .ai-bpe-root {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.ai-bpe-page .ai-bpe-root > .ai-bpe-app {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-sidebar {
  position: relative;
  top: auto;
  align-self: stretch;
  width: 100%;
  max-width: 250px;
  flex: 0 0 250px;
  height: auto;
  min-height: 100vh;
  max-height: none;
  gap: 18px;
  padding: 22px 16px;
  overflow: visible;
}

.ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-sidebar .brand {
  min-width: 0;
  gap: 10px;
}

.ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-sidebar .brand-logo {
  width: 84px;
  max-width: 42%;
  max-height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
}

.ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-sidebar .brand > div {
  min-width: 0;
}

.ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-sidebar .brand strong {
  font-size: 0.98rem;
  line-height: 1.15;
}

.ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-sidebar .brand small {
  font-size: 0.78rem;
  line-height: 1.2;
}

.ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-sidebar .nav-menu {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 22px;
  overflow: visible;
}

.ai-bpe-page .ai-bpe-root > .ai-bpe-app .top-status-bar,
.ai-bpe-page .ai-bpe-root > .ai-bpe-app .page-header,
.ai-bpe-page .ai-bpe-root > .ai-bpe-app .panel,
.ai-bpe-page .ai-bpe-root > .ai-bpe-app .hmi-monitor-layout,
.ai-bpe-page .ai-bpe-root > .ai-bpe-app .hmi-visual-stage {
  max-width: 100%;
}

.ai-bpe-page .ai-bpe-root > .ai-bpe-app .hpu-ai-word,
.ai-bpe-page .ai-bpe-root > .ai-bpe-app .hpu-integrated-word,
.ai-bpe-page .ai-bpe-root > .ai-bpe-app .hpu-system-title {
  letter-spacing: 0;
}

@media (max-width: 980px) {
  .ai-bpe-page .ai-bpe-root > .ai-bpe-app {
    display: flex;
    flex-direction: column;
  }

  .ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-sidebar {
    max-width: none;
    flex: 0 0 auto;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }

  .ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-sidebar .nav-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-sidebar,
  .ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-main {
    padding: 18px;
  }

  .ai-bpe-page .ai-bpe-root > .ai-bpe-app > .hpu-sidebar .nav-menu {
    grid-template-columns: 1fr;
  }
}
