@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --radius: 1rem;
  --background: #f8fafc;
  --foreground: #102a43;
  --card: #ffffff;
  --card-foreground: #102a43;
  --primary: #10b981;
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #ecfdf5;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #e2e8f0;
  --navy: #102a43;
  --navy-foreground: #f8fafc;
  --navy-soft: #243b53;
  --success-dark: #047857;
  --success-soft: #d1fae5;
  --gold: #f5b942;
  --gold-soft: #fef9c3;
  --warning-soft: #fef3c7;
  --danger-soft: #fee2e2;
  --info: #3b82f6;
  --info-soft: #dbeafe;
  --chart-1: #10b981;
  --chart-2: #102a43;
  --chart-3: #f5b942;
  --shadow-card: 0 1px 2px rgb(16 42 67 / 5%), 0 4px 16px -6px rgb(16 42 67 / 8%);
  --sidebar: #102a43;
  --sidebar-foreground: #e2e8f0;
  --sidebar-accent: #243b53;
  --sidebar-accent-foreground: #ffffff;
  --sidebar-border: #334e68;
  --sidebar-primary: #10b981;
}

html {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  margin: 0;
  min-height: 100dvh;
  touch-action: manipulation;
}

.wk-app-shell {
  display: flex;
  min-height: 100svh;
  background: var(--background);
}

.wk-app-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.wk-app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

* {
  -webkit-tap-highlight-color: transparent;
}

input, select, textarea, button {
  font-size: 16px;
  touch-action: manipulation;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.card-surface {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.125rem;
  box-shadow: var(--shadow-card);
}

.wk-input {
  width: 100%;
  height: 3rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0 0.875rem;
  font-size: 16px;
  background: #fff;
  box-sizing: border-box;
  color: #102a43;
  text-align: left;
}

.wk-input::placeholder {
  color: #94a3b8;
  text-align: left;
  opacity: 1;
}

.wk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0 1rem;
  height: 2.5rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.wk-btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.wk-btn-navy {
  background: var(--navy);
  color: var(--navy-foreground);
}

.wk-btn-outline {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--navy);
}

.wk-pin {
  letter-spacing: 0.35em;
  text-align: center;
  font-size: 1.25rem;
}

.wk-pin-slots {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--wk-pin-cols, 4), minmax(0, 1fr));
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.wk-pin-slot {
  display: grid;
  place-items: center;
  width: 100%;
  height: 3rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #fff;
  text-align: center;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wk-pin-slot.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}

.wk-pin-capture {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0.02;
  color: transparent;
  caret-color: transparent;
  background: transparent;
  font-size: 16px;
  letter-spacing: 2.5em;
  outline: none;
}

.wk-pin-toggle {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--muted-foreground);
  cursor: pointer;
}

.wk-pin-toggle:hover {
  background: var(--muted);
  color: var(--navy);
}

.wk-auth-signup {
  display: flex;
  height: 3rem;
  width: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: 2px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, #fff);
  font-size: 1rem;
  font-weight: 700;
  color: var(--success-dark);
  text-decoration: none;
}

.wk-auth-signup:hover {
  background: color-mix(in srgb, var(--primary) 14%, #fff);
}

.wk-pay-ok {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success-dark);
  animation: wk-pay-pop 0.45s ease;
}

.wk-pay-ok svg {
  width: 2.25rem;
  height: 2.25rem;
}

@keyframes wk-pay-pop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

.wk-pay-wait-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--primary);
  animation: wk-pay-pulse 1s ease-in-out infinite;
}

@keyframes wk-pay-pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

.wk-amount-input {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: left;
  color: #102a43;
  height: 3.5rem;
}

details > summary::-webkit-details-marker {
  display: none;
}

.divide-y > * + * {
  border-top: 1px solid var(--border);
}

.wk-admin-table thead th {
  padding-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.wk-admin-table tbody tr {
  border-top: 1px solid var(--border);
}

.wk-admin-table tbody td {
  padding: 0.5rem 0.25rem;
  vertical-align: middle;
}

.wk-admin-tx-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.875rem;
  border: 1px solid var(--border);
  background: var(--card, #fff);
  padding: 0.65rem 0.75rem;
}

.wk-admin-tx-icon {
  display: grid;
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
  place-items: center;
  border-radius: 0.75rem;
}

.wk-admin-tx-icon.tone-success { background: var(--success-soft); color: var(--success-dark); }
.wk-admin-tx-icon.tone-navy { background: var(--secondary); color: var(--navy); }
.wk-admin-tx-icon.tone-info { background: var(--info-soft); color: var(--info); }
.wk-admin-tx-icon.tone-gold { background: var(--gold-soft); color: var(--foreground); }
.wk-admin-tx-icon.tone-muted { background: var(--muted); color: var(--muted-foreground); }

.wk-admin-tx-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.wk-admin-tx-badge::before {
  content: '';
  height: 6px;
  width: 6px;
  border-radius: 9999px;
  background: currentColor;
  opacity: 0.7;
}

.wk-admin-tx-badge.status-completed,
.wk-admin-tx-badge.status-paid { background: var(--success-soft); color: var(--success-dark); }
.wk-admin-tx-badge.status-pending,
.wk-admin-tx-badge.status-pending-review { background: var(--warning-soft); color: var(--foreground); }
.wk-admin-tx-badge.status-processing { background: var(--info-soft); color: var(--info); }
.wk-admin-tx-badge.status-failed { background: var(--danger-soft); color: var(--destructive); }
.wk-admin-tx-badge.status-reversed { background: var(--muted); color: var(--muted-foreground); }

.chart-flow {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  height: 18rem;
}

.chart-flow-month {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
}

.chart-flow-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.chart-flow-bars span {
  flex: 1;
  max-width: 0.65rem;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}

.chart-flow-bars .dep { background: var(--chart-1); }
.chart-flow-bars .wd { background: var(--chart-2); }
.chart-flow-bars .inv { background: var(--chart-3); }

.chart-flow-label {
  font-size: 10px;
  color: var(--muted-foreground);
  text-transform: capitalize;
}

.wk-switch {
  position: relative;
  display: inline-flex;
  width: 2.75rem;
  height: 1.55rem;
  flex-shrink: 0;
}
.wk-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}
.wk-switch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--muted);
  transition: background 0.15s ease;
}
.wk-switch span::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
  transition: transform 0.15s ease;
}
.wk-switch input:checked + span {
  background: var(--primary);
}
.wk-switch input:checked + span::after {
  transform: translateX(1.2rem);
}
.wk-switch input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Fallbacks when Tailwind JIT has not run yet */
.bg-background { background-color: var(--background) !important; }
.bg-navy { background-color: var(--navy) !important; }
.bg-primary { background-color: var(--primary) !important; }
.bg-sidebar { background-color: var(--sidebar) !important; }
.text-navy { color: var(--navy) !important; }
.text-navy-foreground { color: var(--navy-foreground) !important; }
.text-primary-foreground { color: var(--primary-foreground) !important; }
.text-success-dark { color: var(--success-dark) !important; }
.text-muted-foreground { color: var(--muted-foreground) !important; }

.wk-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  z-index: 50;
  background: #fff;
  color: #0f172a;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.wk-tabbar-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
}

.wk-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  height: 4rem;
  margin: 0;
  padding: 0;
  color: #0f172a;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  background: transparent;
  border-radius: 0;
  transform: none !important;
  transition: none !important;
  animation: none !important;
  touch-action: manipulation;
}

.wk-tab svg {
  flex-shrink: 0;
  transform: none !important;
}

.wk-tab.is-active {
  color: #047857;
  background: #ecfdf5;
}

.wk-tab:active,
.wk-tab:focus,
.wk-tab:hover {
  transform: none !important;
}

#wk-invest-pay-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
}
#wk-invest-pay-modal.hidden {
  display: none !important;
}
