:root {
  --bg: #07090d;
  --bg-elev: #10141c;
  --bg-soft: #151b25;
  --line: rgba(214, 186, 122, 0.14);
  --line-strong: rgba(214, 186, 122, 0.38);
  --gold: #d6ba7a;
  --gold-soft: #b89a5c;
  --gold-bright: #f3e2b4;
  --text: #f3eee3;
  --muted: #9aa1ad;
  --danger: #ef4444;
  --ok: #22c55e;
  --warn: #d4b06a;
  --buy: #22c55e;
  --sell: #ef4444;
  --tp: #3b82f6;
  --sl-hit: #a855f7;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  --radius: 18px;
  --sidebar: 248px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Sora", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(214, 186, 122, 0.16), transparent 58%),
    radial-gradient(800px 420px at 100% 0%, rgba(59, 130, 246, 0.08), transparent 48%),
    linear-gradient(165deg, #0b1017 0%, var(--bg) 42%, #05070a 100%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.02em; margin: 0; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-shell::before {
  content: "";
  position: absolute;
  inset: -20% 20% auto;
  height: 50%;
  background: radial-gradient(circle, rgba(214,186,122,0.18), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}
.login-card {
  width: min(440px, 100%);
  background: linear-gradient(180deg, rgba(24,27,34,0.96), rgba(14,16,20,0.98));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 40px 36px 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: rise 0.7s ease both;
}
.brand-logo-lg {
  display: block;
  width: 128px;
  height: 128px;
  object-fit: contain;
  margin: 0 auto 12px;
  border-radius: 50%;
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}
.brand-mark {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--gold-bright);
  text-align: center;
}
.brand-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}
.login-card h1 {
  margin: 28px 0 8px;
  font-size: 2rem;
}
.login-card p.lead { color: var(--muted); margin: 0 0 28px; }

.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field label { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  padding: 14px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(214,186,122,0.12);
}
.field textarea { min-height: 96px; resize: vertical; }

/* Date picker — match dark gold UI (native control, styled) */
input[type="date"] {
  color-scheme: dark;
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding-right: 44px !important;
  background-image:
    linear-gradient(180deg, rgba(214,186,122,0.08), rgba(255,255,255,0.02)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3.5' y='5.5' width='17' height='15' rx='2.5' stroke='%23d6ba7a' stroke-width='1.6'/%3E%3Cpath d='M8 3.5v4M16 3.5v4M3.5 10h17' stroke='%23d6ba7a' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='9' cy='14' r='1.1' fill='%23d6ba7a'/%3E%3Ccircle cx='12.5' cy='14' r='1.1' fill='%23d6ba7a'/%3E%3Ccircle cx='16' cy='14' r='1.1' fill='%23d6ba7a'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, right 14px center;
  background-size: auto, 18px 18px;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}
input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}
input[type="date"]::-webkit-datetime-edit-text {
  color: var(--gold-soft);
  padding: 0 3px;
}
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  color: var(--gold-bright);
  padding: 2px 3px;
  border-radius: 6px;
}
input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus {
  background: rgba(214,186,122,0.16);
  color: #fff;
  outline: none;
}
input[type="date"]:hover {
  border-color: var(--line-strong);
  background-color: rgba(214,186,122,0.06);
}
input[type="date"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214,186,122,0.16);
}
input[type="date"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
}
.date-field {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 168px;
}
.date-field input[type="date"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 44px 10px 14px !important;
  background-color: rgba(255,255,255,0.02);
}
.date-field.compact input[type="date"] {
  min-height: 36px;
  min-width: 148px;
  padding: 7px 40px 7px 10px !important;
  border-radius: 10px;
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.dl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: min(340px, 100%);
  padding: 14px 18px;
  border-radius: 16px;
  text-decoration: none;
  color: #1a1208;
  background: linear-gradient(135deg, #f6e2a8 0%, #d4a84b 42%, #b8862e 100%);
  border: 1px solid rgba(255, 236, 180, 0.55);
  box-shadow:
    0 10px 28px rgba(184, 134, 46, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-download:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow:
    0 14px 34px rgba(184, 134, 46, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-download:active {
  transform: translateY(0);
  filter: brightness(0.98);
}
.btn-download-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8efd2;
  background: rgba(26, 18, 8, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.btn-download-text {
  display: grid;
  gap: 2px;
  text-align: left;
  line-height: 1.2;
}
.btn-download-text strong {
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}
.btn-download-text small {
  font-size: 0.78rem;
  opacity: 0.78;
  font-weight: 500;
}
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #e7d4a3, #b8944f);
  color: #1a1408;
  font-weight: 700;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-danger {
  background: rgba(217,120,108,0.15);
  border: 1px solid rgba(217,120,108,0.35);
  color: #f0b4ac;
}

.error {
  background: rgba(217,120,108,0.12);
  border: 1px solid rgba(217,120,108,0.35);
  color: #f0b4ac;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.flash {
  background: rgba(127,186,138,0.12);
  border: 1px solid rgba(127,186,138,0.35);
  color: #b7dfbe;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  padding: 28px 18px;
  border-right: 1px solid var(--line);
  background: rgba(10,11,13,0.72);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}
.sidebar .brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.sidebar .brand-text {
  min-width: 0;
}
.sidebar .brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--gold-bright);
  font-weight: 600;
  line-height: 1.1;
}
.sidebar .brand span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 4px;
  line-height: 1.25;
}
.nav {
  display: grid;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(214,186,122,0.45) transparent;
}
.nav::-webkit-scrollbar {
  width: 6px;
}
.nav::-webkit-scrollbar-thumb {
  background: rgba(214,186,122,0.4);
  border-radius: 999px;
}
.nav::-webkit-scrollbar-track {
  background: transparent;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
  transition: background .2s, color .2s;
}
.nav a:hover, .nav a.active {
  background: rgba(214,186,122,0.1);
  color: var(--gold-bright);
}
.nav .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; opacity: 0.7;
}
.sidebar-foot {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}
.foot-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(214,186,122,0.08);
  color: var(--gold-bright);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.main {
  padding: 28px 32px 48px;
  animation: rise 0.55s ease both;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 28px;
}
.topbar h1 { font-size: 2.35rem; }
.topbar p { margin: 6px 0 0; color: var(--muted); }

.grid {
  display: grid;
  gap: 16px;
}
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: linear-gradient(180deg, rgba(24,27,34,0.9), rgba(16,18,23,0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.card h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.card .muted { color: var(--muted); font-size: 0.9rem; }
.stat-value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--gold-bright);
  margin-top: 10px;
  line-height: 1;
}
.stat-value small {
  font-size: 1rem;
  color: var(--muted);
  margin-left: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  color: var(--gold);
}
.badge.ok { color: var(--ok); border-color: rgba(127,186,138,0.35); }
.badge.warn { color: var(--warn); border-color: rgba(212,176,106,0.35); }
.badge.danger { color: var(--danger); border-color: rgba(217,120,108,0.35); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: rgba(255,255,255,0.015); }

.bars {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.bar-row { display: grid; grid-template-columns: 72px 1fr 64px; gap: 10px; align-items: center; }
.bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold-bright));
  width: 0;
  animation: grow 0.9s ease forwards;
}
.bar-row span:last-child { text-align: right; color: var(--muted); font-size: 0.82rem; }

.settings-form {
  display: grid;
  gap: 18px;
}
.settings-section h2 {
  font-size: 1.45rem;
  margin-bottom: 14px;
  color: var(--gold-bright);
}
.settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.empty {
  color: var(--muted);
  padding: 24px 8px;
  text-align: center;
}

.chart-panel { overflow: hidden; }
.tf-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(214, 186, 122, 0.35);
  background: #161922;
  position: relative;
  z-index: 5;
}
button.tf-btn,
a.tf-btn,
.tf-btn {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(214, 186, 122, 0.28) !important;
  background: #1e2330 !important;
  color: #f0e2bc !important;
  font-family: var(--font-body) !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  line-height: 1 !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  min-width: 56px;
  min-height: 40px;
  text-decoration: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}
button.tf-btn:hover,
.tf-btn:hover {
  background: #2a3142 !important;
  color: #fff8e7 !important;
  border-color: rgba(214, 186, 122, 0.55) !important;
}
button.tf-btn.active,
.tf-btn.active {
  background: linear-gradient(135deg, #e7d4a3, #b8944f) !important;
  color: #1a1408 !important;
  border-color: transparent !important;
  box-shadow: 0 0 0 1px rgba(214, 186, 122, 0.45) !important;
}
.chart-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 8px 12px;
}
.bar-left {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}
.bar-left.urgent { color: #f0b4ac; }
.tv-chart {
  position: relative;
  width: 100%;
  min-height: 640px;
  height: min(78vh, 920px);
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.chart-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}
.chart-pin {
  position: absolute;
  width: 12px;
  margin-left: -6px;
  pointer-events: auto;
  cursor: default;
}
.chart-pin-line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  transform: translateX(-50%);
  background: currentColor;
  opacity: 0.75;
}
.chart-pin-dot {
  position: absolute;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  border: 1.5px solid #0f1116;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px currentColor;
}
.chart-pin-tip {
  position: absolute;
  z-index: 6;
  display: none;
  pointer-events: none;
  padding: 7px 11px;
  border-radius: 8px;
  background: rgba(18, 20, 26, 0.96);
  border: 1px solid rgba(214, 186, 122, 0.35);
  color: #f2ead8;
  font-size: 0.78rem;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-pin-tip.show {
  display: block;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 8px 4px;
  color: var(--muted);
  font-size: 0.85rem;
}
.legend .swatch {
  display: inline-block;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.legend .swatch.entry { background: #d6ba7a; }
.legend .swatch.sl { background: #d9786c; }
.legend .swatch.tp1 { background: #7fba8a; }
.legend .swatch.tp2 { background: #8ec8ff; }
.legend .swatch.pin {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d6ba7a;
}
.legend .swatch.pin.buy { background: var(--buy); }
.legend .swatch.pin.sell { background: var(--sell); }
.legend .swatch.pin.tp { background: var(--tp); }
.legend .swatch.pin.slhit { background: var(--sl-hit); }

.cal-focus .check {
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-focus select {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
}
.cal-toolbar {
  display: grid;
  gap: 16px;
}
.cal-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.cal-tab {
  text-align: center;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.02);
  transition: background .2s, color .2s, border-color .2s;
}
.cal-tab:hover, .cal-tab.active {
  color: var(--gold-bright);
  border-color: var(--line-strong);
  background: rgba(214,186,122,0.1);
}
.cal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.cal-period {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--gold-bright);
  text-align: center;
  flex: 1;
  min-width: 180px;
}
.cal-summary .cal-stat { position: relative; overflow: hidden; }
.cal-summary .cal-dot {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.cal-stat.cal-red .cal-dot, .cal-swatch.red, .news-pill.red, .dot-count.red { background: #d9786c; }
.cal-stat.cal-orange .cal-dot, .cal-swatch.orange, .news-pill.orange, .dot-count.orange { background: #e09854; }
.cal-stat.cal-yellow .cal-dot, .cal-swatch.yellow, .news-pill.yellow, .dot-count.yellow { background: #d4b06a; }
.cal-stat.cal-black .cal-dot, .cal-swatch.black, .news-pill.black, .dot-count.black { background: #6b6f78; }
.cal-stat.cal-red .stat-value { color: #f0b4ac; }
.cal-stat.cal-orange .stat-value { color: #f0c49a; }
.cal-stat.cal-yellow .stat-value { color: #e8d19a; }
.cal-stat.cal-black .stat-value { color: #c4c7ce; }
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 14px;
}
.news-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #12141a;
  margin-right: 6px;
}
.cal-day-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.cal-day-counts { display: flex; gap: 8px; }
.cal-crumb a { color: var(--gold); }
.cal-year-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.cal-month-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}
.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}
.cal-cell {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  min-height: 96px;
  transition: transform .15s ease, border-color .2s, background .2s;
}
.cal-cell:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(214,186,122,0.08);
}
.cal-cell.today {
  border-color: rgba(214,186,122,0.55);
  box-shadow: inset 0 0 0 1px rgba(214,186,122,0.25);
}
.cal-cell.outside { opacity: 0.45; }
.cal-cell-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 10px;
}
.cal-cell-top strong { font-size: 1rem; }
.cal-mini-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dot-count {
  display: inline-flex;
  min-width: 28px;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #12141a;
}
.cal-preview {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.cal-preview li {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
@media (max-width: 1100px) {
  .cal-year-grid, .cal-week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .cal-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-year-grid, .cal-week-grid { grid-template-columns: 1fr; }
  .cal-month-grid, .cal-month-head { gap: 6px; }
  .cal-cell { min-height: 72px; padding: 10px; }
}

.order-filters {
  display: grid;
  gap: 10px;
}
.session-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.session-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  background: rgba(255,255,255,0.02);
}
.session-chip.active, .session-chip:hover {
  color: var(--gold-bright);
  border-color: var(--line-strong);
  background: rgba(214,186,122,0.1);
}
.session-chip.static { cursor: default; }
.order-cal-head, .order-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.order-cal-head { margin-bottom: 8px; text-align: center; font-size: 0.8rem; }
.order-cal-cell {
  min-height: 96px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  transition: border-color .15s, background .15s;
}
.order-cal-cell:hover { border-color: var(--line-strong); background: rgba(214,186,122,0.06); }
.order-cal-cell.out { opacity: 0.35; }
.order-cal-cell.today { box-shadow: inset 0 0 0 1px rgba(214,186,122,0.45); }
.order-cal-cell.has { background: rgba(34,197,94,0.05); }
.order-cal-day { font-weight: 600; }
.order-cal-wr { margin-top: 8px; color: var(--gold-bright); font-size: 0.85rem; }
.order-cal-mini { margin-top: 4px; color: var(--muted); font-size: 0.72rem; }
.order-cal-count { margin-top: 6px; font-size: 0.72rem; color: #b7dfbe; }
.order-cal-pnl { margin-top: 4px; font-size: 0.78rem; font-weight: 600; }
.order-cal-pnl.pos, .order-pnl-table .pos, .order-day-item .pos { color: #22c55e; }
.order-cal-pnl.neg, .order-pnl-table .neg, .order-day-item .neg { color: #ef4444; }
.order-pnl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.order-pnl-table th, .order-pnl-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.order-pnl-table th { color: var(--muted); font-weight: 500; }
.order-pnl-table tr.row-tp td:nth-child(6) { color: #3b82f6; }
.order-pnl-table tr.row-sl td:nth-child(6) { color: #a855f7; }
.order-pnl-table tr.row-open td:nth-child(6) { color: var(--warn); }
.order-day-list { display: grid; gap: 10px; }
.order-day-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  display: grid;
  gap: 8px;
  font-size: 0.86rem;
  line-height: 1.45;
}
.order-day-item.status-tp { border-color: rgba(59,130,246,0.35); }
.order-day-item.status-sl { border-color: rgba(168,85,247,0.35); }
.order-day-item.status-open { border-color: rgba(212,176,106,0.35); }
.order-day-open { color: var(--text); }
.order-day-close { color: #cfd6e2; }
@media (max-width: 860px) {
  .order-cal-cell { min-height: 78px; padding: 8px; }
  .order-cal-mini { display: none; }
}

/* Analytics · Spend (OpenAI-style layout, SIG gold theme) */
.spend-topbar { align-items: end; gap: 16px; }
.spend-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.spend-hero { padding: 22px 22px 12px; }
.spend-hero-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.spend-total {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3rem);
  color: var(--gold-bright);
  line-height: 1.1;
  margin-top: 4px;
}
.spend-limit {
  min-width: min(280px, 100%);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}
.spend-limit-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 6px 0 10px;
  font-variant-numeric: tabular-nums;
}
.spend-limit-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.spend-limit-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}
.spend-chart {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.spend-chart-svg {
  width: 100%;
  height: 200px;
  display: block;
}
.spend-chart-axis {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  overflow: hidden;
}
.spend-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: -4px 0 0;
  overflow-x: auto;
}
.spend-tabs a {
  padding: 12px 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-size: 0.92rem;
}
.spend-tabs a:hover { color: var(--text); }
.spend-tabs a.active {
  color: var(--text);
  border-bottom-color: #fff;
}
.spend-table { width: 100%; margin-top: 4px; }
.spend-table th, .spend-table td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.spend-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0;
}
.spend-item-name { font-weight: 500; }
.col-trend { width: 140px; text-align: center; }
.col-spend { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.spark { display: inline-block; vertical-align: middle; }
.spend-table-card { padding-top: 8px; }
@media (max-width: 860px) {
  .col-trend { display: none; }
  .spend-total { font-size: 2rem; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes grow {
  from { width: 0; }
  to { width: var(--w); }
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    max-height: none;
  }
  .main { padding: 20px 16px 36px; }
  .topbar { flex-direction: column; align-items: start; }
  .grid-4 { grid-template-columns: 1fr; }
}
