@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@600&family=Roboto:wght@400;500;700&display=swap');

/* ------------------------------------------------------------------
   Base (pensado primero para móvil)
------------------------------------------------------------------- */
:root {
  --bg: #1A1D22; --panel: #22262d; --panel2: #2a2f37; --line: #343a44; --text: #eceef1; --muted: #a3acb8;
  --blue: #6EC1E4; --blue-h: #55A8CC; --amber: #FDE9C8; --ok: #5cc98a; --wait: #f0b35a; --bad: #ef6a6a;
  --r: 12px; --nav-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); min-height: 100%; scroll-padding-bottom: calc(var(--nav-h) + 24px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Roboto, Arial, sans-serif; }
a { color: var(--blue); text-decoration: none; } a:hover { color: var(--blue-h); }
h1, h2, h3 { font-family: 'Roboto Slab', serif; font-weight: 600; margin: 0 0 10px; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 18px; margin-top: 26px; } h3 { font-size: 17px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .tiny { font-size: 12.5px; }
.warn { color: var(--wait); } .bad { color: var(--bad); } .okc { color: var(--ok); }
.hide { display: none !important; }

/* Cabecera y navegación */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
       background: #15171b; border-bottom: 1px solid var(--line); }
.brand { font-family: 'Roboto Slab', serif; color: var(--blue); font-size: 17px; white-space: nowrap; }
.who { margin-left: auto; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who a { margin-left: 8px; }
nav.main { display: none; }
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: var(--nav-h); display: flex;
           background: #15171b; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
             color: var(--muted); font-size: 12px; position: relative; }
nav.tabs a.on { color: var(--blue); }
nav.tabs svg { width: 24px; height: 24px; }
nav.tabs .dot { position: absolute; top: 6px; left: 55%; background: var(--wait); color: #1A1D22; font-size: 11px;
                font-weight: 700; border-radius: 99px; padding: 0 6px; min-width: 18px; text-align: center; }
main { padding: 16px 14px calc(var(--nav-h) + 28px); max-width: 1100px; margin: 0 auto; }

/* Avisos */
.flash { background: var(--amber); color: #1A1D22; padding: 12px 14px; border-radius: var(--r); margin-bottom: 14px; font-weight: 500; }
.alert { background: #3a3220; color: var(--wait); border: 1px solid #5a4a2a; padding: 12px 14px; border-radius: var(--r); margin-bottom: 10px; }
.alert a { color: var(--amber); text-decoration: underline; }
.help { background: var(--panel); border-left: 3px solid var(--blue); padding: 10px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; margin-bottom: 16px; }

/* Tarjetas */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.between > :first-child { min-width: 0; overflow-wrap: anywhere; }
.between > .tag { flex: none; max-width: 48%; white-space: normal; text-align: center; }
.stack > * + * { margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--panel2); border-radius: 10px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 24px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.hot b { color: var(--wait); }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.item .name { font-weight: 500; font-size: 17px; }
.item .meta { color: var(--muted); font-size: 14px; }
.item .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.item .actions > * { flex: 1 1 auto; }
.item .actions form { display: flex; }
.item .actions form .btn { width: 100%; }
.quote { background: var(--panel2); border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }

/* Etiquetas de estado */
.tag { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 500; background: #2b3038; color: var(--muted); white-space: nowrap; }
.tag.ok { background: #1f3a2b; color: var(--ok); } .tag.wait { background: #3a3220; color: var(--wait); }
.tag.info { background: #1d3340; color: var(--blue); } .tag.bad { background: #3d2224; color: var(--bad); }

/* Formularios */
label { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
input, select, textarea { background: #15171b; color: var(--text); border: 1px solid var(--line); border-radius: 10px;
                          padding: 12px; font: inherit; font-size: 16px; width: 100%; min-height: 48px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); border-color: transparent; }
textarea { min-height: 120px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; accent-color: var(--blue); flex: none; }
input[type=file] { padding: 10px; }
.filepick input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filepick label.btn { width: 100%; margin: 0; color: var(--text); }
.filepick .chosen { margin-top: 6px; font-size: 14px; color: var(--muted); }
.field { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 16px; margin: 0; min-height: 44px; }
.counter { text-align: right; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
details.more { margin-top: 6px; }
details.more > summary { cursor: pointer; color: var(--blue); padding: 8px 0; font-size: 15px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--blue); color: #1A1D22;
       border: 0; border-radius: 10px; padding: 0 18px; min-height: 48px; font: inherit; font-weight: 500; cursor: pointer; text-align: center; }
.btn:hover { background: var(--blue-h); color: #1A1D22; }
.btn.sec { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.sec:hover { border-color: var(--blue); color: var(--blue); }
.btn.bad { background: transparent; color: var(--bad); border: 1px solid #5a2f33; }
.btn.ok { background: var(--ok); color: #10241a; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.sticky-actions { position: sticky; bottom: calc(var(--nav-h) + 8px); background: var(--bg); padding: 10px 0; display: flex; gap: 8px; }
.sticky-actions .btn { flex: 1; }

/* Filtros en forma de pestañas */
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.pills a { white-space: nowrap; padding: 8px 14px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 14px; }
.pills a.on { background: var(--blue); color: #1A1D22; border-color: var(--blue); }

/* Biblioteca */
.media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.media-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.media-item img, .media-item video { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #000; }
.media-item .audio { aspect-ratio: 3/4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 8px; background: var(--panel2); }
.media-item .audio audio { width: 100%; }
.media-item .t { padding: 8px 10px 0; font-size: 14px; word-break: break-word; }
.media-item .m { padding: 0 10px 8px; font-size: 12.5px; color: var(--muted); }
.media-item form { padding: 0 10px 10px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick { position: relative; display: block; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--panel2); }
.pick input { position: absolute; top: 6px; left: 6px; z-index: 2; }
.pick img, .pick video, .pick .ph { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pick .ph { display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); text-align: center; padding: 6px; }
.pick:has(input:checked) { border-color: var(--blue); }
.pick .lbl { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.6); font-size: 11.5px; padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Pasos de la bienvenida */
.step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.step .n { width: 34px; height: 34px; border-radius: 50%; background: var(--panel2); display: grid; place-items: center; color: var(--blue); font-weight: 700; }
.step .tools { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.timeline-wait { margin: -4px 0 8px 46px; color: var(--muted); font-size: 14px; }

/* Tablas: en móvil se ven como tarjetas */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.cards thead { display: none; }
table.cards tr { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; padding: 8px 4px; }
table.cards td { display: flex; gap: 10px; border: 0; padding: 5px 10px; }
table.cards td[data-l]::before { content: attr(data-l); color: var(--muted); min-width: 92px; flex: none; font-size: 13px; }
pre { background: #15171b; border: 1px solid var(--line); padding: 12px; border-radius: 8px; overflow: auto; font-size: 12px; }
.login { max-width: 400px; margin: 10vh auto; }
form.inline { display: inline; }

/* ------------------------------------------------------------------
   Pantallas grandes
------------------------------------------------------------------- */
@media (min-width: 820px) {
  body { font-size: 15px; }
  nav.tabs { display: none; }
  nav.main { display: flex; gap: 18px; margin-left: 18px; }
  nav.main a { color: var(--text); opacity: .85; position: relative; }
  nav.main a.on, nav.main a:hover { color: var(--blue); opacity: 1; }
  nav.main .dot { background: var(--wait); color: #1A1D22; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 6px; margin-left: 4px; }
  main { padding: 24px 24px 60px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .grid.two { grid-template-columns: 1.3fr 1fr; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .pick-grid { grid-template-columns: repeat(4, 1fr); }
  .sticky-actions { position: static; }
  .sticky-actions .btn { flex: 0 1 auto; }
  .item .actions > * { flex: 0 0 auto; }
  table.cards thead { display: table-header-group; }
  table.cards tr { display: table-row; background: none; border: 0; padding: 0; }
  table.cards td { display: table-cell; border-bottom: 1px solid var(--line); padding: 10px; }
  table.cards td[data-l]::before { content: none; }
  table.cards { background: var(--panel); border-radius: var(--r); overflow: hidden; }
}
