/* web/assets/styles.css — Estilos base y de componentes de la web */

:root {
  --brand:        #0d9488;
  --brand-dark:   #0f766e;
  --brand-soft:   #ccfbf1;
  --ink:          #0f172a;
  --muted:        #64748b;
  --bg:           #f1f5f9;
  --card:         #ffffff;
  --ring:         rgba(13,148,136,.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

[v-cloak] { display: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Tarjetas de acción del inicio guiado */
.tile {
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: var(--card);
  border-radius: 18px;
  padding: 22px;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -12px rgba(15,23,42,.25);
  border-color: var(--brand);
}
.tile:active { transform: translateY(-1px); }

.tile-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: grid; place-items: center;
}

/* Chips de estado */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.4;
}

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  border: 1px solid transparent; transition: background .12s, box-shadow .12s, opacity .12s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-ghost  { background: #fff; color: var(--ink); border-color: #e2e8f0; }
.btn-ghost:hover:not(:disabled) { background: #f8fafc; }
.btn-soft   { background: var(--brand-soft); color: var(--brand-dark); }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover:not(:disabled) { background: #fecaca; }

/* Campos de formulario */
.field label { display:block; font-size:13px; font-weight:600; color:#334155; margin-bottom:6px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; font-size: 14px;
  border: 1px solid #cbd5e1; border-radius: 10px; background:#fff; color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring);
}
.input.error, .select.error { border-color:#ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.15); }
.hint-error { color:#dc2626; font-size:12px; margin-top:4px; }

/* Panel / carta */
.panel { background: var(--card); border: 1px solid #e2e8f0; border-radius: 16px; }

/* Animaciones */
@keyframes fadeUp { from { opacity:0; transform: translateY(8px);} to {opacity:1; transform:none;} }
.anim-in { animation: fadeUp .22s ease both; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }

/* Toast */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; flex-direction: column; gap: 10px;
}
.toast-item {
  min-width: 260px; max-width: 380px;
  padding: 12px 16px; border-radius: 12px; color: #fff;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.35);
  animation: fadeUp .2s ease both;
  font-size: 14px; font-weight: 500;
}
.toast-ok   { background: #059669; }
.toast-err  { background: #dc2626; }
.toast-info { background: #334155; }

/* Transición de vistas */
.view-enter-active { transition: all .22s ease; }
.view-enter-from { opacity: 0; transform: translateY(10px); }

/* Evitar scroll horizontal accidental a nivel de página */
html, body { max-width: 100%; overflow-x: hidden; }

/* Tablas responsive: en celular, cada fila se muestra como tarjeta apilada */
@media (max-width: 640px) {
  table.resp thead { display: none; }
  table.resp, table.resp tbody, table.resp tr, table.resp td { display: block; width: 100%; }
  table.resp tr {
    border: 1px solid var(--line); border-radius: 12px;
    margin-bottom: 10px; padding: 8px 12px; background: #fff;
  }
  table.resp td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    border: 0; padding: 5px 0; text-align: right;
  }
  table.resp td::before {
    content: attr(data-l); color: var(--muted); font-weight: 600;
    text-align: left; margin-right: auto; font-size: 12px; text-transform: uppercase; letter-spacing: .3px;
  }
  table.resp td:empty, table.resp td[data-l=""] { display: none; }
}

/* Tabs */
.tab { padding: 8px 14px; border-radius: 10px; font-size:14px; font-weight:600; cursor:pointer; color: var(--muted); }
.tab.active { background: var(--brand-soft); color: var(--brand-dark); }
.tab:hover:not(.active) { background:#f1f5f9; }
