/* FinanceESWB - pure black background, green titles/accents, very light green body text. */
:root {
  --eswb-black: #000000;
  --eswb-panel: #070c09;
  --eswb-panel-2: #0c130e;
  --eswb-line: #17331f;
  --eswb-line-soft: #102117;
  --eswb-green: #22c55e;
  --eswb-green-light: #4ade80;
  --eswb-green-dark: #15803d;
  --eswb-text: #dcf7e4;
  --eswb-muted: #86b899;
  --eswb-danger: #f87171;
  --eswb-warn: #fbbf24;
  color-scheme: dark;
}

* { -webkit-tap-highlight-color: rgba(34, 197, 94, .18); }

html, body {
  background: var(--eswb-black);
  color: var(--eswb-text);
  font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  min-height: 100%;
}

body {
  overscroll-behavior-y: none;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3, h4, .eswb-title { color: var(--eswb-green); font-weight: 700; letter-spacing: .2px; }

a { color: var(--eswb-green-light); }
a:hover { color: #86efac; }

.eswb-panel {
  background: var(--eswb-panel);
  border: 1px solid var(--eswb-line);
  border-radius: 14px;
}
.eswb-panel-2 { background: var(--eswb-panel-2); }

.eswb-muted { color: var(--eswb-muted); }

/* ---------------- Forms ---------------- */
.eswb-label {
  display: block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--eswb-muted);
  margin-bottom: .35rem;
  font-weight: 600;
}
.eswb-input, .eswb-select, .eswb-textarea {
  width: 100%;
  background: #050805;
  border: 1px solid var(--eswb-line);
  border-radius: 10px;
  padding: .7rem .8rem;
  color: var(--eswb-text);
  font-size: 1rem;
  line-height: 1.3;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
}
.eswb-textarea { min-height: 5rem; resize: vertical; }
.eswb-input:focus, .eswb-select:focus, .eswb-textarea:focus {
  outline: none;
  border-color: var(--eswb-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
}
.eswb-input::placeholder { color: #3f6b4e; }
.eswb-input:disabled, .eswb-select:disabled { opacity: .55; }

.eswb-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2322c55e'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 1.25rem;
  padding-right: 2.2rem;
}

.eswb-check {
  width: 1.15rem; height: 1.15rem;
  accent-color: var(--eswb-green);
  border-radius: 4px;
}

/* ---------------- Buttons ---------------- */
.eswb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .08s ease;
  min-height: 2.75rem;
}
.eswb-btn:active { transform: translateY(1px); }
.eswb-btn-primary { background: var(--eswb-green); color: #04140a; }
.eswb-btn-primary:hover { background: var(--eswb-green-light); }
.eswb-btn-outline { border-color: var(--eswb-line); color: var(--eswb-text); background: transparent; }
.eswb-btn-outline:hover { border-color: var(--eswb-green); color: var(--eswb-green-light); }
.eswb-btn-danger { background: #7f1d1d; color: #fee2e2; }
.eswb-btn-danger:hover { background: #991b1b; }
.eswb-btn-ghost { background: transparent; color: var(--eswb-muted); }
.eswb-btn-ghost:hover { color: var(--eswb-green-light); }
.eswb-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- Tables ---------------- */
.eswb-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.eswb-table thead th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--eswb-green);
  padding: .6rem .65rem;
  border-bottom: 1px solid var(--eswb-line);
  white-space: nowrap;
  background: var(--eswb-panel-2);
  position: sticky; top: 0; z-index: 1;
}
.eswb-table tbody td {
  padding: .6rem .65rem;
  border-bottom: 1px solid var(--eswb-line-soft);
  vertical-align: top;
}
.eswb-table tbody tr:hover { background: rgba(34, 197, 94, .05); }
.eswb-table tfoot td {
  padding: .6rem .65rem;
  border-top: 1px solid var(--eswb-line);
  font-weight: 700;
  color: var(--eswb-green-light);
}
.eswb-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eswb-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------------- Badges ---------------- */
.eswb-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.st-scheduled     { color: #93c5fd; }
.st-cash_invested { color: #fcd34d; }
.st-buying        { color: #f0abfc; }
.st-in_transit    { color: #7dd3fc; }
.st-selling       { color: var(--eswb-green-light); }
.st-finalized     { color: #9ca3af; }

/* ---------------- Layout ---------------- */
.eswb-drawer {
  position: fixed; inset: 0 auto 0 0;
  width: min(86vw, 20rem);
  transform: translateX(-100%);
  transition: transform .22s ease;
  z-index: 60;
  background: var(--eswb-panel);
  border-right: 1px solid var(--eswb-line);
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}
.eswb-drawer.open { transform: translateX(0); }
.eswb-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(2px);
  z-index: 55;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.eswb-backdrop.open { opacity: 1; pointer-events: auto; }

@media (min-width: 1024px) {
  .eswb-drawer { transform: translateX(0); position: sticky; top: 0; height: 100vh; width: 18rem; }
  .eswb-backdrop { display: none; }
}

.eswb-navlink {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .75rem;
  border-radius: 9px;
  color: var(--eswb-text);
  font-size: .92rem;
  text-decoration: none;
}
.eswb-navlink:hover { background: rgba(34, 197, 94, .1); color: var(--eswb-green-light); }
.eswb-navlink.active {
  background: rgba(34, 197, 94, .16);
  color: var(--eswb-green-light);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--eswb-green);
}
.eswb-navsection {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .11em;
  color: var(--eswb-green); font-weight: 700;
  padding: .5rem .75rem .3rem;
  display: flex; align-items: center; gap: .45rem;
}

/* ---------------- Flash / modal ---------------- */
.eswb-flash { border-left: 3px solid; }
.flash-success { border-color: var(--eswb-green); background: rgba(34, 197, 94, .1); color: #bbf7d0; }
.flash-error   { border-color: var(--eswb-danger); background: rgba(248, 113, 113, .1); color: #fecaca; }
.flash-warning { border-color: var(--eswb-warn); background: rgba(251, 191, 36, .1); color: #fde68a; }

.eswb-modal {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, .8);
}
.eswb-modal.open { display: flex; }

/* ---------------- Misc ---------------- */
.eswb-kpi { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--eswb-green-light); }
.eswb-progress { height: .45rem; border-radius: 999px; background: #10231a; overflow: hidden; }
.eswb-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--eswb-green-dark), var(--eswb-green-light)); }

.eswb-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #050805; }
::-webkit-scrollbar-thumb { background: #1c3d29; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--eswb-green-dark); }

@media print {
  .eswb-noprint { display: none !important; }
  body { background: #fff; color: #000; }
  .eswb-panel { border-color: #999; }
  h1, h2, h3 { color: #065f46; }
}
