/* Trait Store admin — layered on the console's tokens (style.css). Everything is scoped under .tsa. */

.tsa { max-width: 1500px; }
.tsa h1 { margin-bottom: 2px; }
.tsa .sub { color: var(--ink-soft); font-size: 12.5px; margin: 0 0 16px; }
.tsa .muted { color: var(--ink-faint); }
.tsa .small { font-size: 12px; }
.tsa a.mono, .tsa .link { color: var(--accent); }
.tsa .field.sm { padding: 6px 9px; font-size: 12.5px; width: auto; }
.tsa .btn.sm { padding: 5px 10px; font-size: 12px; }
.tsa .linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.tsa .linkbtn:hover { color: #E3A85C; text-decoration: underline; }
.tsa .linkbtn:disabled { opacity: .4; cursor: not-allowed; }

/* status */
.tsa-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 0 0 18px; }
.tsa-tile { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.tsa-tile .k { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
.tsa-tile .v { margin-top: 7px; font-size: 13.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tsa-tile .note { margin-top: 5px; font-size: 11.5px; color: var(--ink-soft); }
.tsa-tile.warn { border-color: var(--warn); }
.tsa-tile.crit { border-color: var(--crit); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); flex: none; display: inline-block; }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.crit { background: var(--crit); }
.tsa-copy { background: none; border: 0; color: var(--ink-faint); cursor: pointer; padding: 0 2px; font-size: 11px; }
.tsa-copy:hover { color: var(--accent); }
.tsa-alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 8px; padding: 11px 14px; margin: 0 0 14px; font-size: 12.5px; line-height: 1.45; }
.tsa-alert.warn { background: var(--warn-bg); border: 1px solid var(--warn); color: var(--warn); }
.tsa-alert.crit { background: var(--crit-bg); border: 1px solid var(--crit); color: var(--crit); }
.tsa-alert.good { background: var(--good-bg); border: 1px solid var(--good); color: var(--good); }
.tsa-alert.info { background: var(--sunk); border: 1px solid var(--rule); color: var(--ink-soft); }

/* tabs */
.tsa-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: 0 0 18px; flex-wrap: wrap; }
.tsa-tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 600; padding: 9px 14px; margin-bottom: -1px; cursor: pointer; display: flex; gap: 7px; align-items: center; }
.tsa-tab:hover { color: var(--ink); }
.tsa-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tsa-badge { background: var(--warn); color: var(--accent-ink); font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }

/* chips + toolbar */
.tsa-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.tsa-chip { background: var(--panel); border: 1px solid var(--rule); color: var(--ink-soft); font: inherit; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 6px 12px; cursor: pointer; display: flex; gap: 7px; align-items: baseline; }
.tsa-chip b { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink); }
.tsa-chip:hover { border-color: var(--ink-soft); }
.tsa-chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tsa-chip.active b { color: var(--accent-ink); }
.tsa-chip.attn b { color: var(--warn); }
.tsa-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.tsa-toolbar .grow { flex: 1; min-width: 180px; max-width: 320px; }
.tsa-toolbar .spacer { margin-left: auto; }

/* bulk + save bars */
.tsa-bulk { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--sunk); border: 1px solid var(--accent); border-radius: 10px; padding: 9px 12px; margin: 0 0 12px; font-size: 12.5px; }
.tsa-bulk b { color: var(--accent); }
.tsa-savebar { position: sticky; bottom: 12px; z-index: 6; display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--accent); border-radius: 10px; padding: 10px 14px; margin-top: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }

/* catalogue table */
.tsa-tablewrap { border: 1px solid var(--rule); border-radius: 10px; }
.tsa-table { border: 0; border-radius: 0; }
.tsa-table thead th { position: sticky; top: 0; z-index: 3; white-space: nowrap; padding: 10px 12px; }
.tsa-table tbody td { padding: 10px 12px; vertical-align: top; }
.tsa-table .c-sel { width: 34px; }
.tsa-table .c-trait { min-width: 330px; }
.tsa-table .c-rar { width: 130px; }
.tsa-table .c-bonus { width: 160px; }
.tsa-table .c-prices { width: 285px; }
.tsa-table .c-stock { width: 84px; }
.tsa-table .c-status { width: 130px; }
.tsa-table .c-act { width: 74px; text-align: right; }
.tsa-row.dirty { box-shadow: inset 3px 0 0 var(--accent); background: rgba(201, 138, 60, .06); }
.tsa-row.off { opacity: .72; }
.tsa-trait { display: flex; gap: 11px; align-items: center; }
.tsa-thumb { width: 132px; height: 132px; border-radius: 9px; background: var(--sunk); border: 1px solid var(--rule); object-fit: cover; flex: none; display: grid; place-items: center; color: var(--ink-faint); font-size: 10px; }
.tsa-trait .name { font-weight: 700; font-size: 13.5px; }
.tsa-trait .meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tsa-bonus { display: flex; gap: 6px; align-items: center; }
.tsa-bonus select { flex: 1; min-width: 0; }
.tsa .tsa-bonus input.field { width: 54px; }
.tsa-bonus .pct { color: var(--ink-faint); font-size: 12px; }
.tsa-gamenote { font-size: 11px; color: var(--warn); margin-top: 4px; }
.tsa-pricegrid { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.tsa-price { display: flex; flex-direction: column; gap: 4px; }
.tsa-price .code { display: flex; align-items: center; gap: 5px; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .04em; color: var(--ink-faint); cursor: pointer; }
.tsa-price .code input { margin: 0; }
.tsa .tsa-price input.field { width: 76px; }
.tsa-price .sugg { opacity: .55; font-style: italic; }
.tsa-follow { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 11.5px; color: var(--ink-soft); cursor: pointer; }
.tsa-sale { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 11.5px; }

/* toggle switch */
.tsa-switch { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; margin-bottom: 7px; user-select: none; }
.tsa-switch input { position: absolute; opacity: 0; pointer-events: none; }
.tsa-switch .track { width: 30px; height: 17px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--rule); position: relative; flex: none; transition: background .12s, border-color .12s; }
.tsa-switch .track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--ink-faint); transition: transform .12s, background .12s; }
.tsa-switch input:checked + .track { background: rgba(201,138,60,.25); border-color: var(--accent); }
.tsa-switch input:checked + .track::after { transform: translateX(13px); background: var(--accent); }
.tsa-switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.tsa-switch input:disabled + .track { opacity: .4; }

.tsa-pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 14px 0 4px; font-size: 12.5px; color: var(--ink-soft); }
.tsa-pager button { min-width: 32px; }
.tsa-pager .cur { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* cards + forms */
.tsa-card { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 18px 20px; margin: 0 0 16px; }
.tsa-card h2 { font-family: 'Zilla Slab', serif; font-size: 16px; margin: 0 0 4px; }
.tsa-card .sub { margin-bottom: 12px; }
.tsa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 14px; align-items: end; }
.tsa-grid label, .tsa-form label.f { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.tsa-grid label > .field, .tsa-form label.f > .field { margin-top: 5px; }
.tsa-rates { display: flex; gap: 22px; flex-wrap: wrap; align-items: baseline; }
.tsa-rates .n { font-family: 'IBM Plex Mono', monospace; font-size: 18px; font-weight: 600; }
.tsa-rates .l { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; display: block; }
.tsa-tier th, .tsa-tier td { padding: 9px 12px; }
.tsa-plan td, .tsa-plan th { padding: 7px 10px; font-size: 12.5px; }

/* orders */
.tsa-orders td { vertical-align: top; }
.tsa-orders tr.review { background: linear-gradient(90deg, var(--crit-bg) 0%, transparent 5%); box-shadow: inset 3px 0 0 var(--crit); }
.tsa-orderitems { display: flex; flex-direction: column; gap: 2px; }
.tsa-resolve { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-width: 360px; }

/* toasts + modal helpers */
.tsa-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.tsa-toast { background: var(--panel); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 14px; font-size: 12.5px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 380px; animation: tsa-in .15s ease-out; }
.tsa-toast.good { border-left-color: var(--good); } .tsa-toast.crit { border-left-color: var(--crit); }
@keyframes tsa-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tsa-modal-wide { width: 720px; }
.tsa-modal-body-scroll { max-height: 68vh; overflow: auto; }

/* rarities */
.tsa-color { width: 38px; height: 30px; padding: 2px; border: 1px solid var(--rule); border-radius: 7px; background: var(--sunk); cursor: pointer; }
.tsa-rarities tbody td { vertical-align: middle; }

/* spend tab */
.tsa-h3 { font-size: 13px; font-weight: 700; margin: 20px 0 8px; color: var(--ink); }
.tsa-big { font-size: 22px !important; font-family: 'IBM Plex Mono', monospace; }
.tsa-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 8px 0; }
.tsa-bar { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.tsa-bar i { display: block; width: 100%; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 0; }
.tsa-bar:hover i { filter: brightness(1.2); }
.tsa-bars-axis { display: flex; justify-content: space-between; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--ink-faint); margin: 4px 2px 0; }
.tsa-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
