/* Tailwind-inspired mobile-first fintech theme */
:root {
  --bg: #020617;
  --surface: #0f1728;
  --surface-strong: #111827;
  --border: rgba(255,255,255,0.08);
  --muted: #94a3b8;
  --text: #f8fafc;
  --accent: #22c55e;
  --accent-strong: #16a34a;
  --danger: #f97316;
  --glass: rgba(15, 23, 42, 0.64);
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.24);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.w-full { width: 100%; }
.max-w-6xl { max-width: 76rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.875rem; }
.rounded-xl { border-radius: 1rem; }
.rounded-2xl { border-radius: 1.25rem; }
.rounded-3xl { border-radius: 1.5rem; }
.shadow-2xl { box-shadow: 0 28px 60px rgba(0,0,0,0.24); }
.border { border: 1px solid var(--border); }
.border-slate-800 { border-color: #1f2937; }
.bg-slate-950 { background: #020617; }
.bg-slate-900 { background: #0f1728; }
.bg-slate-800 { background: #111827; }
.bg-gradient-to-r { background-image: linear-gradient(90deg, var(--tw-gradient-from), var(--tw-gradient-to)); }
.from-emerald-500 { --tw-gradient-from: #22c55e; }
.to-lime-400 { --tw-gradient-to: #84cc16; }
.text-slate-950 { color: #0f1720; }
.text-slate-100 { color: #f8fafc; }
.text-slate-400 { color: #94a3b8; }
.text-slate-300 { color: #cbd5e1; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.08em; }
.transition-transform { transition: transform 0.18s ease; }
.hover\:-translate-y-0\.5:hover { transform: translateY(-0.125rem); }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-action { grid-template-columns: 1fr auto; }
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), transparent 26%), radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 28%), var(--bg);
  color: var(--text);
}
button,
input,
select,
textarea {
  font: inherit;
}
img {
  max-width: 100%;
  display: block;
}
:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.9);
  outline-offset: 3px;
}

/* Layout */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.main {
  flex: 1;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 96px;
}
.card,
.market-card,
.order-card,
.chart-card,
.summary-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.86));
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.card {
  padding: 24px;
}
.card h3,
.section-header h3 {
  margin: 0 0 18px;
  color: #e2e8f0;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
}

/* Forms */
.grid-form {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.grid-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}
.grid-form input,
.grid-form select,
.search-panel input,
.action-row input {
  width: 100%;
  min-height: 48px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
}
.grid-form input::placeholder,
.search-panel input::placeholder,
.action-row input::placeholder {
  color: rgba(148, 163, 184, 0.8);
}
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}
button,
.btn,
.action-btn,
.icon-btn {
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
button:hover,
.btn:hover,
.action-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}
.btn,
.action-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #4ade80);
  color: #071508;
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(34, 197, 94, 0.16);
}
.btn-quiet {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  width: auto;
  min-width: 120px;
}
.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}
.topbar h2 {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.3rem;
}
.bottom-nav .icon {
  font-size: 1.2rem;
}

/* Components */
.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 18px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 30;
}
.mobile-header .brand {
  font-size: 1.3rem;
  font-weight: 800;
}
.mobile-header .subline {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}
.header-actions {
  display: flex;
  gap: 10px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}
.hero-panel {
  display: grid;
  gap: 22px;
  grid-template-columns: 1.9fr 1fr;
  align-items: stretch;
}
.hero-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 34px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.80));
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.hero-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.04;
  font-weight: 800;
  max-width: 720px;
}
.hero-subtitle {
  color: rgba(226, 232, 240, 0.78);
  font-size: 1rem;
  max-width: 680px;
  line-height: 1.8;
}
.hero-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-btn {
  width: auto;
  min-width: 160px;
  max-width: fit-content;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 18px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.hero-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.hero-btn:hover,
.hero-btn.secondary:hover {
  transform: translateY(-1px);
}
.metrics-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.metrics-card {
  padding: 20px 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.metrics-card .label {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.metrics-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #f8fafc;
}
.box-title {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.box-title h3 {
  margin: 0;
  font-size: 1.2rem;
}
.box-title span {
  color: var(--muted);
  font-size: 0.95rem;
}
.feature-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.feature-card {
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(34, 197, 94, 0.05);
}
.feature-card h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.feature-card p {
  color: rgba(226, 232, 240, 0.78);
  margin: 0 0 18px;
  line-height: 1.7;
}
.feature-link {
  color: #86efac;
  text-decoration: none;
  font-weight: 700;
}
.feature-link:hover {
  text-decoration: underline;
}
.stats-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stats-card {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.stats-card small {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stats-card strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: #f8fafc;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: #d9f99d;
  font-size: 0.92rem;
  font-weight: 700;
}
#activityLog {
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5e1;
  border-radius: 20px;
  padding: 18px;
  white-space: pre-wrap;
  word-break: break-word;
}

.summary-row,
.quick-actions {
  display: grid;
  gap: 16px;
}
.summary-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}
.summary-card {
  padding: 18px 20px;
}
.card-list {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.market-card,
.order-card,
.summary-card {
  min-height: 140px;
}
.market-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  grid-template-columns: 1fr;
}
.order-card {
  display: grid;
  gap: 12px;
  padding: 20px;
}
.watch-symbol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 1rem;
}
.watch-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.watch-delta {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}
.watch-delta-up {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.14);
}
.watch-delta-down {
  color: #fb923c;
  background: rgba(248, 113, 16, 0.14);
}
.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.tab-row .tab {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  cursor: pointer;
  font-weight: 600;
}
.tab-row .tab.active {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.24);
  color: #d9f99d;
}
.btn-quiet {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  width: auto;
  min-width: 0;
}
.dash-card strong {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}
.dash-card .val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}
.summary-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.summary-value {
  font-size: 1.35rem;
  font-weight: 800;
}

.card-list {
  display: grid;
  gap: 16px;
}
.table-wrapper {
  overflow-x: auto;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
}
thead th {
  text-align: left;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
tbody tr {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
}
tbody td {
  padding: 16px 18px;
  color: var(--text);
  vertical-align: middle;
}
tbody tr td:first-child {
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
}
tbody tr td:last-child {
  border-top-right-radius: 18px;
  border-bottom-right-radius: 18px;
}
.market-card,
.order-card {
  padding: 20px;
}
.market-card {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  align-items: center;
}
.market-price {
  font-size: 1.4rem;
  font-weight: 800;
}
.market-meta,
.order-meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}
.market-seg {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  font-size: 0.78rem;
}
.watch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}
.watch-price {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.watch-delta {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}
.watch-delta-up {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}
.watch-delta-down {
  color: #fb923c;
  background: rgba(248, 113, 16, 0.14);
}
.order-warnings {
  margin: 6px 0 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(248, 113, 16, 0.08);
  border: 1px solid rgba(248, 113, 16, 0.18);
  color: #f8d7ca;
}
.warning-ok {
  color: #d1fae5;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.18);
  padding: 12px 14px;
  border-radius: 16px;
}
.warning-item {
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: rgba(248, 113, 16, 0.08);
  border: 1px solid rgba(248, 113, 16, 0.16);
  color: #f8d7ca;
  font-size: 0.95rem;
  line-height: 1.5;
}
.order-cta {
  align-self: flex-start;
  width: auto;
  min-width: 140px;
}
.order-card .order-meta {
  color: rgba(148, 163, 184, 0.92);
  font-size: 0.92rem;
  line-height: 1.65;
}
.chart-card {
  padding: 22px;
}
.chart-card canvas {
  width: 100% !important;
  height: 260px !important;
}
.market-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.5fr 1fr;
}
.market-meta {
  color: rgba(148, 163, 184, 0.92);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-top: 16px;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d9f99d;
  font-size: 0.86rem;
  font-weight: 700;
  margin-top: 14px;
}
.status-chip.status-ok {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.24);
}
.status-chip.status-warn {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.24);
}
.status-chip.status-bad {
  color: #fb7185;
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.24);
}
.pnl-summary-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}
.provider-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.quick-actions {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 18px;
}
.action-btn {
  text-decoration: none;
  justify-content: center;
  align-items: center;
  display: inline-flex;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(34, 197, 94, 0.12);
  color: #e2e8f0;
  font-weight: 700;
}
.empty-state {
  padding: 22px 20px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 10px 0;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 40;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: rgba(226, 232, 240, 0.88);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 8px 0;
}
.bottom-nav a.active {
  color: #86efac;
}
.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.tab {
  flex: 1 1 120px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  cursor: pointer;
  font-weight: 600;
}
.tab.active {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.28);
  color: #d9f99d;
}
.search-panel input,
.action-row input {
  background: rgba(255, 255, 255, 0.05);
}
.action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 18px;
}
.estimate-block {
  grid-column: 1 / -1;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #d1d5db;
}

/* Utility */
.text-muted {
  color: var(--muted);
}
.bg-surface {
  background: var(--surface);
}
.rounded-xl {
  border-radius: 24px;
}

/* Responsive tweaks */
@media (max-width: 900px) {
  .main {
    width: calc(100% - 30px);
  }
  .market-card,
  .order-card,
  .chart-card,
  .summary-card {
    border-radius: 24px;
  }
}
@media (max-width: 720px) {
  .main {
    width: calc(100% - 24px);
    padding-bottom: 120px;
  }
  .mobile-header {
    align-items: stretch;
  }
  .hero-panel,
  .metrics-row,
  .stats-grid,
  .feature-grid,
  .summary-row,
  .action-row,
  .grid-form,
  .quick-actions,
  .tab-row,
  .card-list {
    grid-template-columns: 1fr;
  }
  .hero-panel {
    gap: 18px;
  }
  .hero-card {
    padding: 24px;
  }
  .hero-btn {
    width: 100%;
  }
  .market-card,
  .order-card {
    grid-template-columns: 1fr;
  }
  .tab-row .tab {
    flex: 1 1 100%;
  }
  .form-actions {
    justify-content: stretch;
  }
  .action-btn,
  .btn,
  .btn-quiet {
    min-width: 0;
  }
}
@media (max-width: 520px) {
  .mobile-header {
    padding-inline: 14px;
  }
  .card,
  .market-card,
  .order-card,
  .chart-card,
  .summary-card {
    padding: 18px;
  }
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 10px);
  }
}
