:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #667085;
  --line: #d9e2ef;
  --paper: #ffffff;
  --soft: #f4f7fb;
  --blue: #1a56b0;
  --teal: #0f766e;
  --green: #15803d;
  --amber: #f59e0b;
  --red: #dc2626;
  --violet: #6d28d9;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef3f8;
  color: var(--ink);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  background: #f4f7fc;
}

.login-panel {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  color: #fff;
  background: #0d1b3e;
}

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

.brand-row img,
.top-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 6px;
}

.login-panel .brand-row img {
  width: 46px;
  height: 46px;
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle {
  font-size: 13px;
  opacity: 0.8;
}

.login-panel h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0;
}

.login-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.login-system-card {
  max-width: 560px;
  display: grid;
  gap: 18px;
}

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

.login-assurance span {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 10px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 800;
}

.login-card {
  align-self: center;
  justify-self: center;
  width: min(440px, calc(100vw - 48px));
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

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

.login-card-head {
  display: grid;
  gap: 5px;
  margin-bottom: 20px;
}

.login-card-head span,
.login-note {
  color: var(--muted);
  font-size: 12px;
}

.login-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

.primary-btn,
.ghost-btn,
.tab-btn {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 9px 13px;
  font-weight: 800;
}

.hero-link,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 38px;
  border-radius: 6px;
  padding: 9px 13px;
  font-weight: 800;
  text-decoration: none;
}

.hero-link {
  background: #ffffff;
  color: var(--blue);
}

.ghost-link {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.primary-btn {
  background: var(--blue);
  color: #fff;
}

.mini-btn {
  min-height: 28px;
  border: 0;
  border-radius: 5px;
  padding: 5px 8px;
  margin-top: 6px;
  background: #eaf1fb;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.mini-btn.danger {
  background: #fee2e2;
  color: var(--red);
}

.mini-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ghost-btn {
  background: #eaf1fb;
  color: var(--blue);
}

.error {
  color: var(--red);
  min-height: 20px;
  font-size: 13px;
}

.status-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.status-message.success {
  color: var(--green);
}

.demo-grid {
  margin-top: 16px;
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
}

.demo-account {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 9px;
  display: grid;
  gap: 3px;
  font-size: 12px;
  text-align: left;
}

.demo-account strong {
  color: var(--ink);
}

.public-inquiry {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.public-inquiry h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.public-inquiry form {
  display: grid;
  gap: 10px;
}

.public-inquiry .field {
  margin-bottom: 0;
}

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

.sidebar {
  background: #0d1b3e;
  color: #fff;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.top-brand img {
  width: 46px;
  height: 46px;
}

.profile-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 7px;
}

.profile-chip strong {
  font-size: 14px;
}

.profile-chip span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  text-align: left;
  padding: 8px 10px;
  font-weight: 800;
}

.nav button.active,
.nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

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

.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

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

.content {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.panel-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel-body {
  padding: 18px;
}

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

.grid.metrics {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.metric {
  padding: 15px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 98px;
}

.metric label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 9px;
  font-size: 24px;
  letter-spacing: 0;
}

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

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

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

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.module-card strong {
  font-size: 18px;
  line-height: 1.2;
}

.quick-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.control-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}

.control-form .field {
  margin: 0;
}

.control-form .primary-btn {
  min-height: 42px;
}

.quick-form input,
.quick-form select {
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

.settlement-action {
  margin-bottom: 12px;
}

.stream-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.stream-card img {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.stream-card h3 {
  margin: 0;
  font-size: 15px;
}

.stream-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.country {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.country img {
  width: 78px;
  height: 52px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--line);
}

.country h3 {
  margin: 0;
  font-size: 15px;
}

.country p {
  margin: 3px 0;
  color: var(--muted);
  font-size: 12px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  background: #0d1b3e;
  color: #fff;
  font-weight: 800;
}

td.num,
th.num {
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eaf1fb;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.badge.green {
  background: #dcfce7;
  color: var(--green);
}

.badge.amber {
  background: #fff7ed;
  color: #b45309;
}

.badge.red {
  background: #fee2e2;
  color: var(--red);
}

.mini-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 360px;
}

.controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
}

.controls .field {
  min-width: 180px;
  margin: 0;
}

.chart {
  height: 280px;
  display: grid;
  align-items: end;
  grid-template-columns: repeat(9, minmax(34px, 1fr));
  gap: 10px;
  padding-top: 8px;
}

.bar {
  min-height: 3px;
  background: var(--blue);
  border-radius: 5px 5px 0 0;
  position: relative;
}

.bar:nth-child(2n) {
  background: var(--teal);
}

.bar:nth-child(3n) {
  background: var(--amber);
}

.bar span {
  position: absolute;
  left: 50%;
  bottom: -35px;
  transform: translateX(-50%);
  width: 82px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.policy-list {
  display: grid;
  gap: 10px;
}

.policy-item {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.policy-item strong {
  color: var(--ink);
}

.policy-item span {
  color: var(--muted);
  line-height: 1.5;
}

.footer-note {
  padding: 12px 16px;
  color: var(--muted);
  font-size: 12px;
}

.source-lock-panel .panel-body {
  padding: 12px 16px;
}

.source-rule {
  color: #4a5568;
  font-size: 13px;
  font-weight: 700;
}

/* Command-centre recreation based on the reviewed reference file. */
body:has(.layout) {
  overflow: hidden;
  background: #f4f7fc;
}

.layout {
  display: flex;
  height: 100vh;
  min-height: 100vh;
  background: #f4f7fc;
}

.sidebar {
  width: 220px;
  flex: 0 0 220px;
  height: 100vh;
  padding: 0;
  gap: 0;
  background: #0d1b3e;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.sidebar-logo {
  width: 100%;
  min-height: 66px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
}

.sidebar-logo img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  padding: 4px;
}

.sidebar-logo .brand-title {
  font-size: 13px;
  letter-spacing: 1px;
}

.sidebar-logo .brand-subtitle {
  font-size: 10px;
  color: #8899bb;
  opacity: 1;
}

.nav {
  flex: 1;
  display: block;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-section {
  padding: 6px 0;
}

.sidebar-label {
  padding: 6px 18px 5px;
  color: #8899bb;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  border-radius: 0;
  padding: 8px 14px 8px 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.nav button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}

.nav button.active,
.nav button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav button.active::before {
  background: #f0a500;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #f0a500;
  font-size: 11px;
  font-weight: 900;
}

.nav-badge {
  margin-left: auto;
  min-width: 28px;
  border-radius: 999px;
  padding: 2px 6px;
  background: #f0a500;
  color: #0d1b3e;
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

.profile-chip {
  margin: 10px 12px 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1a56b0, #008b9a);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ghost-link,
.sidebar .ghost-btn {
  width: calc(100% - 24px);
  margin: 0 12px 10px;
}

.main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  min-height: 72px;
  height: auto;
  padding: 0 20px;
  gap: 12px;
  border-bottom: 1px solid #e8edf5;
  background: rgba(255, 255, 255, 0.96);
  position: static;
  flex-wrap: wrap;
}

.topbar h1 {
  font-size: 16px;
  font-weight: 900;
}

.topbar small {
  font-size: 11px;
}

.topbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid #e8edf5;
  border-radius: 999px;
  padding: 5px 10px;
  color: #4a5568;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-green {
  background: #1b6b3a;
}

.dot-gold {
  background: #f0a500;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 230px;
  min-height: 34px;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  padding: 0 10px;
  background: #f8fafc;
  color: #8899bb;
  font-size: 11px;
  font-weight: 800;
}

.search-bar input {
  min-height: 30px;
  border: 0;
  background: transparent;
  outline: 0;
  padding: 0;
}

.content {
  height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 20px 24px 24px;
}

.summary-strip {
  display: flex;
  align-items: center;
  min-height: 76px;
  border: 1px solid #e8edf5;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 4px 24px rgba(13, 27, 62, 0.08);
  overflow: visible;
}

.strip-item {
  flex: 1 1 0;
  min-height: 74px;
  padding: 13px 16px;
}

.strip-label {
  color: #8899bb;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.strip-val {
  margin-top: 7px;
  color: #0d1b3e;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 18px;
  font-weight: 900;
}

.strip-val.gold {
  color: #f0a500;
}

.strip-sep {
  width: 1px;
  height: 42px;
  background: #e8edf5;
  justify-self: start;
  margin-left: -1px;
}

.grid.metrics {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.metric {
  min-height: 116px;
  border-radius: 10px;
  border-color: #e8edf5;
  background: #ffffff;
  box-shadow: 0 4px 24px rgba(13, 27, 62, 0.08);
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #1a56b0;
}

.metric:nth-child(2)::after {
  background: #008b9a;
}

.metric:nth-child(3)::after {
  background: #f0a500;
}

.metric:nth-child(4)::after {
  background: #1b6b3a;
}

.metric strong {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 26px;
}

.panel {
  border-color: #e8edf5;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(13, 27, 62, 0.08);
}

.panel-head {
  min-height: 58px;
  padding: 14px 16px;
}

.panel-head h2 {
  font-size: 15px;
  font-weight: 900;
}

.panel-head small {
  color: #8899bb;
}

th {
  background: #0d1b3e;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

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

  .sidebar {
    position: static;
  }

  .grid.metrics,
  .stream-grid,
  .module-grid,
  .flag-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 680px) {
  .login-panel {
    padding: 28px 20px;
  }

  .login-panel h1 {
    font-size: 31px;
  }

  .login-assurance {
    grid-template-columns: 1fr;
  }

  .content,
  .topbar {
    padding: 16px;
  }

  .grid.metrics,
  .stream-grid,
  .module-grid,
  .flag-row {
    grid-template-columns: 1fr;
  }

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

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

  .policy-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body:has(.layout) {
    overflow: auto;
  }

  .layout {
    display: block;
    height: auto;
  }

  .sidebar {
    width: 100%;
    height: auto;
    max-height: none;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 340px;
  }

  .profile-chip {
    grid-template-columns: 34px 1fr;
  }

  .main {
    height: auto;
    overflow: visible;
  }

  .topbar {
    height: auto;
    min-height: 60px;
    align-items: stretch;
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .search-bar {
    min-width: min(100%, 280px);
  }

  .content {
    height: auto;
    overflow: visible;
    padding: 16px;
    min-width: 0;
  }

  .content > *,
  .grid.metrics,
  .split,
  .panel,
  .summary-strip {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .grid.metrics,
  .split,
  .module-grid,
  .stream-grid,
  .flag-row {
    grid-template-columns: 1fr;
  }

  .summary-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strip-sep {
    display: none;
  }

  .chart {
    grid-template-columns: repeat(9, minmax(18px, 1fr));
    gap: 4px;
  }

  .bar span {
    width: 44px;
    font-size: 9px;
  }
}
