:root {
  --bg-soft: #f4f1e8;
  --surface: rgba(255, 255, 255, 0.95);
  --text-main: #242424;
  --text-muted: #74716b;
  --brand: #e7aa17;
  --brand-strong: #242424;
  --line: rgba(36, 36, 36, 0.12);
  --danger: #b42318;
}
* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f6f7f9;
  color: var(--text-main);
  padding: 0;
}
.auth-layout {
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
}
.login-panel {
  width: min(100%, 430px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(36, 36, 36, 0.12);
  padding: 30px;
}
.brand-lockup {
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
  margin-bottom: 24px;
}
.brand-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
}
.brand-logo-wide {
  width: min(100%, 300px);
  height: auto;
  max-height: 300px;
}
.brand-logo-crop {
  width: 280px;
  height: 210px;
  overflow: hidden;
  display: grid;
  place-items: start center;
  transform: translateX(-18px);
}
.brand-logo-crop img {
  width: 330px;
  height: 330px;
  object-fit: cover;
  object-position: center top;
  transform: translateY(-8px);
}
.brand-accent {
  color: var(--brand);
}
.brand-lockup h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
}
.brand-lockup p {
  margin: 8px 0 0;
  color: var(--text-muted);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-message {
  color: var(--danger);
  font-size: 0.9rem;
  text-align: center;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 25px;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.05);
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.app-logo {
  width: 74px;
  height: 74px;
  object-fit: contain;
}
.app-brand h2 {
  margin: 0;
}
.app-brand .muted {
  margin: 4px 0 0;
}
.hidden { display: none !important; }
.muted { color: var(--text-muted); font-size: 0.9rem; }
.remittance-tabs { display: flex; gap: 10px; margin: 20px 0; border-bottom: 2px solid rgba(0,0,0,0.05); padding-bottom: 8px; flex-wrap: wrap; }
.remittance-tab { padding: 8px 16px; border: none; background: transparent; cursor: pointer; font-weight: bold; color: var(--text-muted); border-radius: 6px; }
.remittance-tab.active { background: var(--brand); color: #1d1a13; }
.remittance-request-panel { display: flex; flex-direction: column; gap: 12px; }
.remittance-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.remittance-fields-group { display: flex; flex-direction: column; }
label { font-weight: bold; font-size: 0.85rem; margin-bottom: 4px; }
input, select { padding: 10px; border: 1px solid rgba(0,0,0,0.15); border-radius: 6px; font-size: 0.95rem; }
input.no-spin::-webkit-outer-spin-button,
input.no-spin::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input.no-spin {
  appearance: textfield;
  -moz-appearance: textfield;
}
input[readonly] { background-color: #f3f7f4; }
.btn-primary { background: var(--brand-strong); color: white; border: none; padding: 12px; border-radius: 6px; font-weight: bold; cursor: pointer; }
.btn-primary:hover { background: #3a3a3a; }
.btn-ghost { background: white; color: var(--text-main); border: 1px solid var(--line); padding: 9px 14px; border-radius: 6px; font-weight: bold; cursor: pointer; }
.btn-ghost:hover { border-color: var(--brand); }
.form-submit { margin-top: 15px; }
.remittance-rate-overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.remittance-rate-overview-card { background: white; padding: 20px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.05); display: flex; flex-direction: column; }
.remittance-rate-overview-card strong { font-size: 1.5rem; color: var(--brand); margin-top: 5px; }
.admin-rate-panel {
  margin-top: 18px;
  background: white;
  border: 1px solid #d6dee9;
  border-radius: 8px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  align-items: end;
}
.admin-rate-panel small {
  color: #53627a;
}
.rate-preview {
  grid-column: 1 / -1;
  max-width: 360px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid #d6dee9;
}
table { width: 100%; border-collapse: collapse; margin-top: 15px; text-align: left; }
th, td { padding: 10px; border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 0.9rem; }
th { color: var(--text-muted); font-weight: bold; }
.empty { text-align: center; color: var(--text-muted); padding: 20px; font-style: italic; }
.table-wrap { overflow-x: auto; }

.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  background: #f6f7f9;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    radial-gradient(circle at 50% 8%, rgba(231, 170, 23, 0.16), transparent 28%),
    linear-gradient(180deg, #0f4f82 0%, #173f63 56%, #123651 100%);
  color: white;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}
.sidebar-brand {
  min-height: 184px;
  display: grid;
  place-items: center;
  padding: 22px 18px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.sidebar-brand img {
  width: 174px;
  height: 132px;
  object-fit: contain;
  object-position: center;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 18px 38px rgba(2, 12, 27, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.sidebar-nav {
  display: grid;
  gap: 8px;
  padding: 18px 12px;
}
.sidebar-nav .remittance-tab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: white;
  text-align: left;
  border-radius: 6px;
  font-size: 0.96rem;
}
.sidebar-nav .nav-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
}
.sidebar-nav .nav-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-nav .remittance-tab.active,
.sidebar-nav .remittance-tab:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  box-shadow: inset 3px 0 0 var(--brand);
}
.sidebar-user {
  margin-top: auto;
  padding: 20px 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(4, 21, 36, 0.16);
  display: grid;
  gap: 6px;
}
.sidebar-user span {
  font-size: 0.82rem;
  opacity: 0.92;
  word-break: break-word;
}
.btn-danger {
  margin-top: 10px;
  background: #df0000;
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 11px 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.dashboard-main {
  padding: 30px 40px;
  max-width: 1320px;
  width: 100%;
}
.dashboard-view > h1,
.view-heading h1 {
  margin: 0 0 22px;
  color: #111827;
  font-size: 2rem;
}
.view-heading p {
  margin: -12px 0 22px;
  color: #53627a;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 290px));
  gap: 24px;
  margin-bottom: 24px;
}
.metric-card,
.account-summary,
.recent-panel,
.dashboard-view .remittance-request-panel,
.dashboard-view .table-wrap,
.dashboard-view .empty {
  background: white;
  border: 1px solid #d6dee9;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.metric-card {
  min-height: 146px;
  padding: 24px;
}
.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #111827;
  font-weight: 700;
}
.metric-head strong {
  color: #64748b;
  font-size: 1.35rem;
}
.metric-card p {
  margin: 26px 0 2px;
  font-size: 2rem;
  font-weight: 800;
  color: #111827;
}
.metric-card small,
.account-summary small {
  color: #53627a;
}
.account-summary {
  padding: 26px 24px;
  margin-bottom: 24px;
  border-color: #b9d3ff;
}
.account-summary h2,
.recent-panel h2 {
  margin: 0 0 18px;
  font-size: 1.25rem;
}
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 36px;
}
.account-grid div {
  display: grid;
  gap: 8px;
}
.account-grid span {
  color: #53627a;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.account-grid strong {
  color: #2563eb;
  font-size: 2rem;
}
.danger-text {
  color: #dc2626 !important;
}
.recent-panel {
  padding: 24px;
}
.recent-list {
  display: grid;
  gap: 10px;
}
.recent-item {
  border: 1px solid #d6dee9;
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}
.recent-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
}
.status-pill {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.76rem;
  background: #dcfce7;
  color: #166534;
}
.status-pill.pending {
  background: #fff7ed;
  color: #c2410c;
}
.recent-amount {
  font-weight: 700;
}
.recent-meta {
  margin-top: 6px;
  color: #53627a;
  font-size: 0.8rem;
}
.recent-arrow {
  color: #64748b;
  font-size: 1.6rem;
}
.dashboard-view .remittance-request-panel {
  max-width: 920px;
  padding: 26px 28px;
}
.dashboard-view .table-wrap {
  padding: 10px 16px 18px;
}
.dashboard-view .empty {
  padding: 24px;
}
.mobile-bottom-nav,
.mobile-more-menu {
  display: none;
}
.tool-panel {
  max-width: 520px;
  background: white;
  border: 1px solid #d6dee9;
  border-radius: 8px;
  padding: 24px;
}
.calculator-panel {
  display: grid;
  gap: 12px;
}
.calculator-result {
  margin-top: 8px;
  border: 1px solid #b9d3ff;
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 8px;
}
.calculator-result span {
  color: #53627a;
  font-weight: 700;
  font-size: 0.88rem;
}
.calculator-result strong {
  color: #2563eb;
  font-size: 2rem;
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 18px;
}
.admin-form {
  background: white;
  border: 1px solid #d6dee9;
  border-radius: 8px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.admin-form button {
  grid-column: span 3;
}
.admin-table-wrap input {
  width: 150px;
  min-height: 36px;
  padding: 8px;
}
.admin-action {
  background: #1e73b8;
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}
.send-form {
  gap: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
.highlighted-fields {
  background: #f0f7ff;
  border: 1px solid #b8d7ff;
  border-radius: 8px;
  padding: 14px 12px;
}
.field-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.field-full {
  grid-column: 1 / -1;
}
.send-form label {
  color: #06152b;
  font-size: 0.92rem;
}
.send-form input,
.send-form select {
  width: 100%;
  min-height: 46px;
  border-color: #d3dbe6;
  background: white;
}
.send-form input:focus,
.send-form select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: #7aa7ff;
}
.send-form input[readonly] {
  background: #f5faf7;
}
.conversion-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  background: #ecfff4;
  border-radius: 8px;
  padding: 11px 18px;
}
.conversion-strip div {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.conversion-strip span {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.conversion-strip strong {
  color: #00853e;
  font-size: 1rem;
}
.conversion-strip div:last-child strong {
  color: #2563eb;
}
.balance-strip {
  min-height: 42px;
  background: #eef6ff;
  border-radius: 8px;
  color: #0f4fc6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: 0.9rem;
}
.balance-strip div {
  display: flex;
  gap: 10px;
  align-items: center;
}
.balance-strip span {
  font-weight: 700;
}
.balance-strip strong {
  color: #111827;
}
.balance-chevron {
  font-size: 1.2rem;
}
.rate-chip {
  background: #f1f3f6;
  border-radius: 8px;
  color: #53627a;
  padding: 7px 10px;
  font-size: 0.86rem;
}
.rate-chip strong {
  color: #2563eb;
}
.send-form .form-submit {
  min-height: 46px;
  background: linear-gradient(90deg, #1e73b8 0%, #244f78 100%);
  font-size: 1rem;
}

@media (max-width: 720px) {
  body { padding: 0; }
  .auth-layout { min-height: calc(100vh - 32px); }
  .login-panel, .card { padding: 20px; }
  .section-head { flex-direction: column; }
  .remittance-settings-grid, .remittance-rate-overview-grid { grid-template-columns: 1fr; }
  .brand-logo { width: 118px; height: 118px; }
  .brand-logo-crop { width: 230px; height: 178px; transform: translateX(-12px); }
  .brand-logo-crop img { width: 275px; height: 275px; }
  .dashboard-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .dashboard-main {
    padding: 24px 20px 120px;
    max-width: none;
  }
  .dashboard-view > h1,
  .view-heading h1 {
    font-size: 1.75rem;
    margin-bottom: 30px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .metric-card {
    min-height: 156px;
    padding: 26px;
  }
  .metric-card p {
    margin-top: 30px;
    font-size: 1.9rem;
  }
  .account-grid, .report-grid { grid-template-columns: 1fr; }
  .admin-rate-panel { grid-template-columns: 1fr; }
  .admin-form { grid-template-columns: 1fr; }
  .admin-form button { grid-column: auto; }
  .account-summary {
    padding: 34px 30px;
    margin-top: 30px;
  }
  .account-grid {
    gap: 24px;
  }
  .account-grid strong {
    font-size: 1.95rem;
  }
  .recent-panel {
    margin-bottom: 20px;
  }
  .dashboard-view .remittance-request-panel {
    max-width: none;
    padding: 22px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .conversion-strip {
    padding: 12px;
  }
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    height: 96px;
    background: linear-gradient(90deg, #1e73b8 0%, #244f78 100%);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.18);
  }
  .mobile-bottom-nav button {
    height: 100%;
    border: 0;
    background: transparent;
    color: white;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    font-size: 0.95rem;
    cursor: pointer;
  }
  .mobile-bottom-nav .nav-icon,
  .mobile-more-toggle .nav-icon {
    width: 30px;
    height: 30px;
  }
  .mobile-bottom-nav svg,
  .mobile-more-toggle svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-bottom-nav .remittance-tab.active {
    background: transparent;
    color: white;
  }
  .mobile-more-menu {
    position: fixed;
    right: 14px;
    bottom: 106px;
    z-index: 21;
    width: 220px;
    background: white;
    border: 1px solid #d6dee9;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
    padding: 8px;
  }
  .mobile-more-menu:not(.hidden) {
    display: grid;
  }
  .mobile-more-menu button {
    border: 0;
    background: transparent;
    color: #111827;
    text-align: left;
    padding: 11px 12px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
  }
  .mobile-more-menu button:hover {
    background: #f1f5f9;
  }
}

@media (max-width: 430px) {
  .dashboard-main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .metric-grid {
    gap: 14px;
  }
  .metric-card {
    padding: 20px;
  }
  .metric-card p,
  .account-grid strong {
    font-size: 1.65rem;
  }
  .account-summary {
    padding: 28px 24px;
  }
}
