:root {
  color-scheme: dark;
  --bg: #040405;
  --panel: #1d1d20;
  --panel-2: #29282d;
  --field: #34333a;
  --text: #f7f7fa;
  --muted: #9d9aa4;
  --blue: #1596f4;
  --green: #2ed45f;
  --red: #ff4651;
  --orange: #ff9a2e;
  --pink: #ef35e7;
  --cyan: #12d8cd;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 35% 0%, rgba(21, 150, 244, .22), transparent 28rem),
    radial-gradient(circle at 100% 5%, rgba(239, 53, 231, .18), transparent 26rem),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 34px;
  align-items: center;
  padding: clamp(20px, 5vw, 70px);
  background:
    linear-gradient(90deg, rgba(4, 4, 5, .96), rgba(4, 4, 5, .8)),
    radial-gradient(circle at 30% 10%, rgba(46, 212, 95, .16), transparent 24rem),
    var(--bg);
}

.auth-brand h1 {
  max-width: 740px;
  margin: 10px 0 0;
  font-size: clamp(44px, 8vw, 92px);
  line-height: .95;
  letter-spacing: 0;
}

.auth-brand p {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 24px;
  font-weight: 800;
}

.auth-card,
.form-card,
.summary-card,
.customer-card,
.rate-card,
.note-card,
.user-card,
.brand-card,
.stat-tile,
.quick-tile {
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 28px;
  background: rgba(29, 29, 32, .96);
}

.auth-card {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.auth-card h2 {
  margin: 0 0 6px;
}

.shell {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  width: min(1220px, 100%);
  min-height: 100vh;
  margin: 0 auto;
}

.shell.locked {
  filter: blur(12px);
  pointer-events: none;
}

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  height: 100vh;
  padding: 20px 12px;
  border-right: 1px solid rgba(255, 255, 255, .07);
  background: rgba(10, 10, 11, .74);
  backdrop-filter: blur(18px);
}

.logo-badge,
.rail-btn,
.avatar,
.round-action {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
}

.logo-badge {
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(46, 212, 95, .22), rgba(21, 150, 244, .12)),
    #111;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 14px 44px rgba(0, 0, 0, .3);
}

.logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.logo-badge.large {
  width: 190px;
  height: 190px;
}

.logo-badge.mini {
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
}

.logo-badge.hero {
  width: 180px;
  height: 180px;
  margin: 0 auto 18px;
}

.rail-btn,
.avatar,
.round-action {
  width: 48px;
  height: 48px;
}

.rail-btn {
  background: transparent;
  color: var(--muted);
  transition: .18s ease;
}

.rail-btn:hover,
.rail-btn.active {
  background: var(--panel);
  color: var(--text);
}

.icon {
  font-size: 24px;
  line-height: 1;
}

.app {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 34px 28px 56px;
}

.topbar,
.section-head,
.session,
.card-label,
.split,
.summary-top,
.summary-bottom,
.customer-card,
.input-row,
.exchange-preview,
.rate-details {
  display: flex;
  align-items: center;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  justify-content: space-between;
  gap: 20px;
  margin: -34px -28px 24px;
  padding: 32px 28px 18px;
  background: linear-gradient(180deg, rgba(4, 4, 5, .98), rgba(4, 4, 5, .72));
  backdrop-filter: blur(18px);
}

.top-title {
  min-width: 0;
}

.session {
  flex: 0 0 auto;
  gap: 12px;
  text-align: right;
}

.session strong,
.session span {
  display: block;
}

.session span,
.eyebrow,
.welcome,
.muted,
.summary-card span,
.customer-meta,
label > span,
.rate-card p,
.note-card p,
small,
.user-card span,
.brand-card span {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(34px, 6vw, 70px);
  line-height: .98;
  letter-spacing: 0;
}

h2 {
  margin: 34px 0 18px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

.avatar {
  background: var(--blue);
  color: #101014;
  font-size: 30px;
  font-weight: 900;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: rise .22s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 22px;
  align-items: stretch;
}

.welcome {
  margin-bottom: 28px;
  font-size: 26px;
}

.net-card {
  min-height: 245px;
  padding: 34px;
  border-radius: 36px;
  background: linear-gradient(125deg, #35a6ff 0%, #8c6cf4 48%, #e827e7 100%);
  box-shadow: 0 22px 52px rgba(21, 150, 244, .18);
}

.card-label {
  gap: 14px;
  font-size: 27px;
  font-weight: 800;
}

.chart-icon {
  font-size: 42px;
}

.net-amount {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 28px 0 24px;
  font-size: clamp(56px, 10vw, 98px);
  font-weight: 900;
  line-height: .9;
}

.net-amount small {
  font-size: .34em;
  font-weight: 800;
}

.split {
  gap: 42px;
}

.split > div {
  min-width: 0;
  flex: 1;
  border-right: 1px solid rgba(30, 30, 35, .25);
}

.split > div:last-child {
  border-right: 0;
}

.split strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 26px;
}

.brand-card {
  display: grid;
  align-content: center;
  padding: 22px;
  text-align: center;
}

.brand-card strong {
  font-size: 24px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 30px 0 28px;
}

.stat-tile {
  position: relative;
  min-height: 180px;
  padding: 26px;
}

.stat-tile strong {
  display: block;
  margin: 22px 0 8px;
  font-size: 48px;
  line-height: 1;
}

.stat-tile > span:last-child {
  color: var(--muted);
  font-size: 24px;
}

.stat-icon {
  font-size: 28px;
  font-weight: 900;
}

.green { color: var(--green) !important; }
.red { color: var(--red) !important; }
.orange { color: var(--orange) !important; }
.pink { color: var(--pink) !important; }
.cyan { color: var(--cyan) !important; }
.blue { color: var(--blue) !important; }

.pill,
.admin-pill {
  display: inline-flex;
  padding: 7px 14px;
  border-radius: 18px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.pill {
  position: absolute;
  top: 18px;
  right: 18px;
}

.admin-pill {
  background: rgba(46, 212, 95, .16);
  color: var(--green);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.quick-tile {
  min-height: 170px;
  padding: 28px;
  color: var(--text);
}

.quick-tile:hover,
.customer-card:hover,
.user-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .1);
}

.quick-icon {
  display: block;
  margin-bottom: 28px;
  font-size: 46px;
  font-weight: 900;
}

.quick-tile strong {
  font-size: 27px;
}

.round-action {
  flex: 0 0 auto;
  background: var(--blue);
  color: #071018;
  font-size: 32px;
  font-weight: 900;
}

.section-head {
  justify-content: space-between;
  gap: 20px;
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 26px;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--field);
  color: var(--muted);
}

.search input,
.input-row input,
.form-card select,
.form-card > label > input,
.converter input,
.auth-card input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search input {
  font-size: 24px;
}

.summary-card {
  padding: 28px;
  margin-bottom: 18px;
  background: var(--panel-2);
}

.summary-top,
.summary-bottom {
  justify-content: space-between;
  gap: 22px;
}

.summary-top {
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.summary-top strong {
  display: block;
  margin-top: 8px;
  font-size: 48px;
}

.summary-icon {
  color: var(--blue) !important;
  font-size: 44px;
}

.summary-bottom {
  padding-top: 20px;
}

.summary-bottom strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.customer-list,
.user-list,
.history-list {
  display: grid;
  gap: 16px;
}

.customer-card {
  justify-content: space-between;
  gap: 20px;
  min-height: 132px;
  padding: 22px 28px;
  transition: .18s ease;
}

.customer-left {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.customer-badge {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(21, 150, 244, .16);
  color: var(--blue);
  font-size: 28px;
  font-weight: 900;
}

.customer-badge.positive {
  background: rgba(46, 212, 95, .17);
}

.customer-badge.negative {
  background: rgba(255, 70, 81, .14);
}

.customer-name {
  overflow: hidden;
  margin-bottom: 8px;
  text-overflow: ellipsis;
  font-size: 30px;
  font-weight: 850;
}

.customer-balance {
  min-width: 140px;
  text-align: right;
}

.customer-balance strong {
  display: block;
  font-size: 28px;
}

.form-hero {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 26px 0 12px;
}

.form-hero.compact {
  padding-top: 8px;
}

.form-avatar {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  margin-bottom: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5da4ff, #df38e7);
  font-size: 54px;
  font-weight: 900;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .24);
}

.form-hero h2 {
  margin: 0 0 12px;
}

.form-hero p {
  color: var(--muted);
  font-size: 24px;
}

.form-card {
  display: grid;
  gap: 22px;
  max-width: 760px;
  margin: 20px auto 0;
  padding: 28px;
}

.inline-form {
  max-width: none;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
}

.form-card label,
.auth-card label {
  display: grid;
  gap: 10px;
}

.input-row,
.form-card select,
.form-card > label > input,
.converter label,
.auth-card input {
  min-height: 68px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .04);
  border-radius: 16px;
  background: var(--field);
}

.input-row {
  gap: 14px;
}

.input-row input,
.form-card select,
.form-card > label > input {
  font-size: 21px;
}

.primary,
.ghost {
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  font-weight: 850;
}

.primary {
  min-height: 68px;
  padding: 0 22px;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  color: #fff;
  font-size: 22px;
}

.ghost {
  padding: 0 16px;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: var(--field);
}

.segment {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.active {
  background: var(--blue);
  color: #061019;
}

.amount-grid,
.converter {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 14px;
}

.exchange-preview,
.rate-details {
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(21, 150, 244, .12);
}

.rate-card {
  padding: 30px;
  background: linear-gradient(145deg, rgba(21, 150, 244, .2), rgba(239, 53, 231, .18)), var(--panel);
}

.rate-source {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: var(--muted);
  font-weight: 800;
}

.rate-value {
  margin: 24px 0 10px;
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 900;
  line-height: 1;
}

.rate-details {
  margin-top: 18px;
}

.converter {
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  margin-top: 24px;
}

.converter label {
  display: grid;
  gap: 6px;
  height: auto;
  min-height: 86px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.equals {
  padding-bottom: 25px;
  color: var(--muted);
  font-size: 28px;
  font-weight: 900;
}

.note-card {
  margin-top: 18px;
  padding: 24px;
}

.user-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px;
}

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

.detail-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.compact-btn {
  min-height: 42px;
  margin-bottom: 14px;
}

.detail-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.detail-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.history-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 20px;
  background: rgba(29, 29, 32, .96);
}

.history-card strong,
.history-card span,
.history-card small {
  display: block;
}

.history-card small {
  margin-top: 8px;
}

.history-amount {
  min-width: 190px;
  text-align: right;
}

.history-amount strong {
  font-size: 22px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: min(360px, calc(100% - 40px));
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(44, 44, 49, .96);
  color: #fff;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .3);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
}

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

@media (max-width: 900px) {
  .hero-row,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .brand-card {
    display: none;
  }
}

@media (max-width: 760px) {
  .auth-screen {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .logo-badge.large {
    width: 140px;
    height: 140px;
  }

  .shell {
    display: block;
  }

  .rail {
    position: fixed;
    top: auto;
    right: 14px;
    bottom: 14px;
    left: 14px;
    z-index: 10;
    flex-direction: row;
    justify-content: space-around;
    height: 64px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 26px;
  }

  .logo-badge.mini {
    display: none;
  }

  .rail-btn {
    width: 48px;
    height: 48px;
  }

  .app {
    padding: 30px 18px 100px;
  }

  .topbar {
    margin: -30px -18px 24px;
    padding: 30px 18px 16px;
  }

  .session div {
    display: none;
  }

  .eyebrow {
    font-size: 18px;
  }

  h1 {
    font-size: 36px;
  }

  .welcome {
    font-size: 22px;
  }

  .net-card {
    min-height: 220px;
    padding: 26px;
    border-radius: 28px;
  }

  .net-amount {
    font-size: 52px;
  }

  .split {
    gap: 18px;
  }

  .split strong {
    font-size: 20px;
  }

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

  .stat-tile {
    min-height: 150px;
    padding: 16px;
    border-radius: 22px;
  }

  .stat-tile strong {
    margin-top: 20px;
    font-size: 34px;
  }

  .stat-tile > span:last-child {
    font-size: 18px;
  }

  .pill {
    top: 12px;
    right: 10px;
    padding: 5px 9px;
    font-size: 12px;
  }

  .quick-grid {
    gap: 14px;
  }

  .quick-tile {
    min-height: 146px;
    padding: 20px 14px;
    border-radius: 24px;
  }

  .quick-icon {
    margin-bottom: 22px;
    font-size: 39px;
  }

  .quick-tile strong {
    font-size: 22px;
  }

  .summary-bottom,
  .customer-card,
  .user-card,
  .history-card {
    align-items: flex-start;
  }

  .customer-card {
    padding: 20px;
  }

  .customer-left {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 14px;
  }

  .customer-badge {
    width: 62px;
    height: 62px;
  }

  .customer-name {
    font-size: 24px;
  }

  .customer-balance {
    min-width: 92px;
  }

  .form-avatar {
    width: 120px;
    height: 120px;
  }

  .form-card {
    padding: 18px;
  }

  .segmented,
  .amount-grid,
  .converter {
    grid-template-columns: 1fr 1fr;
  }

  .segmented {
    gap: 6px;
  }

  .segment {
    font-size: 14px;
  }

  .converter,
  .rate-details {
    grid-template-columns: 1fr;
  }

  .detail-actions,
  .history-card {
    display: grid;
  }

  .detail-summary {
    grid-template-columns: 1fr;
  }

  .history-amount {
    min-width: 0;
    text-align: left;
  }

  .equals {
    display: none;
  }
}

@media (max-width: 430px) {
  h2 {
    font-size: 34px;
  }

  .stat-icon {
    font-size: 22px;
  }

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

  .summary-bottom {
    display: grid;
  }

  .rate-value {
    font-size: 38px;
  }
}
