/* chartlabs-signals admin — components on top of the trader's design system (pico + app.css, copied).
   Same tokens and shapes as the trader's Overview page (.dh-*), renamed .sg-* here. */
:root {
    --up: #16a34a; --dn: #dc2626; --warn-bg: #fef3c7; --warn-fg: #92400e;
    --line: var(--ui-line, #e3e8ef); --mut: var(--ui-muted, #6b7686); --soft: var(--ui-head, #f8fafc);
    --card: var(--ui-card, #fff); --accent: var(--ui-accent, #2563eb);
}
.up { color: var(--up); } .dn { color: var(--dn); } .mut { color: var(--mut); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.ok { color: var(--up); }

/* top line + pills (trader .dh-top / .dh-pill) */
.sg-top { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .2rem 0 1rem; }
.sg-top h2 { margin: 0; }
.sg-top .sg-actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.sg-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .65rem; border-radius: 999px;
           font-size: .8rem; border: 1px solid var(--line); background: var(--soft); }
.sg-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--mut); display: inline-block; }
.sg-dot.on { background: var(--up); box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.sg-dot.off { background: var(--dn); box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

/* badges (trader .dh-badge) */
.sg-badge { font-size: .66rem; font-weight: 700; letter-spacing: .04em; padding: .08rem .45rem; border-radius: 4px;
            background: var(--soft); border: 1px solid var(--line); text-transform: uppercase; white-space: nowrap;
            display: inline-block; line-height: 1.5; }
.sg-badge.on { background: var(--up); color: #fff; border-color: var(--up); }
.sg-badge.off { background: var(--dn); color: #fff; border-color: var(--dn); }
.sg-badge.shadow { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.sg-badge.live { background: var(--up); color: #fff; border-color: var(--up); }
.sg-badge.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: #fde68a; }
.sg-badge.entry { background: #e8f5ee; color: #166534; border-color: #bbf7d0; }
.sg-badge.exit { background: #fdecec; color: #991b1b; border-color: #fecaca; }

/* status strip (trader .dh-ops) */
.sg-strip { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; font-size: .8rem; border: 1px solid var(--line);
            border-radius: 10px; padding: .6rem .9rem; background: var(--soft); margin: 0 0 1.1rem; }
.sg-strip > div { display: flex; flex-direction: column; gap: .1rem; min-width: 9rem; }
.sg-strip .lbl, .sg-kpi .lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); }
.sg-events { display: flex; flex-wrap: wrap; gap: .35rem; }
.sg-ev { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: .12rem .45rem; font-size: .74rem; }
.sg-ev b { margin-right: .25rem; }

/* bot cards (trader .dh-cards / .dh-card) */
.sg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.sg-card { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.05rem .8rem; background: var(--card);
           box-shadow: 0 1px 2px rgba(0,0,0,.04); border-top: 4px solid var(--up); }
.sg-card.paused { border-top-color: var(--dn); background: #fffafa; }
.sg-head { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; margin-bottom: .25rem; }
.sg-head a { font-weight: 700; font-size: 1.02rem; text-decoration: none; color: inherit; }
.sg-head .right { margin-left: auto; display: flex; gap: .3rem; }
.sg-sub { font-size: .76rem; color: var(--mut); margin-bottom: .45rem; }
.sg-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; margin: .45rem 0 .35rem; }
.sg-kpi { background: var(--soft); border-radius: 8px; padding: .4rem .55rem; }
.sg-kpi .val { font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.sg-kpi .sub { font-size: .72rem; color: var(--mut); }
.sg-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem 1.1rem; font-size: .78rem; margin-top: .35rem; }
.sg-grid2 > div { display: flex; justify-content: space-between; gap: .5rem; border-bottom: 1px dashed var(--line); padding: .14rem 0; }
.sg-grid2 > div > span:last-child { text-align: right; }
.sg-grid2.one { grid-template-columns: 1fr; }
.sg-note { font-size: .74rem; margin-top: .45rem; padding: .32rem .55rem; border-radius: 6px; background: var(--warn-bg); color: var(--warn-fg); }
.sg-card footer { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }

/* small buttons, like the trader's row buttons */
button.sm, a.sm[role="button"] { padding: .18rem .6rem !important; font-size: .78rem !important; }
button.danger { background: var(--dn); border-color: var(--dn); color: #fff; }
button.good { background: var(--up); border-color: var(--up); color: #fff; }

/* flash + warning boxes */
.sg-flash { padding: .5rem .8rem; border-radius: 8px; margin-bottom: .9rem; font-size: .86rem; border: 1px solid; }
.sg-flash.ok { background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
.sg-flash.err { background: #fdecec; border-color: #fecaca; color: #991b1b; }
.sg-warn { padding: .6rem .85rem; border-radius: 8px; background: var(--warn-bg); color: var(--warn-fg);
           border: 1px solid #fde68a; font-size: .85rem; margin: .6rem 0; }
.sg-warn strong { display: block; margin-bottom: .2rem; }

/* symbol chips */
.sg-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0 .6rem; }
.sg-chip { font-size: .74rem; border: 1px solid var(--line); background: var(--card); border-radius: 6px;
           padding: .08rem .42rem; font-variant-numeric: tabular-nums; }
.sg-chip.add { background: #e8f5ee; border-color: #bbf7d0; color: #166534; }
.sg-chip.rm { background: #fdecec; border-color: #fecaca; color: #991b1b; text-decoration: line-through; }
.sg-chip.nohist { border-style: dashed; border-color: #f59e0b; }

/* layout helpers */
.sg-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 1000px) { .sg-2col { grid-template-columns: 1fr; } }
.sg-scroll { overflow-x: auto; }
.sg-filters { display: flex; flex-wrap: wrap; gap: .5rem .7rem; align-items: flex-end; margin-bottom: .8rem; }
.sg-filters label { margin: 0; font-size: .76rem; color: var(--mut); display: flex; flex-direction: column; gap: .15rem; }
.sg-filters input, .sg-filters select { margin: 0 !important; min-width: 7rem; }
.sg-filters label.check { flex-direction: row; align-items: center; gap: .35rem; padding-bottom: .45rem; }
.sg-filters button, .sg-filters a[role="button"] { margin: 0; }
table.sg-t { width: 100%; font-size: .8rem; }
table.sg-t td, table.sg-t th { padding: .28rem .45rem; vertical-align: top; }
table.sg-t th { white-space: nowrap; }
.kv th { text-align: left; font-weight: 500; color: var(--mut); white-space: nowrap; width: 1%; }
.pager { display: flex; gap: .6rem; align-items: center; font-size: .82rem; margin: .5rem 0; }
textarea.symbols { min-height: 11rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem !important; }

/* confirm dialogs */
dialog { border: 0; padding: 0; }
dialog article { max-width: 30rem; width: calc(100vw - 2rem); }
dialog article footer { display: flex; justify-content: flex-end; gap: .5rem; }
dialog textarea { min-height: 4.5rem; }

@media (max-width: 720px) {
    .sg-kpis { grid-template-columns: 1fr 1fr 1fr; }
    .sg-grid2 { grid-template-columns: 1fr; }
    .sg-top .sg-actions { margin-left: 0; }
    body > nav.app-nav > ul:last-child { justify-content: flex-start; }
}
