@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@300;400;500;600;700&family=Barlow+Condensed:wght@600;700&display=swap');

:root {
  --navy: #0b1f3a;
  --navy-2: #122849;
  --navy-3: #1a3a60;
  --blue: #1b6cb0;
  --sky: #e8f2fb;
  --light: #f0f4f9;
  --border: #d5e0ed;
  --text: #0e2340;
  --muted: #4e6a88;
  --white: #ffffff;
  --green: #1e8a5f;
  --orange: #b97316;
  --red: #b83b3b;
  --shadow: 0 2px 16px rgba(11, 31, 58, .07);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--light);
  color: var(--text);
  font-family: 'Barlow', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
}

a {
  color: var(--blue);
}

.portal-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 36px;
  background: var(--navy);
  box-shadow: 0 2px 20px rgba(0, 0, 0, .32);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
}

.topbar-logo img {
  display: block;
  height: 32px;
}

.topbar-logo span {
  color: var(--white);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .06em;
}

.topbar-pill {
  flex: 0 0 auto;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 99px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .62);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 42px 40px 38px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 50%, #0d2850 100%);
}

.hero::after {
  content: '';
  position: absolute;
  top: -95px;
  right: -80px;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27, 108, 176, .18) 0%, transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: rgba(255, 255, 255, .48);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.hero-eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  background: rgba(255, 255, 255, .32);
}

.hero h1 {
  margin: 0 0 10px;
  color: var(--white);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.08;
}

.hero p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, .58);
  font-weight: 300;
  line-height: 1.55;
}

.main {
  flex: 1;
  width: min(1120px, calc(100% - 48px));
  margin: 32px auto 42px;
}

.main.narrow {
  width: min(460px, calc(100% - 36px));
}

.card,
.panel,
.chart-box,
.chart {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card {
  overflow: hidden;
}

.panel {
  margin-bottom: 20px;
}

.card-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 22px;
  background: var(--navy);
}

.card-head h2,
.panel-head h2,
.section-title {
  margin: 0;
  color: rgba(255, 255, 255, .88);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.card-body,
.panel-body {
  padding: 24px 22px;
}

.stack {
  display: grid;
  gap: 18px;
}

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

.cards,
.metric-grid,
.charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

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

.metric-card {
  padding: 18px;
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.chart-box,
.chart {
  min-height: 320px;
  padding: 18px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.nav a,
.btn,
button,
input[type='submit'] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: var(--white);
  color: var(--muted);
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .08s;
}

.nav a:hover,
.btn:hover,
button:hover,
input[type='submit']:hover {
  border-color: var(--blue);
  background: var(--sky);
  color: var(--blue);
}

.nav a.active,
.btn.primary,
button.primary,
.btn:not(.btn-secondary):not(.btn-danger):not(.btn-logout).primary {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.nav a.active:hover,
.btn.primary:hover,
button.primary:hover {
  background: var(--navy-3);
  color: var(--white);
}

.btn {
  width: auto;
}

.btn-block {
  width: 100%;
}

.btn-secondary {
  border-color: var(--border);
  background: var(--white);
}

.btn-danger,
.btn-logout {
  border-color: rgba(184, 59, 59, .28);
  background: #fff6f6;
  color: var(--red);
}

.nav .btn-logout {
  margin-left: auto;
}

.btn-danger:hover,
.btn-logout:hover {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

button.status-btn,
td button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
}

label,
.flabel {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: #f7fafe;
  color: var(--text);
  font: inherit;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(27, 108, 176, .13);
}

.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.portal-table,
table.dataTable,
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

.portal-table th,
.portal-table td,
table.dataTable th,
table.dataTable td,
table th,
table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e8eef5;
  vertical-align: top;
}

.portal-table th,
table.dataTable thead th,
table th {
  background: #f7fafe;
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}

table.dataTable.no-footer {
  border-bottom: 1px solid var(--border);
}

tr.selected,
table.dataTable tbody tr.selected > * {
  background: #f4f9fe !important;
  color: var(--text) !important;
  box-shadow: inset 2px 0 0 rgba(27, 108, 176, .38);
}

table.dataTable tbody tr.selected a,
table.dataTable tbody tr.selected button {
  color: inherit;
}

.dt-right,
.right,
td.right,
th.right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

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

.status-warning {
  color: var(--orange);
}

.status-investigate {
  color: var(--blue);
}

.status-rejected {
  color: var(--red);
}

.modal {
  display: none;
  position: fixed;
  inset: 10%;
  z-index: 2000;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 20px 60px rgba(11, 31, 58, .25);
}

.modal-head {
  display: flex;
  justify-content: flex-end;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: #f7fafe;
}

#txnDetail {
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(11, 31, 58, .18) !important;
  color: var(--text);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: auto;
  padding: 20px 36px;
  background: var(--navy);
}

.footer img {
  height: 22px;
  opacity: .68;
}

.footer p {
  margin: 0;
  color: rgba(255, 255, 255, .3);
  font-size: 11px;
  letter-spacing: .04em;
}

.login-card {
  margin-top: -10px;
}

#result {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--red);
  text-align: center;
}

@media (max-width: 780px) {
  .topbar,
  .hero,
  .footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .main {
    width: min(100% - 28px, 1120px);
    margin-top: 22px;
  }

  .cards,
  .metric-grid,
  .charts {
    grid-template-columns: 1fr;
  }

  .form-row,
  .grid-actions,
  .nav {
    align-items: stretch;
    flex-direction: column;
  }

  .nav a,
  .grid-actions button,
  .grid-actions input {
    width: 100%;
  }

  .nav .btn-logout {
    margin-left: 0;
  }

  .modal {
    inset: 5%;
  }
}
