:root {
  --page-bg: #f2f0f1;
  --phone-shell: linear-gradient(180deg, #272842 0%, #181928 100%);
  --screen-bg: linear-gradient(180deg, #26273d 0%, #1d1e2f 100%);
  --panel: rgba(48, 50, 74, 0.96);
  --panel-strong: rgba(55, 58, 86, 0.96);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f3f1f5;
  --muted: #c9c5d8;
  --soft: #9b96ad;
  --accent: linear-gradient(135deg, #6488ff 0%, #3f60ff 100%);
  --accent-shadow: 0 14px 26px rgba(62, 95, 255, 0.32);
  --danger: #ff8b90;
  --gold: #ffc74f;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: var(--page-bg);
  color: var(--text);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.ui-showcase {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.8), transparent 30%),
    #f2f0f1;
}

.showcase-shell {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 60px;
}

.showcase-intro {
  color: #2a2732;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: #67607a;
}

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

.showcase-intro h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.showcase-intro p {
  margin: 0;
  max-width: 760px;
  color: #5e586d;
}

.screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.screen-card {
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, #2c2d43 0%, #212233 100%);
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 40px rgba(23, 24, 37, 0.14);
}

.thumb-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.screen-card p {
  margin: 0;
  color: var(--muted);
}

select.auth-input {
  appearance: none;
}

.device-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 30px 16px;
}

.phone-shell {
  width: min(100%, 360px);
  padding: 14px;
  border-radius: 26px;
  background: var(--phone-shell);
  border: 1px solid rgba(13, 15, 27, 0.18);
  box-shadow: 0 26px 48px rgba(15, 16, 26, 0.18);
}

.app-screen {
  min-height: 690px;
  padding: 18px 16px 14px;
  border-radius: 22px;
  background: var(--screen-bg);
  border: 1px solid var(--border);
}

.dashboard-screen {
  position: relative;
  overflow: hidden;
  padding-bottom: 0;
}

.page-screen {
  position: relative;
  overflow: hidden;
  padding-bottom: 0;
}

.dashboard-scroll {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 96px;
  scrollbar-width: none;
}

.dashboard-scroll::-webkit-scrollbar {
  display: none;
}

.page-scroll {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 92px;
  scrollbar-width: none;
}

.page-scroll::-webkit-scrollbar {
  display: none;
}

.top-bar,
.title-group,
.between {
  display: flex;
  align-items: center;
}

.top-bar {
  gap: 14px;
  margin-bottom: 18px;
}

.top-bar.between {
  justify-content: space-between;
}

.title-group {
  gap: 14px;
}

.top-bar h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.dashboard-header h1,
.block-head h2 {
  margin: 0;
}

.dashboard-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.summary-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.summary-tile,
.dashboard-block,
.quick-link,
.activity-list,
.shortcut-stack {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.summary-tile {
  padding: 16px;
}

.summary-tile.primary {
  background: linear-gradient(135deg, rgba(85, 107, 233, 0.92), rgba(51, 72, 177, 0.92));
  box-shadow: var(--accent-shadow);
}

.summary-tile p,
.summary-tile h2,
.summary-tile h3,
.summary-note,
.activity-row p {
  margin: 0;
}

.summary-tile h2,
.summary-tile h3 {
  margin-top: 6px;
}

.summary-note {
  display: inline-block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.positive {
  color: #9bd19d;
}

.quick-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.quick-link {
  padding: 14px;
  text-align: center;
  font-weight: 700;
}

.dashboard-block {
  padding: 14px;
  margin-bottom: 14px;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.block-head a {
  color: #a8c6ff;
  font-size: 0.88rem;
}

.activity-list,
.shortcut-stack {
  overflow: hidden;
}

.activity-row,
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.activity-row:last-child,
.shortcut-row:last-child {
  border-bottom: 0;
}

.shortcut-row strong,
.activity-row span {
  white-space: nowrap;
}

.back-arrow {
  width: 12px;
  height: 12px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.cancel-link,
.filter-label,
.field span,
.section-title {
  color: var(--muted);
}

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

.field {
  display: grid;
  gap: 8px;
}

.field span em,
.filter-label em {
  color: var(--danger);
  font-style: normal;
}

.split-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-box,
.auth-input,
.search-box,
.segment-control,
.menu-row,
.option-row,
.toggle-row,
.secondary-action,
.list-panel,
.stat-card,
.report-card,
.loan-card,
.filter-panel {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.field-box {
  min-height: 42px;
  padding: 11px 14px;
  color: var(--text);
}

.auth-input {
  min-height: 42px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 14px;
  font: inherit;
  width: 100%;
}

.auth-input::placeholder {
  color: var(--soft);
}

.field-box.strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.field-box.with-icon,
.field-box.between,
.list-row,
.menu-row,
.option-row,
.toggle-row,
.loan-top,
.loan-bottom,
.transaction-item,
.search-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.with-icon {
  justify-content: flex-start;
  gap: 12px;
}

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

.icon-chip {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.icon-chip::before {
  color: #fff;
}

.icon-expense { background: linear-gradient(135deg, #ff7a86, #ea5665); }
.icon-expense::before { content: "◒"; }
.icon-food { background: linear-gradient(135deg, #ffd86e, #ff9f47); }
.icon-food::before { content: "◔"; }
.icon-travel { background: linear-gradient(135deg, #78b6ff, #4f7fff); }
.icon-travel::before { content: "◫"; }
.icon-bills { background: linear-gradient(135deg, #ffc966, #ffaf47); }
.icon-bills::before { content: "⚡"; }
.icon-shopping { background: linear-gradient(135deg, #ff9197, #fa6673); }
.icon-shopping::before { content: "▣"; }
.icon-health { background: linear-gradient(135deg, #ff8991, #ea5566); }
.icon-health::before { content: "♥"; }
.icon-entertainment { background: linear-gradient(135deg, #88b1ff, #5e86ef); }
.icon-entertainment::before { content: "◐"; }
.icon-others { background: linear-gradient(135deg, #9d9bb3, #6e6b84); }
.icon-others::before { content: "•••"; font-size: 0.65rem; letter-spacing: 0.06em; }
.icon-wallet { background: linear-gradient(135deg, #ffc861, #f6aa45); }
.icon-wallet::before { content: "◇"; }
.icon-lock { background: linear-gradient(135deg, #77a8ff, #4c72eb); }
.icon-lock::before { content: "▣"; }
.icon-sync { background: linear-gradient(135deg, #9bd19d, #6fad75); }
.icon-sync::before { content: "◌"; }

.caret,
.chevron-right {
  width: 9px;
  height: 9px;
  border-right: 2px solid #ddd8e8;
  border-bottom: 2px solid #ddd8e8;
  flex: 0 0 auto;
}

.caret {
  transform: rotate(45deg);
  margin-left: auto;
}

.chevron-right {
  transform: rotate(-45deg);
}

.list-panel {
  padding: 10px 14px;
}

.list-row {
  padding: 8px 0;
}

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

.secondary-action,
.primary-action,
.danger-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-weight: 700;
}

.secondary-action {
  background: rgba(57, 60, 88, 0.96);
}

.button-reset {
  border: 0;
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.primary-action {
  border-radius: 14px;
  background: var(--accent);
  box-shadow: var(--accent-shadow);
}

.success-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 14px;
  border: 0;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #6da592 0%, #5b8f80 100%);
  font: inherit;
  font-weight: 700;
}

.danger-action {
  border-radius: 14px;
  background: rgba(85, 53, 65, 0.82);
  color: var(--danger);
  border: 1px solid rgba(255, 129, 139, 0.12);
}

.tab-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding: 0 6px;
}

.dashboard-tab-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(29, 30, 47, 0.98);
}

.app-tab-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(29, 30, 47, 0.98);
}

.tab-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #807b93;
  opacity: 0.92;
}

.tab-icon:nth-child(1) {
  border-radius: 10px 10px 0 0;
}

.tab-icon:nth-child(2)::before,
.tab-icon:nth-child(3)::before,
.tab-icon:nth-child(4)::before,
.tab-icon:nth-child(5)::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  margin: 4px auto;
  background: #807b93;
}

.tab-icon.active {
  background: rgba(99, 129, 255, 0.18);
  border-color: #8ea8ff;
}

.mini-create-btn {
  position: absolute;
  right: 20px;
  bottom: 18px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #6488ff 0%, #3f60ff 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 24px rgba(62, 95, 255, 0.34);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.mini-calendar {
  width: 16px;
  height: 14px;
  border: 2px solid #ddd8e8;
  border-radius: 4px;
  position: relative;
}

.mini-calendar::before,
.mini-calendar::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 2px;
  height: 5px;
  background: #ddd8e8;
}

.mini-calendar::before { left: 3px; }
.mini-calendar::after { right: 3px; }

.menu-list,
.group-panel,
.transaction-panel {
  display: grid;
  gap: 10px;
}

.menu-row,
.option-row,
.toggle-row {
  padding: 14px;
}

.menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  gap: 12px;
  justify-content: flex-start;
  padding: 12px 14px;
  color: var(--soft);
  margin-bottom: 16px;
}

.compact-box {
  margin-top: 4px;
}

.search-icon {
  width: 16px;
  height: 16px;
  border: 2px solid #ebe7f3;
  border-radius: 50%;
  position: relative;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  background: #ebe7f3;
  transform: rotate(45deg);
}

.group-panel {
  margin-bottom: 16px;
}

.group-panel h2 {
  margin: 0 0 2px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.toggle-switch {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(124, 127, 147, 0.42);
  position: relative;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
}

.toggle-switch.on {
  background: rgba(171, 203, 198, 0.78);
}

.toggle-switch.on::after {
  left: 21px;
}

.segment-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  margin-bottom: 16px;
}

.segment {
  text-align: center;
  padding: 10px 0;
  color: var(--muted);
  border-radius: 10px;
}

.segment.active {
  background: linear-gradient(135deg, rgba(93, 119, 233, 0.9), rgba(118, 141, 255, 0.68));
  color: #fff;
}

.stat-card,
.report-card,
.loan-card,
.filter-panel {
  padding: 16px;
}

.stat-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card p,
.report-card p,
.transaction-item p {
  margin: 0;
  color: var(--muted);
}

.stat-card h2,
.report-card h3,
.loan-card strong {
  margin: 4px 0 0;
  font-size: 1.1rem;
}

.trend-block {
  text-align: right;
}

.trend-block strong {
  display: block;
  font-size: 1.8rem;
}

.trend-block.negative span,
.negative {
  color: var(--danger);
}

.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.progress-bar {
  height: 10px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  width: 88%;
  height: 100%;
  margin-left: 22%;
  background: linear-gradient(90deg, #d8ad66, var(--gold), #ffe19d);
}

.loan-card {
  margin-bottom: 16px;
}

.loan-top strong {
  font-size: 1.15rem;
}

.loan-bottom {
  margin-top: 12px;
}

.loan-bottom span {
  color: #a7d9a9;
}

.section-title {
  margin-bottom: 10px;
}

.transaction-panel {
  gap: 0;
}

.transaction-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.transaction-item:last-child {
  border-bottom: 0;
}

.align-right {
  text-align: right;
}

.filter-panel {
  display: grid;
  gap: 16px;
}

.filter-group {
  display: grid;
  gap: 10px;
}

.auth-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-hero {
  text-align: center;
  margin: 10px 0 18px;
}

.auth-avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #6f90ff, #3f60d8);
  box-shadow: 0 18px 28px rgba(57, 86, 202, 0.28);
  font-size: 2.2rem;
}

.auth-hero h1,
.success-screen h2 {
  margin: 0;
  font-size: 1.35rem;
}

.auth-form {
  margin-top: 8px;
}

.text-link,
.auth-switch a,
.auth-preview-link a,
.ghost-link {
  color: #a8c6ff;
}

.auth-switch,
.status-copy,
.verify-copy p,
.check-row p,
.success-screen p,
.ghost-link,
.centered-link {
  color: var(--muted);
}

.auth-switch {
  margin: 16px 0;
  text-align: center;
}

.centered {
  text-align: center;
}

.social-stack {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 14px;
  font-weight: 700;
}

.social-button.google {
  background: #f4f1f4;
  color: #262637;
}

.social-button.facebook {
  background: rgba(58, 73, 129, 0.82);
}

.auth-preview-link {
  margin: 0;
  text-align: center;
  font-size: 0.92rem;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.small-avatar {
  width: 58px;
  height: 58px;
  margin: 0;
  font-size: 1.35rem;
}

.profile-summary h2,
.profile-summary p {
  margin: 0;
}

.verify-copy {
  margin: 18px 0 12px;
}

.verify-copy p {
  line-height: 1.7;
}

.otp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0 12px;
}

.otp-box {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.check-row {
  display: flex;
  gap: 12px;
  margin: 18px 0;
}

.check-badge {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border-radius: 5px;
  background: linear-gradient(135deg, #7ab28f, #537f67);
  position: relative;
  flex: 0 0 auto;
}

.check-badge::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 6px;
  height: 3px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.success-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.success-badge {
  width: 96px;
  height: 96px;
  margin: 18px auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #6da592, #5b8f80);
  font-size: 3rem;
  color: #fff;
}

.success-screen p {
  margin: 12px 0 22px;
  line-height: 1.6;
}

.ghost-link {
  margin-top: 16px;
}

.compact-list {
  gap: 8px;
}

@media (max-width: 768px) {
  body {
    background: var(--screen-bg);
  }

  body.dashboard-page {
    height: 100dvh;
    overflow: hidden;
  }

  .device-page {
    min-height: 100dvh;
    display: block;
    padding: 0;
    height: 100dvh;
  }

  .phone-shell {
    width: 100%;
    min-height: 100dvh;
    height: 100dvh;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .app-screen,
  .dashboard-screen,
  .auth-screen,
  .success-screen {
    min-height: 100dvh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .app-screen {
    padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  }

  .dashboard-screen {
    overflow: hidden;
    padding-bottom: 0;
  }

  .page-screen {
    overflow: hidden;
    padding-bottom: 0;
  }

  .dashboard-scroll {
    height: 100dvh;
    padding-bottom: 92px;
  }

  .page-scroll {
    height: 100dvh;
    padding-bottom: 92px;
  }

  .dashboard-tab-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 20;
  }

  .app-tab-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 20;
  }

  .mini-create-btn {
    position: fixed;
    right: 18px;
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 8px);
    z-index: 21;
  }

  .showcase-shell {
    width: min(100%, calc(100% - 24px));
    padding-top: 28px;
  }
}
