:root {
  color-scheme: light;
  --ink: #14201b;
  --muted: #5f6f68;
  --line: #dbe6e0;
  --surface: #ffffff;
  --surface-2: #f4f8f6;
  --brand: #0c6b58;
  --brand-2: #116a9b;
  --accent: #d79624;
  --danger: #b43d35;
  --shadow: 0 18px 55px rgba(22, 38, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef4f1;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  background: #11231d;
  color: #f7fbf9;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e4b552;
  color: #10211c;
  font-weight: 900;
}

.brand span,
.eyebrow {
  display: block;
  color: #87958f;
  font-size: 0.78rem;
}

nav {
  display: grid;
  gap: 4px;
}

nav a {
  color: #dce8e3;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
}

nav a:hover,
nav a.active {
  background: rgba(255, 255, 255, 0.09);
}

.admin-sidebar {
  background: #151c2b;
}

.sidebar-profile {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-profile .avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  background: rgba(228, 181, 82, 0.18);
  color: #e4b552;
}

.sidebar-profile span {
  display: block;
  color: #aebcb6;
  font-size: 0.8rem;
}

.sidebar-action {
  color: #11231d;
  background: #e4b552;
  text-decoration: none;
  text-align: center;
  font-weight: 900;
  padding: 14px;
  border-radius: 8px;
}

main {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar h1,
.panel h2,
.balance-panel h2 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.topbar h1 {
  max-width: 720px;
  font-size: clamp(1.7rem, 3vw, 3.4rem);
  line-height: 1.02;
}

.top-actions,
.login-panel {
  min-width: 330px;
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.top-actions a {
  min-height: 42px;
  border-radius: 8px;
  background: var(--brand-2);
  color: #fff;
  padding: 0 14px;
  font-weight: 800;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
}

.text-link {
  color: var(--brand);
  font-weight: 900;
  text-decoration: none;
}

.login-panel label {
  flex: 1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

select,
input,
textarea,
button,
.quick-actions a {
  min-height: 42px;
  border-radius: 8px;
}

select {
  min-height: 42px;
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--line);
  background: #f9fbfa;
  color: var(--ink);
  padding: 0 10px;
}

input,
textarea {
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--line);
  background: #f9fbfa;
  color: var(--ink);
  padding: 0 10px;
}

textarea {
  min-height: 140px;
  padding: 12px;
  resize: vertical;
}

button,
.quick-actions a {
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
}

button:hover,
.quick-actions a:hover {
  background: #095747;
}

.hero-grid,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: 22px;
}

.content-grid.wide-left {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.balance-panel,
.panel,
.visual-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.balance-panel,
.panel {
  padding: 22px;
}

.visual-panel {
  overflow: hidden;
  min-height: 280px;
}

.visual-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #dfeee8;
  color: var(--brand);
  font-weight: 900;
}

.metric-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-grid div,
.item,
.profile-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.metric-grid div {
  padding: 14px;
}

.metric-grid span,
.item span,
.profile-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-grid strong,
.item strong,
.profile-grid strong {
  display: block;
  margin-top: 5px;
}

.quick-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-metrics div {
  min-height: 130px;
}

.quick-actions button:nth-child(2) {
  background: var(--brand-2);
}

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

.item {
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.rich-item {
  align-items: start;
}

.item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  min-width: max-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: #e6f0ec;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
}

.amount.debit {
  color: var(--danger);
}

.amount.credit {
  color: var(--brand);
}

.card-list .item {
  min-height: 110px;
  background: linear-gradient(135deg, #11231d, #1f4f43);
  color: #fff;
}

.card-list .item p,
.card-list .item span {
  color: #c8d8d2;
}

.card-list .pill {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.control-list,
.transfer-form {
  display: grid;
  gap: 12px;
}

.transfer-form label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-metrics {
  margin-top: 0;
}

.access-denied {
  max-width: 720px;
}

.access-denied h1 {
  margin: 6px 0;
}

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

.profile-grid div {
  padding: 14px;
}

.login-page {
  background: #11231d;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.7fr);
  gap: 32px;
  align-items: center;
  padding: 36px;
}

.login-copy {
  color: #f7fbf9;
  display: grid;
  gap: 22px;
}

.login-copy .brand span {
  color: #b8c7c1;
}

.login-copy h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5.9rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 620px;
  color: #c9d7d2;
  font-size: 1.08rem;
}

.login-copy img {
  width: min(760px, 100%);
  border-radius: 8px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.38);
}

.login-card {
  border-radius: 8px;
  background: #fff;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 4px 0 20px;
  font-size: 2rem;
}

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

.login-card label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.login-card button {
  margin-top: 6px;
}

.login-meta {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-meta a {
  color: var(--brand);
  font-weight: 900;
}

.request-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
}

.response-box {
  min-height: 260px;
  overflow: auto;
  margin: 16px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #11231d;
  color: #e8f4ef;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  transform: translateY(120px);
  transition: transform 180ms ease;
  opacity: 0;
  pointer-events: none;
  padding: 13px 15px;
  border-radius: 8px;
  background: #11231d;
  color: #fff;
  box-shadow: var(--shadow);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

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

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

  nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .hero-grid,
  .content-grid,
  .login-layout {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 720px) {
  main {
    padding: 18px;
  }

  .topbar,
  .login-panel,
  .top-actions,
  .login-meta,
  .item {
    align-items: stretch;
    flex-direction: column;
  }

  .login-panel {
    min-width: 0;
  }

  nav,
  .metric-grid,
  .request-grid {
    grid-template-columns: 1fr;
  }

  .login-layout {
    padding: 18px;
  }
}
