:root {
  color-scheme: dark;
  --bg: #07111F;
  --panel: #0D1B2C;
  --panel2: #11243A;
  --line: rgba(81, 199, 237, 0.16);
  --line-soft: rgba(255, 255, 255, 0.06);
  --text: #F4F7FB;
  --muted: #91A4B9;
  --cyan: #51C7ED;
  --green: #48D6A0;
  --amber: #F3BD61;
  --red: #F27683;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 85% -5%, rgba(81, 199, 237, 0.18) 0%, transparent 44%),
    radial-gradient(circle at 8% 38%, rgba(17, 36, 58, 0.9) 0%, transparent 52%),
    var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 102px;
}

/* Splash & Loader */
.splash {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: var(--bg);
  gap: 10px;
}

.splash-logo, .mark, .orb {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #51C7ED 0%, #1C75B0 100%);
  color: #051320;
  font-weight: 800;
}

.splash-logo {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  font-size: 34px;
  box-shadow: 0 12px 36px rgba(81, 199, 237, 0.34);
  animation: floatPulse 2.4s ease-in-out infinite;
}

@keyframes floatPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.brand {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 5px;
}

.splash-sub, .splash small {
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--muted);
}

.loader {
  width: 112px;
  height: 4px;
  border-radius: 99px;
  background: var(--panel2);
  margin: 18px 0 10px;
  overflow: hidden;
}

.loader i {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #2788BD, var(--cyan));
  animation: loadSlide 1.1s ease-in-out infinite alternate;
}

@keyframes loadSlide {
  from { transform: translateX(-10%); width: 35%; }
  to { transform: translateX(130%); width: 55%; }
}

/* Header */
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  background: rgba(7, 17, 31, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 10;
}

.brandmark {
  display: flex;
  align-items: center;
  gap: 11px;
}

.mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 21px;
  box-shadow: 0 4px 16px rgba(81, 199, 237, 0.26);
}

.brandmark b, .brandmark small {
  display: block;
}

.brandmark b {
  font-size: 15px;
  letter-spacing: 2px;
}

.brandmark small {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--muted);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 99px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.25); }
}

/* Pages & Animations */
main {
  padding: 20px 18px;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: pageFade 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.page.active .animate-item {
  animation: cardRise 0.42s cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0s) both;
}

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

.stack-fade-in > .item-card {
  animation: itemPop 0.32s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--idx, 0) * 0.04s) both;
}

@keyframes itemPop {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Typography & Headings */
.welcome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--cyan);
  font-weight: 800;
}

.welcome h1, .page-heading h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.18;
  margin: 6px 0;
  letter-spacing: -0.5px;
}

.welcome em {
  font-style: normal;
  color: var(--cyan);
}

.muted, .helper {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.orb {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 22px;
  font-size: 30px;
  box-shadow: 0 0 42px rgba(81, 199, 237, 0.3);
}

.heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin: 4px 0 8px;
}

.back-row {
  margin-bottom: 10px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.2s ease;
}

.back-btn:active {
  transform: scale(0.96);
}

/* Premium Balance & Wallet Cards */
.balance-card, .wallet-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #143656 0%, #0D1B2C 56%, #11243A 100%);
  border: 1px solid rgba(81, 199, 237, 0.34);
  border-radius: 22px;
  padding: 22px;
  margin: 14px 0;
  box-shadow: 0 16px 40px rgba(4, 11, 22, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.balance-card::after, .wallet-card::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(81, 199, 237, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.card-top, .balance-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.card-top {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #C4D9EC;
}

.pill {
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(81, 199, 237, 0.14);
  border: 1px solid rgba(81, 199, 237, 0.28);
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.money {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 14px 0;
}

.money strong {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
}

.money span {
  font-size: 22px;
  font-weight: 700;
  color: var(--cyan);
}

.progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
  margin: 12px 0;
}

.progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #2B8EC4, var(--cyan));
  box-shadow: 0 0 12px rgba(81, 199, 237, 0.7);
  transition: width 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.balance-bottom {
  font-size: 12px;
  color: var(--muted);
}

.wallet-card > small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.text-btn {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--cyan);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Buttons */
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #51C7ED 0%, #2484BA 100%);
  color: #051320;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  padding: 15px 18px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.mini-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #51C7ED 0%, #2484BA 100%);
  color: #051320;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(81, 199, 237, 0.28);
  transition: transform 0.14s ease;
}

.primary:active:not(:disabled),
.mini-primary:active,
.secondary:active:not(:disabled),
.nav-item:active,
.tab-btn:active {
  transform: scale(0.96);
}

.primary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.glow-btn {
  box-shadow: 0 8px 26px rgba(81, 199, 237, 0.34);
  animation: softGlow 3s ease-in-out infinite;
}

@keyframes softGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(81, 199, 237, 0.28); }
  50% { box-shadow: 0 11px 36px rgba(81, 199, 237, 0.5); }
}

.full {
  width: 100%;
}

.home-submit {
  min-height: 56px;
  font-size: 16px;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(242, 118, 131, 0.34);
  background: rgba(242, 118, 131, 0.12);
  color: var(--red);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.2s ease;
}

/* Stats & Grids */
.section-head {
  margin: 24px 0 12px;
}

.section-head h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 4px 0 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat b {
  font-size: 22px;
  font-weight: 800;
}

.stat small {
  font-size: 11px;
  color: var(--muted);
}

.stat-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  background: var(--panel2);
}

.cyan { color: var(--cyan); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.red { color: var(--red); }

.notice {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  margin-top: 16px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.notice-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: rgba(81, 199, 237, 0.14);
  color: var(--cyan);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
}

.notice b {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

.notice p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* Forms & Panels */
.page-heading {
  margin: 4px 0 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  padding: 20px;
  border-radius: 20px;
}

.panel-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 800;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #081423;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder {
  color: #5E748D;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(81, 199, 237, 0.14);
}

.helper {
  margin-top: 12px;
  font-size: 11px;
}

/* Finance Summary & Tabs */
.finance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.fin-box {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 13px 11px;
}

.fin-box small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
}

.fin-box b {
  font-size: 15px;
  font-weight: 800;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  margin-bottom: 14px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 11px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, transform 0.14s ease, box-shadow 0.22s ease;
}

.tab-btn.active {
  background: var(--panel2);
  color: var(--cyan);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.tab-btn.active .tab-badge {
  background: rgba(81, 199, 237, 0.18);
  color: var(--cyan);
}

/* Cards Stack */
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.item-card.admin-card {
  flex-direction: column;
  align-items: stretch;
}

.item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.item-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.item-body b {
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.item-body small {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.reward-chip {
  font-size: 11px;
  font-weight: 800;
  color: var(--cyan);
}

.status {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 99px;
  background: var(--panel2);
  color: var(--text);
}

.status.pending {
  background: rgba(243, 189, 97, 0.14);
  color: var(--amber);
}

.status.approved, .status.paid, .status.plus {
  background: rgba(72, 214, 160, 0.14);
  color: var(--green);
}

.status.rejected, .status.minus {
  background: rgba(242, 118, 131, 0.14);
  color: var(--red);
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.admin-actions .primary {
  padding: 12px 14px;
  font-size: 13px;
  border-radius: 14px;
}

/* Profile */
.profile-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: linear-gradient(145deg, var(--panel2), var(--panel));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  margin-bottom: 14px;
}

.avatar {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(81, 199, 237, 0.25), rgba(36, 132, 186, 0.25));
  border: 1px solid rgba(81, 199, 237, 0.35);
  color: var(--cyan);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.profile-meta b {
  font-size: 17px;
  font-weight: 800;
}

.profile-meta small {
  font-size: 12px;
  color: var(--muted);
}

.id-badge {
  display: inline-block;
  width: fit-content;
  margin-top: 2px;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
}

.info-list {
  padding: 6px 18px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.info-row:last-child {
  border-bottom: 0;
}

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

.info-row b {
  font-size: 14px;
  font-weight: 800;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 100%);
  display: flex;
  justify-content: space-around;
  padding: 8px 8px calc(9px + env(safe-area-inset-bottom));
  background: rgba(13, 27, 44, 0.94);
  border-top: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 20;
}

.nav-item {
  background: none;
  border: 0;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 62px;
  padding: 4px 6px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.14s ease;
}

.nav-item[hidden] {
  display: none;
}

.nav-pill {
  display: grid;
  place-items: center;
  width: 42px;
  height: 28px;
  border-radius: 12px;
  transition: background 0.22s ease, transform 0.22s ease;
}

.nav-item.selected .nav-pill {
  background: rgba(81, 199, 237, 0.16);
  transform: translateY(-1px);
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item small {
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
}

.nav-item.selected {
  color: var(--cyan);
}

/* Toast & Empty */
.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translate(-50%, 10px);
  background: var(--panel2);
  border: 1px solid rgba(81, 199, 237, 0.38);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  z-index: 30;
  max-width: calc(100% - 32px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.empty {
  padding: 26px 18px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  font-size: 13px;
}

@media (min-width: 600px) {
  main { padding: 28px 24px; }
  .welcome h1, .page-heading h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
