/* Portal de Herramentales — estilo "IKIGAI BY KINOS" (editorial MoMA)
   Monocromo estricto: paper/ink/meta/rule. Sin acento, sin sombras, sin radios. */
:root {
  --paper: #ffffff;
  --ink: #000000;
  --meta: #6b6b6b;
  --rule: #e0e0e0;
}
* { box-sizing: border-box; margin: 0; }
body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--paper); color: var(--ink);
  font-size: 15px; -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
h1, h2, .brand, .sol-arte, td.mono { letter-spacing: -0.01em; line-height: 1.375; }

.brand { font-weight: 700; font-size: 17px; }
.brand span { color: var(--ink); }
.brand em { font-style: normal; font-weight: 400; color: var(--meta); font-size: 14px; }

/* ===== Login (página editorial en blanco) ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--paper); }
.login-card { background: var(--paper); border: 1px solid var(--rule); padding: 56px 48px; width: 400px; max-width: 92vw; }
.login-card h1 { font-size: 24px; font-weight: 700; margin: 32px 0 6px; }
.login-card .sub { color: var(--meta); font-size: 13px; margin-bottom: 36px; }
.login-card label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--meta); margin-bottom: 20px; font-weight: 500; }
.login-card input { display: block; width: 100%; border: none; border-bottom: 1px solid var(--ink); padding: 10px 0; font-size: 16px; margin-top: 8px; outline: none; border-radius: 0; font-family: inherit; background: transparent; }
.login-card input:focus { border-bottom-width: 2px; }
.login-card .btn { width: 100%; margin-top: 16px; }

/* ===== Botones ===== */
.btn { border: none; background: none; color: var(--ink); padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; border-radius: 2px; transition: color .15s, opacity .15s, background-color .15s; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { opacity: 0.8; }
.btn.ghost { color: var(--meta); padding-left: 0; padding-right: 0; }
.btn.ghost:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.btn.mini { padding: 5px 12px; font-size: 12px; }
.btn.mini:not(.primary) { border: 1px solid var(--ink); }
.btn.mini:not(.primary):hover { text-decoration: underline; text-underline-offset: 4px; }
.btn:disabled { opacity: 0.4; cursor: wait; }

/* ===== TopBar sticky 56px ===== */
header { position: sticky; top: 0; z-index: 40; background: var(--paper); display: flex; align-items: center; gap: 28px; height: 56px; padding: 0 32px; border-bottom: 1px solid var(--rule); }
nav { display: flex; gap: 8px; height: 100%; }
.tab { border: none; background: none; font: inherit; font-weight: 500; padding: 0 12px; cursor: pointer; color: var(--meta); border-bottom: 1px solid transparent; transition: color .15s; }
.tab:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.tab.active { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--ink); }
.user-box { margin-left: auto; display: flex; align-items: center; gap: 16px; color: var(--meta); font-size: 13px; height: 100%; padding-left: 20px; border-left: 1px solid var(--rule); }
.badge { background: var(--ink); color: var(--paper); border-radius: 2px; font-size: 10px; padding: 1px 6px; margin-left: 4px; font-weight: 600; }

main { padding: 40px 32px 96px; max-width: 1200px; margin: 0 auto; }

/* ===== Toolbar ===== */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; flex-wrap: wrap; }
.toolbar input[type=search], .toolbar select {
  border: none; border-bottom: 1px solid var(--rule); padding: 9px 2px; font-size: 14px; font-family: inherit; background: transparent; border-radius: 0; color: var(--ink); outline: none;
}
.toolbar input[type=search]:focus, .toolbar select:focus { border-bottom-color: var(--ink); }
.toolbar input[type=search] { width: 300px; }
.toolbar input::placeholder { color: var(--meta); }
.spacer { flex: 1; }
.count { color: var(--meta); font-size: 13px; }

/* ===== DataTable con reglas 1px ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--ink); }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--meta); font-weight: 500; padding: 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr { cursor: pointer; }
tbody tr:hover td.mono { text-decoration: underline; text-underline-offset: 4px; }
td.mono { font-weight: 700; white-space: nowrap; }
td .fecha { color: var(--meta); font-size: 12px; white-space: nowrap; }
tr.baja td { color: var(--meta); }

/* Chips planos monocromos */
.chip { display: inline-block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 8px; border: 1px solid var(--ink); border-radius: 2px; white-space: nowrap; color: var(--ink); }
.chip.en_uso, .chip.lista { background: var(--ink); color: var(--paper); }
.chip.baja, .chip.cancelada { border-color: var(--rule); color: var(--meta); }
.chip.ubi { border-color: var(--rule); color: var(--meta); }

/* ===== Solicitudes (lista editorial) ===== */
.sol-list { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.sol-card { border-bottom: 1px solid var(--rule); padding: 18px 0; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.sol-card .sol-arte { font-weight: 700; font-size: 16px; }
.sol-card .sol-meta { color: var(--meta); font-size: 12px; margin-top: 4px; }
.sol-card .sol-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ===== Modal ===== */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; padding: 36px; width: 480px; max-width: 94vw; max-height: 90vh; overflow-y: auto; }
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.modal label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--meta); font-weight: 500; margin-bottom: 18px; }
.modal input, .modal select, .modal textarea {
  display: block; width: 100%; border: none; border-bottom: 1px solid var(--rule); padding: 9px 2px; font-size: 15px; font-family: inherit; margin-top: 6px; border-radius: 0; background: transparent; color: var(--ink); outline: none;
}
.modal input:focus, .modal select:focus, .modal textarea:focus { border-bottom-color: var(--ink); }
.modal textarea { resize: vertical; min-height: 56px; }
.modal input:disabled { color: var(--meta); }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.modal .hint { font-size: 12px; color: var(--meta); text-transform: none; letter-spacing: 0; margin-top: 6px; line-height: 1.5; }

.error { color: var(--ink); font-size: 13px; margin: 10px 0; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.empty { color: var(--meta); padding: 48px 0; text-align: center; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 24px; font-size: 13px; z-index: 60; border-radius: 2px; }

/* ===== Tablet ===== */
@media (max-width: 1024px) {
  main { padding: 28px 20px 80px; }
  header { padding: 0 20px; gap: 16px; }
}

/* ===== Celular: la tabla se vuelve fichas editoriales ===== */
@media (max-width: 700px) {
  header { height: auto; min-height: 56px; padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  main { padding: 20px 16px 72px; }
  .toolbar input[type=search] { width: 100%; }
  .toolbar select { flex: 1 1 45%; min-width: 150px; }
  .user-box { margin-left: 0; width: 100%; justify-content: space-between; border-left: none; border-top: 1px solid var(--rule); padding: 8px 0 0; height: auto; }
  .btn { padding: 12px 20px; } /* objetivo táctil más cómodo */

  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr { border-bottom: 1px solid var(--rule); padding: 12px 0; }
  td { border: none; padding: 4px 0; display: flex; gap: 12px; align-items: baseline; }
  td:empty { display: none; }
  td::before { content: attr(data-label); flex: 0 0 88px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--meta); font-weight: 500; }
  td.mono { font-size: 17px; }

  .sol-card { flex-direction: column; align-items: flex-start; }
  .sol-card .sol-actions { margin-left: 0; flex-wrap: wrap; }
  .modal { padding: 28px 22px; }
  .modal-actions .btn { flex: 1; }
}
