/* Dashboard de 7ots.com (/app/). Usa los colores y componentes de ../backoffice/app.css. */
body { min-height: 100%; height: auto; }
.stack { display: grid; gap: 12px; }
.login-card .brand { text-decoration: none; color: var(--ink); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.notlogin { justify-content: center; }

.dash { min-height: 100%; }
.dash-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 22px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dash-top .brand { text-decoration: none; color: var(--ink); }
.dash-top select { width: auto; padding: 5px 8px; font-size: 13px; }
.dash-main { max-width: 1080px; margin: 0 auto; padding: 26px 22px 60px; display: grid; gap: 18px; }
.who { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* cupo */
.quota { display: grid; gap: 3px; min-width: 190px; font-size: 12px; color: var(--muted); }
.quota .bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.quota .bar i { display: block; height: 100%; background: var(--p); border-radius: 99px; }
.quota.full .bar i { background: var(--err); }

/* cabecera de página */
.page-h { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.page-h h1 { font: 800 28px/1.1 'Bricolage Grotesque', Inter, system-ui, sans-serif; letter-spacing: -.02em; }
.page-h p { margin: 4px 0 0; }

/* lista de ots */
.ots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ots-card { gap: 12px; align-content: start; }
.ots-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.ots-head > div { min-width: 0; }
.ots-head h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ots-head p { margin: 1px 0 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av { width: 52px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--p-soft); color: var(--p); font: 800 22px 'Bricolage Grotesque', Inter, sans-serif; overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av svg { width: 100%; height: 100%; }
.meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.pill { padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); background: var(--bg); }
.pill.on { color: var(--ok); border-color: var(--ok); }
.pill.off { color: var(--warn); border-color: var(--warn); }
.ots-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.danger { color: var(--err); }
.btn.danger.armed { background: var(--err); border-color: var(--err); color: #fff; }
.new-card { border-style: dashed; }
.empty { text-align: center; padding: 40px 18px; }

/* detalle */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current='page'] { color: var(--p); border-color: var(--p); }
.rename { display: flex; gap: 8px; align-items: center; }
.rename input { font: 800 24px 'Bricolage Grotesque', Inter, sans-serif; padding: 2px 8px; max-width: 420px; }

/* conversaciones */
.conv { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 16px; align-items: start; }
.conv-list { display: grid; gap: 6px; padding: 8px; max-height: 70vh; overflow-y: auto; }
.conv-list button { font: inherit; text-align: left; background: none; border: 1px solid transparent; border-radius: 9px; padding: 8px 10px; cursor: pointer; color: var(--ink); display: grid; gap: 2px; }
.conv-list button:hover { background: var(--p-soft); }
.conv-list button[aria-current='true'] { border-color: var(--p); background: var(--p-soft); }
.conv-list b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transcript { display: grid; gap: 10px; max-height: 70vh; overflow-y: auto; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { justify-self: end; background: var(--p); color: var(--p-ink); border-bottom-right-radius: 4px; }
.msg.assistant { justify-self: start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg small { display: block; opacity: .7; font-size: 11px; margin-top: 3px; }

/* uso */
table.usage { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.usage th, table.usage td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.usage th:first-child, table.usage td:first-child { text-align: left; }
table.usage th { font-size: 12px; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

@media (max-width: 760px) {
  .dash-top { padding: 10px 16px; }
  .dash-main { padding: 18px 16px 50px; }
  .quota { order: 5; flex-basis: 100%; }
  .who { display: none; }
  .conv { grid-template-columns: 1fr; }
  .ots-grid { grid-template-columns: 1fr; }
}
