/* ============================================
   TradeDesk API Console
   Dhan HQ Developer Sandbox aesthetic
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Dhan API console palette */
  --bg-0: #06090f;          /* deepest */
  --bg-1: #0b1018;          /* main bg */
  --bg-2: #111826;          /* panels */
  --bg-3: #182234;          /* hover */
  --bg-4: #1f2b40;          /* borders soft */

  --border:    #1f2937;
  --border-2:  #2b3a52;
  --border-3:  #3b4d6c;

  --text:      #e6edf7;
  --text-2:    #94a3b8;
  --text-3:    #5b6678;
  --text-4:    #3d4658;

  /* Dhan brand colors */
  --primary:   #00d4ff;     /* cyan accent */
  --primary-2: #0099cc;
  --primary-d: rgba(0,212,255,0.12);

  --buy:       #00d97e;     /* terminal green */
  --buy-d:     rgba(0,217,126,0.12);
  --buy-2:     rgba(0,217,126,0.25);

  --sell:      #ff4757;     /* alert red */
  --sell-d:    rgba(255,71,87,0.12);
  --sell-2:    rgba(255,71,87,0.25);

  --warn:      #ffa500;
  --warn-d:    rgba(255,165,0,0.12);

  --purple:    #a78bfa;
  --purple-d:  rgba(167,139,250,0.12);

  --mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, sans-serif;
}

html, body {
  background: var(--bg-1);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Subtle grid texture on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

code, pre, .mono { font-family: var(--mono); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   TOP STATUS STRIP
   ============================================ */
.strip {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 32px;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11px;
  z-index: 200;
}

.strip-section {
  display: flex;
  align-items: center;
  gap: 6px;
}
.strip-section.right { margin-left: auto; }

.strip-label {
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.strip-value {
  color: var(--text);
  font-weight: 600;
}

.strip-pill {
  background: var(--primary-d);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid rgba(0,212,255,0.3);
  font-size: 10px;
  letter-spacing: 0.5px;
}

.strip-pill.post-pill {
  background: var(--buy-d);
  color: var(--buy);
  border-color: var(--buy-2);
}

.strip-link {
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}
.strip-link:hover { color: var(--primary); text-decoration: none; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-live {
  background: var(--buy);
  box-shadow: 0 0 8px var(--buy), 0 0 0 2px rgba(0,217,126,0.15);
  animation: pulse 2s ease-in-out infinite;
}
.dot-dead { background: var(--sell); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  top: 32px;
  left: 0;
  width: 260px;
  height: calc(100vh - 32px);
  background: var(--bg-0);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.brand {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: var(--primary-d);
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: 6px;
  color: var(--primary);
}

.brand-bracket {
  color: var(--primary);
  opacity: 0.6;
}

.brand-text {
  margin: 0 1px;
  color: var(--text);
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.brand-tag {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-family: var(--mono);
  margin-top: 2px;
}

.nav-section {
  padding: 16px 10px;
  border-bottom: 1px solid var(--border);
}

.nav-section-title {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-4);
  text-transform: lowercase;
  letter-spacing: 0.5px;
  padding: 0 8px 10px;
  font-weight: 500;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  margin-bottom: 1px;
  position: relative;
  border-left: 2px solid transparent;
}

.nav-item i {
  font-size: 17px;
  flex-shrink: 0;
  color: var(--text-3);
}

.nav-item span { flex: 1; }

.nav-code {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-4);
  background: var(--bg-2);
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 500;
  letter-spacing: 0;
}

.nav-item:hover {
  background: var(--bg-2);
  color: var(--text);
}
.nav-item:hover i { color: var(--text-2); }

.nav-item.active {
  background: var(--primary-d);
  color: var(--primary);
  border-left-color: var(--primary);
  padding-left: 8px;
}
.nav-item.active i { color: var(--primary); }
.nav-item.active .nav-code {
  background: rgba(0,212,255,0.08);
  color: var(--primary-2);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}

.key-row {
  font-family: var(--mono);
}

.key-label {
  font-size: 9px;
  color: var(--text-4);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.key-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--buy);
  background: var(--bg-2);
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-weight: 500;
}

.key-value span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-copy {
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px;
  display: flex;
}
.key-copy:hover { color: var(--primary); }

/* ============================================
   MAIN
   ============================================ */
.main {
  margin-left: 260px;
  margin-top: 32px;
  min-height: calc(100vh - 32px);
  padding: 24px 28px;
  position: relative;
  z-index: 1;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.bc-sep {
  color: var(--text-4);
  margin: 0 4px;
}

.page-head h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.4px;
}

.head-actions {
  display: flex;
  gap: 8px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--text);
  transition: all 0.15s;
}

.btn i { font-size: 14px; }

.btn:hover {
  background: var(--bg-3);
  border-color: var(--border-3);
}

.btn-primary {
  background: var(--primary);
  color: var(--bg-0);
  border-color: var(--primary);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--primary-2);
  border-color: var(--primary-2);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-2);
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--bg-2);
}

.btn-icon {
  padding: 4px;
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 3px;
}
.btn-icon:hover { color: var(--sell); background: var(--sell-d); }

/* ============================================
   TABS
   ============================================ */
.tab-section { display: none; animation: fade 0.2s ease; }
.tab-section.active { display: block; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ============================================
   METRIC CARDS
   ============================================ */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  transition: border-color 0.15s;
}
.metric-card:hover { border-color: var(--border-2); }

.metric-card.primary {
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border-color: var(--border-2);
}

.metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.metric-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.8px;
  font-weight: 600;
}

.metric-tag {
  font-family: var(--mono);
  font-size: 9px;
  background: var(--buy-d);
  color: var(--buy);
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  border: 1px solid var(--buy-2);
}

.metric-value {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.metric-value.profit { color: var(--buy); }
.metric-value.loss { color: var(--sell); }

.metric-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
}

.metric-foot-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-2);
}

.metric-foot-item.muted { color: var(--text-3); }

.badge-mini {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.badge-mini.buy { background: var(--buy-d); color: var(--buy); }
.badge-mini.sell { background: var(--sell-d); color: var(--sell); }

.micro-bar {
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}

.micro-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--buy), var(--primary));
  transition: width 0.4s ease;
}

.metric-split {
  display: flex;
  align-items: center;
  gap: 14px;
}

.metric-sub-val {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.metric-sub-val.profit { color: var(--buy); }
.metric-sub-val.loss { color: var(--sell); }

.metric-sub-lbl {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 2px;
}

.metric-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* ============================================
   PANELS
   ============================================ */
.panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 18px;
  overflow: hidden;
}

.panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-1);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.panel-title i {
  font-size: 16px;
  color: var(--primary);
}

.panel-endpoint {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--bg-3);
  color: var(--text-2);
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
  font-weight: 500;
  letter-spacing: 0;
}

.panel-endpoint.ok { background: var(--buy-d); color: var(--buy); border-color: var(--buy-2); }
.panel-endpoint.err { background: var(--sell-d); color: var(--sell); border-color: var(--sell-2); }

.muted-sm {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

/* ============================================
   DATA TABLE
   ============================================ */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  background: var(--bg-1);
  padding: 9px 14px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
}

.data-table thead th.num { text-align: right; }

.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(31,41,55,0.5);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.data-table tbody td.num { text-align: right; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(0,212,255,0.025); }

.data-table td.sym {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--text);
}

/* Side badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.6px;
}
.badge-buy {
  background: var(--buy-d);
  color: var(--buy);
  border: 1px solid var(--buy-2);
}
.badge-sell {
  background: var(--sell-d);
  color: var(--sell);
  border: 1px solid var(--sell-2);
}

.pnl-pos { color: var(--buy); font-weight: 700; }
.pnl-neg { color: var(--sell); font-weight: 700; }

/* Empty state */
.empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty i {
  font-size: 42px;
  color: var(--text-4);
  display: block;
  margin-bottom: 12px;
}
.empty p { margin: 4px 0; font-size: 13px; }
.empty code {
  font-family: var(--mono);
  background: var(--bg-3);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
}

/* ============================================
   FILTERS
   ============================================ */
.filter-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-wrap: wrap;
}

.filter-grp {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-grp label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.8px;
  font-weight: 600;
}

.filter-row input,
.filter-row select {
  padding: 6px 10px;
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
  min-width: 130px;
  transition: border-color 0.15s;
}
.filter-row input:focus,
.filter-row select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-d);
}

/* ============================================
   CALENDAR
   ============================================ */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.cal-title {
  text-align: center;
  flex: 1;
}

.cal-title h3 {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.cal-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11px;
}

.cal-meta strong {
  color: var(--text);
  font-weight: 600;
}

.cal-nav {
  width: 32px; height: 32px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.cal-nav:hover {
  background: var(--bg-2);
  color: var(--primary);
  border-color: var(--primary);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  padding: 1px;
}

.cal-dow {
  background: var(--bg-1);
  padding: 8px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.8px;
  font-weight: 600;
}

.cal-day {
  background: var(--bg-2);
  min-height: 88px;
  padding: 8px 10px;
  position: relative;
}

.cal-day.empty { background: var(--bg-1); opacity: 0.5; }

.cal-day.has-trade { cursor: pointer; transition: background 0.15s; }
.cal-day.has-trade:hover { background: var(--bg-3); }

.cal-day.profit {
  background: rgba(0,217,126,0.06);
  border-left: 2px solid var(--buy);
}
.cal-day.profit:hover { background: rgba(0,217,126,0.14); }

.cal-day.loss {
  background: rgba(255,71,87,0.06);
  border-left: 2px solid var(--sell);
}
.cal-day.loss:hover { background: rgba(255,71,87,0.14); }

.cal-day.today {
  outline: 1px solid var(--primary);
  outline-offset: -1px;
}

.cal-date {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}

.cal-pnl {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.2px;
}

.cal-trades {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-4);
  margin-top: 2px;
  letter-spacing: 0.5px;
}

/* ============================================
   ENDPOINTS DOCS
   ============================================ */
.endpoints { padding: 0; }

.endpoint {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.endpoint:last-child { border-bottom: none; }

.endpoint-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.method {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 0.6px;
}
.method.get { background: var(--primary-d); color: var(--primary); border: 1px solid rgba(0,212,255,0.25); }
.method.post { background: var(--buy-d); color: var(--buy); border: 1px solid var(--buy-2); }
.method.del { background: var(--sell-d); color: var(--sell); border: 1px solid var(--sell-2); }

.endpoint-path {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.endpoint-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
}

.endpoint-desc {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 4px;
}

.endpoint-desc code {
  background: var(--bg-3);
  color: var(--primary);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

/* ============================================
   CONSOLE (Request tester)
   ============================================ */
.console-block { padding: 16px; }

.console-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.console-input .prompt {
  color: var(--buy);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  padding: 0 4px;
}

.console-input select,
.console-input input {
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
}

.console-input select { min-width: 80px; }
.console-input input { flex: 1; }

.console-input input:focus,
.console-input select:focus {
  border-color: var(--primary);
}

.console-log {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow-y: auto;
  min-height: 80px;
  line-height: 1.6;
}

/* ============================================
   HIDDEN PAGES (add-trade, import)
   ============================================ */
.hidden-page .main { display: none; }

.hidden-wrap {
  max-width: 880px;
  margin: 60px auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.hidden-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.hidden-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-d);
  color: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 1px solid rgba(0,212,255,0.25);
  flex-shrink: 0;
}

.hidden-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin: 2px 0 4px;
  letter-spacing: -0.3px;
}

/* ============================================
   FORM
   ============================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-field.full { grid-column: 1 / -1; }

.form-field label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.6px;
  font-weight: 600;
}

.form-field .req { color: var(--sell); margin-left: 2px; }
.form-field .opt {
  color: var(--text-4);
  font-weight: 400;
  font-size: 9px;
  margin-left: 4px;
}

.form-field input,
.form-field select,
.form-field textarea {
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 8px 11px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-d);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}

/* ============================================
   UPLOAD ZONE
   ============================================ */
.upload-zone {
  margin: 18px;
  padding: 48px 24px;
  border: 1.5px dashed var(--border-3);
  border-radius: 8px;
  text-align: center;
  transition: all 0.2s;
  background: var(--bg-1);
}

.upload-zone:hover,
.upload-zone.drag {
  border-color: var(--primary);
  background: rgba(0,212,255,0.03);
}

.upload-zone i {
  font-size: 52px;
  color: var(--primary);
  display: block;
  margin-bottom: 14px;
}

.upload-zone h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.upload-zone p {
  margin-bottom: 16px;
}

/* ============================================
   INFO BLOCK
   ============================================ */
.info-block { padding: 18px; }

.info-text {
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 10px;
}

.info-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
  margin-bottom: 18px;
}

.info-list li {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  padding: 4px 0;
}

.info-list code {
  background: var(--bg-3);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 6px;
  font-size: 11px;
}

.info-h {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.6px;
  margin: 14px 0 8px;
  font-weight: 600;
  text-transform: uppercase;
}

.code-block {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--buy);
  line-height: 1.7;
  overflow-x: auto;
  margin-bottom: 10px;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.success {
  background: var(--buy-d);
  border-color: var(--buy-2);
  color: var(--buy);
}
.toast.error {
  background: var(--sell-d);
  border-color: var(--sell-2);
  color: var(--sell);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .sidebar { width: 64px; }
  .sidebar .brand-meta,
  .sidebar .nav-item span,
  .sidebar .nav-code,
  .sidebar .nav-section-title,
  .sidebar-footer { display: none; }
  .brand { justify-content: center; padding: 16px 0; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item.active { border-left: none; padding: 12px; }
  .nav-section { padding: 12px 8px; }
  .main { margin-left: 64px; padding: 18px; }
}

@media (max-width: 700px) {
  .strip { font-size: 9px; gap: 10px; padding: 0 10px; overflow-x: auto; white-space: nowrap; }
  .strip-section:not(.right) { flex-shrink: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cal-day { min-height: 60px; padding: 4px 6px; }
  .cal-pnl { font-size: 10px; }
  .cal-meta { gap: 12px; font-size: 10px; }
  .metric-value { font-size: 22px; }
}

/* ============================================
   LOGOUT BUTTON (v3 - auth)
   ============================================ */
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.logout-btn i { font-size: 14px; color: var(--text-3); }

.logout-btn:hover {
  background: var(--sell-d);
  border-color: var(--sell-2);
  color: var(--sell);
  text-decoration: none;
}
.logout-btn:hover i { color: var(--sell); }