:root {
  --bg: #081120;
  --bg-soft: rgba(14, 24, 40, 0.72);
  --panel: rgba(15, 25, 42, 0.78);
  --panel-strong: rgba(21, 32, 52, 0.92);
  --text: #e8eef8;
  --muted: #9fb0cb;
  --line: rgba(255, 255, 255, 0.09);
  --primary: #6ea8fe;
  --primary-2: #9c7bff;
  --success: #42d392;
  --danger: #ff7b8a;
  --warning: #ffc76a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-soft: rgba(255, 255, 255, 0.76);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --text: #17263b;
  --muted: #5e718d;
  --line: rgba(17, 30, 49, 0.09);
  --primary: #2b6ff7;
  --primary-2: #7b61ff;
  --success: #0f9b66;
  --danger: #e34763;
  --warning: #d18d20;
  --shadow: 0 16px 40px rgba(47, 68, 99, 0.12);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  font-family:
    Inter,
    Pretendard,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(
      circle at top left,
      rgba(110, 168, 254, 0.18),
      transparent 35%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(156, 123, 255, 0.18),
      transparent 30%
    ),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea,
select {
  font: inherit;
}
code {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--line);
  word-break: break-all;
}

.bg-orb {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.45;
  z-index: 0;
}
.orb-1 {
  width: 240px;
  height: 240px;
  top: 5%;
  right: 8%;
  background: rgba(110, 168, 254, 0.25);
}
.orb-2 {
  width: 280px;
  height: 280px;
  bottom: 7%;
  left: 12%;
  background: rgba(156, 123, 255, 0.18);
}

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.sidebar {
  position: fixed;
  top: 24px;
  left: 24px;
  bottom: 24px;
  width: 280px;
  border-radius: 28px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  z-index: 4;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}
.brand h1 {
  margin: 0;
  font-size: 1.15rem;
}
.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(72, 105, 255, 0.28);
}
.brand-mark.big {
  width: 70px;
  height: 70px;
  font-size: 2rem;
  border-radius: 22px;
  margin: 0 auto 8px;
}

.nav {
  display: grid;
  gap: 10px;
}
.nav-link {
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--muted);
  transition: 0.18s ease;
}
.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transform: translateY(-1px);
}
.sidebar-bottom {
  margin-top: auto;
}

.main {
  position: relative;
  z-index: 1;
  padding: 24px;
}
.main.with-sidebar {
  margin-left: 328px;
}
.auth-layout {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.topbar {
  border-radius: 24px;
  padding: 22px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
}
.topbar .muted {
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  border-radius: 24px;
  padding: 24px;
}
.stat-card p {
  margin: 0 0 10px;
  color: var(--muted);
}
.stat-card strong {
  font-size: 1.9rem;
}

.content-grid {
  display: grid;
  gap: 20px;
}
.two-columns {
  grid-template-columns: 1fr 1fr;
}
.large-left {
  grid-template-columns: 1.45fr 0.85fr;
}
.panel {
  border-radius: 26px;
  padding: 22px;
}
.sticky-panel {
  position: sticky;
  top: 24px;
  align-self: start;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 600;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px 12px;
}

.form-grid {
  display: grid;
  gap: 16px;
}
.form-grid.dense {
  gap: 14px;
}
.form-grid label {
  display: grid;
  gap: 8px;
}
.form-grid label span {
  color: var(--muted);
  font-size: 0.92rem;
}
.form-grid .full {
  grid-column: 1 / -1;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
  transition:
    border-color 0.2s ease,
    transform 0.15s ease;
}
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: rgba(16, 25, 40, 0.03);
}
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(110, 168, 254, 0.5);
  transform: translateY(-1px);
}
textarea {
  resize: vertical;
  min-height: 120px;
}

.btn {
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  cursor: pointer;
  transition: 0.18s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 30px rgba(64, 94, 250, 0.24);
}
.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}
.btn-full {
  width: 100%;
}
.btn-sm {
  padding: 9px 12px;
  border-radius: 12px;
}

.badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.badge.deposit,
.badge.active {
  background: rgba(66, 211, 146, 0.14);
  color: var(--success);
}
.badge.withdraw,
.badge.inactive {
  background: rgba(255, 123, 138, 0.14);
  color: var(--danger);
}

.muted {
  color: var(--muted);
}
.auth-shell {
  width: 100%;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  width: min(100%, 520px);
  border-radius: 30px;
  padding: 34px;
}
.auth-card.centered {
  text-align: center;
}
.auth-header {
  text-align: center;
  margin-bottom: 24px;
}
.auth-header h1 {
  margin: 0 0 8px;
}
.auth-header p {
  margin: 0;
  color: var(--muted);
}

.hint-box {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.top-gap {
  margin-top: 16px;
}
.hint-box p,
.hint-box strong {
  margin: 0 0 8px;
}

.timeline {
  display: grid;
  gap: 16px;
}
.timeline-item {
  display: flex;
  gap: 14px;
}
.timeline-item .dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 0 6px rgba(110, 168, 254, 0.12);
}
.timeline-item p,
.timeline-item small,
.timeline-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar select {
  width: auto;
  min-width: 150px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.flash {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.flash.success {
  background: rgba(66, 211, 146, 0.12);
  color: var(--success);
}
.flash.error {
  background: rgba(255, 123, 138, 0.12);
  color: var(--danger);
}

.check-grid {
  display: grid;
  gap: 10px;
}
.check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.check input {
  width: auto;
}

@media (max-width: 1200px) {
  .stats-grid,
  .two-columns,
  .large-left {
    grid-template-columns: 1fr;
  }
  .sticky-panel {
    position: static;
  }
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
    margin: 18px;
    bottom: auto;
  }
  .main.with-sidebar {
    margin-left: 0;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .main,
  .auth-shell {
    padding: 16px;
  }
  .sidebar,
  .topbar,
  .panel,
  .auth-card,
  .stat-card {
    border-radius: 22px;
  }
  th,
  td {
    padding: 12px 10px;
  }
}

option {
  background: #0f1930;
  color: #e8eef8;
}

html[data-theme="light"] option {
  background: #ffffff;
  color: #17263b;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.table-wrap,
textarea,
select {
  scrollbar-color: rgba(159, 176, 203, 0.7) rgba(255, 255, 255, 0.04);
}

.table-wrap::-webkit-scrollbar,
textarea::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-wrap::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
  background: rgba(159, 176, 203, 0.55);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.table-wrap::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(232, 238, 248, 0.75);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.login-btn {
  position: relative;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
}

.login-btn-text,
.login-btn-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.login-btn-loading {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.login-btn.is-loading .login-btn-text {
  opacity: 0;
  transform: translateY(-8px);
}

.login-btn.is-loading .login-btn-loading {
  opacity: 1;
  transform: translateY(0);
}

.login-btn:disabled {
  cursor: wait;
  filter: saturate(1.08);
}

.login-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  animation: login-spin 0.8s linear infinite;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.18);
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

.login-btn {
  position: relative;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
}

.login-btn-text,
.login-btn-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
}

.login-btn-loading {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.login-btn.is-loading .login-btn-text {
  opacity: 0;
  transform: translateY(-8px);
}

.login-btn.is-loading .login-btn-loading {
  opacity: 1;
  transform: translateY(0);
}

.login-btn:disabled {
  cursor: wait;
  filter: saturate(1.1) brightness(1.02);
}

.login-spinner-wrap {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-block;
}

.login-spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid transparent;
}

.login-spinner-ring.ring-1 {
  border-top-color: rgba(255, 255, 255, 0.95);
  border-right-color: rgba(255, 255, 255, 0.35);
  animation: login-spin 0.75s linear infinite;
}

.login-spinner-ring.ring-2 {
  inset: 4px;
  border-bottom-color: rgba(255, 255, 255, 0.85);
  border-left-color: rgba(255, 255, 255, 0.2);
  animation: login-spin-reverse 1.1s linear infinite;
}

.login-spinner-core {
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
}

.login-status-panel {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.login-status-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.login-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.94rem;
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
  opacity: 0.78;
}

.login-status-row.active {
  color: var(--text);
  opacity: 1;
}

.login-status-row.done {
  color: var(--success);
  opacity: 1;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(159, 176, 203, 0.45);
  box-shadow: 0 0 0 6px rgba(159, 176, 203, 0.08);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.login-status-row.active .status-dot {
  background: var(--primary);
  box-shadow:
    0 0 0 6px rgba(110, 168, 254, 0.16),
    0 0 16px rgba(110, 168, 254, 0.28);
  transform: scale(1.08);
}

.login-status-row.done .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(66, 211, 146, 0.14);
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes login-spin-reverse {
  to {
    transform: rotate(-360deg);
  }
}

:root {
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
  overflow-x: hidden;
}

.bg-orb {
  animation: orb-float 10s ease-in-out infinite;
}

.orb-2 {
  animation-delay: -5s;
}

.sidebar,
.topbar,
.panel,
.stat-card,
.auth-card,
.flash,
.hint-box {
  transition:
    transform 0.35s var(--ease-out-soft),
    box-shadow 0.35s var(--ease-out-soft),
    border-color 0.28s ease,
    background 0.28s ease,
    opacity 0.35s ease;
}

.panel:hover,
.stat-card:hover,
.auth-card:hover,
.hint-box:hover {
  transform: translateY(-4px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.28),
    0 10px 24px rgba(110, 168, 254, 0.08);
}

html[data-theme="light"] .panel:hover,
html[data-theme="light"] .stat-card:hover,
html[data-theme="light"] .auth-card:hover,
html[data-theme="light"] .hint-box:hover {
  box-shadow:
    0 24px 50px rgba(31, 44, 73, 0.12),
    0 10px 20px rgba(43, 111, 247, 0.08);
}

.nav-link,
.btn,
.badge,
input,
textarea,
select,
table tbody tr {
  transition:
    transform 0.24s var(--ease-smooth),
    background-color 0.24s ease,
    color 0.24s ease,
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    opacity 0.24s ease;
}

.nav-link:hover,
.nav-link.active {
  transform: translateX(4px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(110, 168, 254, 0.25);
}

input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 4px rgba(110, 168, 254, 0.1);
}

table tbody tr {
  opacity: 0.96;
}

table tbody tr:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.035);
  opacity: 1;
}

html[data-theme="light"] table tbody tr:hover {
  background: rgba(17, 30, 49, 0.035);
}

.stat-card strong,
.topbar h2,
.panel-head h3,
.auth-header h1 {
  backface-visibility: hidden;
  transform: translateZ(0);
}

.reveal {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  transition:
    opacity 0.7s var(--ease-out-soft),
    transform 0.7s var(--ease-out-soft);
  will-change: opacity, transform;
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-24px);
  transition:
    opacity 0.7s var(--ease-out-soft),
    transform 0.7s var(--ease-out-soft);
}

.reveal-left.show {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(24px);
  transition:
    opacity 0.7s var(--ease-out-soft),
    transform 0.7s var(--ease-out-soft);
}

.reveal-right.show {
  opacity: 1;
  transform: translateX(0);
}

.reveal-delay-1 {
  transition-delay: 0.06s;
}
.reveal-delay-2 {
  transition-delay: 0.12s;
}
.reveal-delay-3 {
  transition-delay: 0.18s;
}
.reveal-delay-4 {
  transition-delay: 0.24s;
}
.reveal-delay-5 {
  transition-delay: 0.3s;
}
.reveal-delay-6 {
  transition-delay: 0.36s;
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.12),
    transparent 65%
  );
  pointer-events: none;
  transition:
    transform 0.5s var(--ease-out-soft),
    opacity 0.35s ease;
  opacity: 0.7;
}

.stat-card:hover::before {
  transform: translate(18px, 12px) scale(1.08);
  opacity: 1;
}

.flash {
  animation: flash-in 0.55s var(--ease-out-soft);
}

.login-status-panel.is-visible {
  animation: soft-pop 0.35s var(--ease-out-soft);
}

@keyframes orb-float {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -16px, 0) scale(1.04);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes flash-in {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes soft-pop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal-left,
  .reveal-right {
    opacity: 1 !important;
    transform: none !important;
  }
}

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

.merchant-summary-card {
  border-radius: 24px;
  padding: 22px;
  display: grid;
  gap: 18px;
}

.merchant-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.merchant-summary-top h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
}

.merchant-summary-top p {
  margin: 0;
}

.merchant-summary-body {
  display: grid;
  gap: 12px;
}

.merchant-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="light"] .merchant-summary-item {
  background: rgba(17, 30, 49, 0.03);
}

.merchant-summary-item span {
  color: var(--muted);
}

.merchant-summary-item strong {
  font-size: 1rem;
}

.merchant-summary-item .is-deposit {
  color: var(--success);
}

.merchant-summary-item .is-withdraw {
  color: var(--danger);
}

.merchant-summary-item.is-total {
  background: linear-gradient(
    135deg,
    rgba(110, 168, 254, 0.12),
    rgba(156, 123, 255, 0.12)
  );
  border-color: rgba(110, 168, 254, 0.2);
}

@media (max-width: 1200px) {
  .merchant-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .merchant-summary-grid {
    grid-template-columns: 1fr;
  }

  .merchant-summary-top,
  .merchant-summary-item {
    gap: 10px;
  }
}
