/* RiskOnRanch - DBP theme (navy + cyan). Shared theme lives in /static/dbp/dbp.css */
@import url("/static/dbp/dbp.css?v=20261204a");
@import url("/room/shell.css?v=20261204d");

/* Legacy table display classes (layout kept, restyled) */
DIV.table { display: table; width: 100%; border-collapse: collapse; }
DIV.tr, FORM.tr { display: table-row; }
html body select, html body input { height: auto !important; line-height: 1.5; font-weight: 400; margin-right: 5px !important; }
SPAN.td { display: table-cell; padding: 0.5rem 1rem; border: 1px solid var(--border); vertical-align: middle; text-align: center; }
html body DIV.hdr { background-color: var(--surface-2); color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.1em; }
html body FORM.add, html body DIV.add { background-color: var(--surface-3); }
html body SPAN.blue, html body SPAN.bb { color: var(--cyan-2); font-weight: 600; padding: 2px 6px; background-color: var(--cyan-dim); border-radius: 6px; }
html body SPAN.red { color: var(--neg); font-weight: 600; }

/* Activity log row types (log.php) */
html body tr.info { background-color: transparent; }
html body tr.success { background-color: rgba(0,229,255,.06); }
html body tr.error { background-color: rgba(245,158,11,.10); }
html body tr.debug { background-color: transparent; color: var(--muted); }
html body tr.dev { background-color: var(--surface-2); color: var(--muted); }

/* legacy greyscale utilities remapped */
.bg-grey-50,.bg-grey-100,.bg-grey-200 { background-color: var(--surface-2); }
.bg-grey-300,.bg-grey-400,.bg-grey-500 { background-color: var(--border-2); }
.bg-grey-600,.bg-grey-700,.bg-grey-800,.bg-grey-900 { background-color: var(--bg-2); }
.text-grey-300,.text-grey-400 { color: #cbd5e1; } .text-grey-500,.text-grey-600,.text-grey-700 { color: var(--muted); }
.border-grey-300,.border-grey-400,.border-grey-700 { border-color: var(--border-2); }

/* Trading Room shell and bot page components */
html body:has(> .side) {
  padding-left: var(--layout-sidebar);
}

html body > .side {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--layout-sidebar);
  height: 100dvh;
  box-sizing: border-box;
  z-index: var(--z-sidebar);
}

.bot-top .crumb a:hover, .bot-content a:not([class]):hover {
  color: var(--cyan);
}

.bot-menu {
  display: none;
}

.bot-content {
  max-width: var(--layout-content-max);
  margin: 0 auto;
  padding: 22px 24px 56px;
  min-width: 0;
}

html body .bot-title {
  margin: 0 0 18px;
  font-size: var(--fs-xl);
  line-height: var(--lh-tight);
}

.bot-card {
  min-width: 0;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.bot-card-flush {
  padding: 0;
}

html body .bot-card-title {
  margin: 0 0 12px;
  color: var(--muted) !important;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
}

html body .bot-card-flush > .bg-gray-800 {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: transparent !important;
}

.bot-content a:not([class]) {
  color: var(--cyan-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bot-content .bot-table-scroll,
.bot-content .overflow-x-auto {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.bot-card-flush .overflow-x-auto {
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.bot-content th, .bot-content td {
  border: 0;
  border-bottom: 1px solid var(--border);
}

.bot-content tbody tr:last-child td {
  border-bottom: 0;
}

.bot-content input:not([type=checkbox]):not([type=radio]),
.bot-content select,
.bot-content textarea {
  max-width: 100%;
}

.bot-content .bot-pairs {
  min-width: 660px;
}

.bot-pairs .bot-trade-size {
  width: 5rem;
}

.bot-pairs .td:last-child {
  white-space: nowrap;
}

.bot-log-table td:last-child {
  min-width: 220px;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  html body:has(> .side) {
    padding-left: 0;
    padding-bottom: var(--layout-bottom-tabs);
  }

  .bot-content {
    padding: 16px 14px 32px;
  }

  html body .bot-title {
    font-size: 20px;
  }

  .bot-menu {
    display: block;
    margin-left: auto;
  }

  .bot-menu summary {
    cursor: pointer;
    list-style: none;
  }

  .bot-menu summary::-webkit-details-marker {
    display: none;
  }

  .bot-menu summary::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-left: 2px;
    border-right: 1px solid;
    border-bottom: 1px solid;
    transform: rotate(45deg) translateY(-2px);
  }

  .bot-menu[open] summary::after {
    transform: rotate(225deg) translateY(-2px);
  }

  .bot-menu .nav {
    position: absolute;
    top: calc(100% + 4px);
    right: 14px;
    width: min(260px, calc(100vw - 28px));
    max-height: calc(100dvh - var(--layout-topbar) - var(--layout-bottom-tabs) - 16px);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }

  .bot-menu .nav .grp:first-child {
    padding-top: 6px;
  }
}
