:root {
  color-scheme: light;
  --bg: #f2f3f8;
  --card: #ffffff;
  --ink: #151923;
  --muted: #9aa3b2;
  --faint: #eef1f6;
  --blue: #2f6bea;
  --blue-2: #eef6ff;
  --green: #18c466;
  --green-soft: #e9fff3;
  --red: #ee4656;
  --red-soft: #fff0f2;
  --shadow: 0 18px 38px rgba(41, 48, 75, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

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

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

input {
  width: 100%;
  border: 0;
  outline: none;
  background: var(--faint);
  color: var(--ink);
}

.phone {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
}

.wallet-screen {
  padding: 42px 16px 116px;
}

.auth-screen {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  padding: 34px 24px 26px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 22px;
  display: block;
  box-shadow: 0 14px 30px rgba(47, 107, 234, 0.18);
}

.auth-card h1 {
  margin: 0;
  font-size: 28px;
}

.auth-card p,
.current-user {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  text-align: left;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

label input {
  height: 58px;
  border-radius: 14px;
  padding: 0 16px;
  font-size: 18px;
  font-weight: 800;
}

.blue-button {
  min-height: 56px;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(47, 107, 234, 0.18);
}

.text-link {
  margin-top: 18px;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
}

.toast {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  background: #fff7df;
  color: #9b6b10;
  font-weight: 800;
}

.person-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(132px, 1fr);
  gap: 8px;
  margin: -42px -16px 20px;
  padding: 42px 12px 14px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 2px 10px rgba(35, 44, 77, 0.04);
}

.person-tabs button {
  height: 46px;
  border-radius: 24px;
  background: #fff;
  color: var(--muted);
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
}

.person-tabs button.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 16px rgba(47, 107, 234, 0.28);
}

.tabs-empty {
  margin-bottom: 20px;
  color: var(--muted);
  text-align: center;
}

.balance-card,
.wage-card,
.adjust-card,
.tx-card,
.empty-card {
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.balance-card {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 26px 24px;
  text-align: center;
}

.balance-card p,
.wage-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.balance-card h1 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(46px, 12vw, 58px);
  font-weight: 1000;
  line-height: 1;
}

.card-icon {
  position: absolute;
  right: 24px;
  top: 28px;
  width: 58px;
  height: 48px;
  border-radius: 10px;
  background: #eef1f6;
}

.card-icon::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 10px;
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: #fff;
}

.card-icon::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.wage-card {
  min-height: 92px;
  margin-top: 20px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wage-card strong {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 25px;
  font-weight: 1000;
}

.wage-card strong span {
  color: var(--muted);
  font-size: 16px;
}

.coin-icon {
  position: relative;
  width: 28px;
  height: 24px;
  flex: 0 0 28px;
}

.coin-icon,
.coin-icon::before,
.coin-icon::after {
  border-radius: 999px;
  background: #d7dce4;
}

.coin-icon {
  width: 22px;
  height: 10px;
  box-shadow: 0 5px 0 #d7dce4, 0 10px 0 #d7dce4;
}

.coin-icon::before,
.coin-icon::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 10px;
}

.coin-icon::before {
  right: -6px;
  top: 4px;
  opacity: 0.78;
}

.coin-icon::after {
  right: -2px;
  top: -5px;
  opacity: 0.55;
}

.adjust-card {
  margin-top: 20px;
  padding: 20px 16px 16px;
}

.adjust-row {
  display: grid;
  grid-template-columns: 1fr 82px;
  gap: 12px;
}

.adjust-row input,
.adjust-row button {
  height: 74px;
  border-radius: 18px;
  font-size: 25px;
  font-weight: 1000;
}

.adjust-row input {
  text-align: center;
  color: #d7dce5;
}

.adjust-row input:focus {
  color: var(--ink);
}

.adjust-row button {
  background: var(--faint);
  color: #c3c9d4;
}

.adjust-row button:not(:disabled) {
  background: var(--blue);
  color: #fff;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.quick-grid button {
  height: 46px;
  border-radius: 14px;
  background: #f8f9fb;
  color: var(--muted);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px #edf0f6;
}

.quick-grid button.positive {
  background: var(--blue-2);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px #d4e5ff;
}

.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 4px 10px;
  color: var(--muted);
}

.recent-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 1000;
}

.recent-head span {
  font-size: 12px;
  font-weight: 900;
}

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

.tx-card {
  min-height: 76px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}

.tx-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  font-weight: 1000;
}

.tx-icon.plus {
  background: var(--green-soft);
  color: var(--green);
}

.tx-icon.minus {
  background: var(--red-soft);
  color: var(--red);
}

.tx-card p {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 1000;
}

.tx-card time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tx-card strong {
  font-size: 16px;
  font-weight: 1000;
}

.plus {
  color: var(--green);
}

.minus {
  color: var(--red);
}

.empty-card,
.empty-state {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state {
  display: grid;
  gap: 14px;
}

.empty-state h1 {
  margin: 0;
  color: var(--blue);
}

.bottom-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(100%, 430px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 10px 12px 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -16px 30px rgba(54, 62, 92, 0.08);
  backdrop-filter: blur(14px);
}

.bottom-bar button {
  height: 72px;
  display: grid;
  place-items: center;
  gap: 4px;
  background: transparent;
  color: #687181;
  font-weight: 900;
}

.bottom-bar span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f8f9fb;
  color: var(--blue);
  font-size: 28px;
}

.bottom-bar b {
  font-size: 11px;
}

.bottom-bar button.clear span {
  background: var(--red-soft);
  color: var(--red);
}

.settings-screen {
  padding: 42px 16px 36px;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0;
}

.settings-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 1000;
}

.settings-head button {
  background: transparent;
  color: var(--blue);
  font-size: 16px;
  font-weight: 900;
}

.settings-list,
.admin-panel,
.profile-panel {
  overflow: hidden;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.profile-panel {
  padding: 18px 16px;
}

.profile-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f2f7;
}

.profile-line span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.profile-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
  font-weight: 1000;
}

.profile-password-button {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border-radius: 14px;
  background: var(--blue-2);
  color: var(--blue);
  font-size: 16px;
  font-weight: 1000;
}

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

.person-row,
.admin-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f2f7;
}

.person-row > div,
.admin-row > div:first-child {
  min-width: 0;
}

.person-row:last-child,
.admin-row:last-child {
  border-bottom: 0;
}

.person-info {
  display: grid;
  gap: 4px;
  min-width: 0;
  background: transparent;
  text-align: left;
}

.person-info strong,
.admin-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 1000;
}

.person-info span,
.admin-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.row-actions button {
  min-width: 42px;
  height: 42px;
  border-radius: 50%;
  font-weight: 900;
}

.row-actions .edit {
  background: var(--blue-2);
  color: var(--blue);
}

.row-actions .delete {
  background: var(--red-soft);
  color: var(--red);
}

.settings-action {
  width: 100%;
  min-height: 58px;
  margin-top: 16px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 17px;
  font-weight: 1000;
}

.settings-action.add {
  color: var(--blue);
}

.settings-action.logout {
  color: var(--red);
}

.settings-action.back {
  color: var(--blue);
}

.current-user {
  margin-top: 80px;
  text-align: center;
  font-size: 12px;
}

.settings-empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.admin-panel {
  margin-top: 16px;
  padding-top: 12px;
}

.admin-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
}

.admin-title h2 {
  margin: 0;
  font-size: 18px;
}

.admin-title button {
  background: transparent;
  color: var(--blue);
  font-weight: 900;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.52);
}

.dialog-card {
  width: min(100%, 360px);
  padding: 28px 24px 24px;
  border-radius: 24px;
  background: #fff;
}

.dialog-card h2 {
  margin: 0 0 24px;
  text-align: center;
  font-size: 22px;
}

.dialog-card form {
  display: grid;
  gap: 18px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.dialog-actions button {
  min-height: 54px;
  border-radius: 14px;
  background: var(--faint);
  font-weight: 1000;
}

@media (min-width: 431px) {
  body {
    background: linear-gradient(90deg, #e9ebf3 0, #f6f7fb 50%, #e9ebf3 100%);
  }
}
