/* ============================================================
   Noalexia · Asistente Legal IA — diseño elegante v2
   Tipografía display serif (estilo estudio jurídico) + sans para cuerpo.
   ============================================================ */
:root {
  --navy: #0e1b31;
  --navy-2: #152a4d;
  --navy-3: #1d3a63;
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #1b2740;
  --muted: #66708a;
  --line: #e4e8f1;
  --accent: #2050c4;
  --accent-2: #1a3f9c;
  --accent-soft: #e9effc;
  --gold: #b08d3f;
  --gold-soft: #f7f1e0;
  --ok: #1a7f37;
  --err: #c0392b;
  --warn: #a16207;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 27, 49, .05), 0 10px 30px rgba(14, 27, 49, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  background-image: radial-gradient(1000px 400px at 85% -10%, rgba(32, 80, 196, .05), transparent 60%);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(32, 80, 196, .18); }
.hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .brand-name, .auth-card h1 { font-family: var(--serif); }

/* Scrollbar elegante */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c6cede; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #a9b3c8; }

/* ===== Layout ===== */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 236px;
  background: linear-gradient(180deg, #0c1830 0%, var(--navy-2) 60%, #10213d 100%);
  color: #d6e0f2;
  display: flex; flex-direction: column;
  padding: 20px 14px 16px; z-index: 20;
  box-shadow: 4px 0 24px rgba(10, 20, 38, .18);
}
.brand { display: flex; gap: 11px; align-items: center; padding: 2px 8px 18px; border-bottom: 1px solid rgba(176, 141, 63, .28); margin-bottom: 16px; }
.brand-logo {
  width: 40px; height: 40px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  background: radial-gradient(circle at 30% 25%, #1d3a63, #0e1b31);
  border: 1px solid rgba(176, 141, 63, .55);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 4px 10px rgba(0, 0, 0, .25);
}
.brand-name { font-weight: 600; font-size: 21px; color: #fff; letter-spacing: .4px; line-height: 1.1; }
.brand-sub { font-size: 9.5px; color: var(--gold); letter-spacing: 1.6px; text-transform: uppercase; font-weight: 600; margin-top: 2px; }
.nav { flex: 1; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: #b9c6de; font-weight: 500; font-size: 14px;
  border: 1px solid transparent;
  transition: background .16s, color .16s, border-color .16s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 12px rgba(32, 80, 196, .35);
  border-color: rgba(255, 255, 255, .08);
}
.nav-ico { font-size: 15.5px; width: 22px; text-align: center; opacity: .95; }
.nav-sep {
  margin: 16px 8px 6px; font-size: 10px; font-weight: 700; color: var(--gold);
  letter-spacing: 1.4px; text-transform: uppercase;
}
.nav-ext {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: 9px;
  color: #93a4c4; font-weight: 500; font-size: 13px;
  border: 1px solid transparent;
  transition: background .15s, color .15s;
}
.nav-ext:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.user-chip { color: #b9c6de; font-size: 12.5px; padding: 2px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { margin-left: 236px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(246, 248, 252, .86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 15px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .2px; }
.topbar h1::after {
  content: ""; display: block; width: 34px; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  border-radius: 2px; margin-top: 3px;
}
.topbar-right { display: flex; gap: 8px; align-items: center; }
.view { padding: 24px 28px 48px; max-width: 1120px; width: 100%; margin: 0 auto; }

/* ===== Tarjetas y grid ===== */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px;
}
.card + .card { margin-top: 16px; }
.card h2 { margin: 0 0 10px; font-size: 17.5px; font-weight: 600; color: var(--navy); }
.card h3 { margin: 0 0 8px; font-size: 15.5px; font-weight: 600; color: var(--navy); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.stat { text-align: center; padding: 18px 10px 16px; position: relative; overflow: hidden; }
.stat::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, rgba(176, 141, 63, .6), transparent);
  opacity: 0; transition: opacity .25s;
}
.stat:hover::before { opacity: 1; }
.stat-num { font-size: 30px; font-weight: 800; color: var(--navy); letter-spacing: -.5px; }
.stat-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1.1px; margin-top: 3px; font-weight: 600; }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: var(--sans);
  transition: filter .15s, transform .12s, box-shadow .15s, background .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 16px rgba(32, 80, 196, .28);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover:not(:disabled) { background: #dbe5fb; }
.btn-ghost { background: transparent; color: inherit; border-color: #cdd4e2; }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: #fdeceb; color: var(--err); }
.btn-danger:hover:not(:disabled) { background: #f9dcd9; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ===== Formularios ===== */
label { display: block; font-size: 12.5px; font-weight: 650; color: var(--muted); margin: 12px 0 5px; letter-spacing: .2px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid #d9dfec; border-radius: 10px;
  font-size: 14.5px; font-family: inherit; background: #fbfcfe; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(32, 80, 196, .13);
}
textarea { resize: vertical; min-height: 110px; }
.fila { display: flex; gap: 12px; }
.fila > * { flex: 1; }
@media (max-width: 700px) { .fila { flex-direction: column; } }

/* ===== Badges ===== */
.badge {
  display: inline-block; padding: 2.5px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .2px;
}
.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-gold { background: var(--gold-soft); color: #8a6d2f; }
.badge-green { background: #e4f4ea; color: var(--ok); }
.badge-red { background: #fdeceb; color: var(--err); }
.badge-gray { background: #eef1f6; color: var(--muted); }

/* ===== Listas / filas ===== */
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 17px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); margin-bottom: 10px;
  transition: box-shadow .16s, border-color .16s, transform .12s;
}
.row:hover { border-color: #c8d3e8; box-shadow: var(--shadow); }
.row.clickable:hover { transform: translateY(-1px); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 650; font-size: 15px; }
.row-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.encabezado { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.encabezado h2 { margin: 0; font-size: 21px; font-weight: 600; color: var(--navy); }
.desc-muted { color: var(--muted); font-size: 13.5px; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(9, 17, 32, .55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 44px 16px; z-index: 50; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
  width: 100%; max-width: 760px; padding: 24px 26px;
  animation: subir .2s ease-out;
  border: 1px solid rgba(255, 255, 255, .4);
}
.modal h2, .modal h3 { margin: 0 0 6px; font-size: 19px; color: var(--navy); }
.modal-close { float: right; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; border-radius: 8px; padding: 2px 8px; }
.modal-close:hover { background: var(--bg); color: var(--ink); }
@keyframes subir { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Alertas y toasts ===== */
.alert { padding: 12px 15px; border-radius: 11px; font-size: 14px; margin: 10px 0; }
.alert-error { background: #fdeceb; color: var(--err); border: 1px solid #f3c9c5; }
.alert-warn { background: #fbf3e0; color: var(--warn); border: 1px solid #ecd9ae; }
.alert-info { background: var(--accent-soft); color: var(--accent); border: 1px solid #c9d7f5; }

#toasts { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy); color: #fff; padding: 12px 17px; border-radius: 12px;
  font-size: 13.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); max-width: 380px;
  animation: subir .22s ease-out;
  border-left: 3px solid var(--gold);
}
.toast.err { background: var(--err); border-left-color: #f6c6c2; }
.toast.warn { background: var(--warn); border-left-color: #f3ddb0; }

/* ===== Auth ===== */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(700px 400px at 15% -10%, rgba(176, 141, 63, .14), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(32, 80, 196, .25), transparent 60%),
    linear-gradient(160deg, #101d38 0%, var(--navy) 45%, #0a1426 100%);
}
.auth-card {
  background: #fff; border-radius: 18px; box-shadow: 0 30px 90px rgba(0, 0, 0, .45);
  width: 100%; max-width: 410px; padding: 34px 36px;
  border-top: 3px solid var(--gold);
}
.auth-logo {
  width: 62px; height: 62px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: radial-gradient(circle at 30% 25%, #1d3a63, #0e1b31);
  border: 1px solid rgba(176, 141, 63, .6);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(14, 27, 49, .3);
}
.auth-card h1 { text-align: center; margin: 4px 0 2px; font-size: 27px; color: var(--navy); letter-spacing: .4px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.auth-alt { text-align: center; font-size: 13.5px; margin-top: 16px; }
.auth-disclaimer { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }

/* ===== Chat ===== */
.chat-layout { display: grid; grid-template-columns: 285px 1fr; gap: 16px; height: calc(100vh - 150px); min-height: 430px; }
@media (max-width: 800px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-side {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow);
}
.chat-side-head { padding: 13px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; flex-direction: column; background: #fafbfe; }
.chat-list { overflow-y: auto; flex: 1; }
.chat-item {
  padding: 12px 15px; border-bottom: 1px solid #eef1f6; cursor: pointer;
  transition: background .13s, border-left .13s;
  border-left: 3px solid transparent;
}
.chat-item:hover { background: var(--bg); }
.chat-item.active { background: var(--accent-soft); border-left-color: var(--accent); }
.chat-item-t { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-s { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-main {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow);
}
.chat-banner { background: var(--accent-soft); color: var(--accent); font-size: 12.5px; padding: 8px 18px; border-bottom: 1px solid #d2def7; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.burbuja { max-width: 78%; padding: 12px 16px; border-radius: 15px; font-size: 14.5px; }
.burbuja.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-bottom-right-radius: 5px;
  white-space: pre-wrap;
  box-shadow: 0 4px 12px rgba(32, 80, 196, .25);
}
.burbuja.assistant { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.burbuja.assistant p { margin: 0 0 8px; }
.burbuja.assistant p:last-child { margin-bottom: 0; }
.burbuja.assistant h2, .burbuja.assistant h3, .burbuja.assistant h4 { margin: 12px 0 6px; font-family: var(--serif); }
.burbuja.assistant ul, .burbuja.assistant ol { margin: 6px 0; padding-left: 22px; }
.burbuja.assistant li { margin: 2px 0; }
.burbuja.assistant blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--accent); color: var(--muted); background: #f0f3f9; border-radius: 0 8px 8px 0; }
.burbuja.assistant code { background: #e9edf5; padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.burbuja.assistant pre { background: #101b2e; color: #dbe6f7; padding: 12px; border-radius: 9px; overflow-x: auto; }
.burbuja.assistant pre code { background: none; padding: 0; color: inherit; }
.burbuja.assistant hr { border: none; border-top: 1px solid var(--line); margin: 12px 0; }
.meta { font-size: 11px; color: var(--muted); margin-top: 5px; opacity: .8; }
.burbuja.user .meta { color: rgba(255, 255, 255, .7); }
.chat-input { border-top: 1px solid var(--line); padding: 13px; display: flex; gap: 10px; align-items: flex-end; background: #fafbfe; }
.chat-input textarea { min-height: 48px; max-height: 140px; flex: 1; }
.pensando { display: inline-flex; gap: 5px; padding: 15px 19px; background: var(--bg); border: 1px solid var(--line); border-radius: 15px; align-self: flex-start; }
.pensando i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulso 1.2s infinite; }
.pensando i:nth-child(2) { animation-delay: .2s; }
.pensando i:nth-child(3) { animation-delay: .4s; }
@keyframes pulso { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }

/* ===== Documentos ===== */
.doc-file { display: flex; align-items: center; gap: 12px; }
.doc-ico { font-size: 26px; }
.dropzone {
  border: 2px dashed #c9d4ea; border-radius: 12px; padding: 20px;
  text-align: center; color: var(--muted); background: #fafbfe; cursor: pointer;
  transition: border-color .16s, background .16s;
  font-size: 14px;
}
.dropzone:hover { border-color: var(--accent); background: #f4f7ff; }

/* ===== Análisis ===== */
.analisis-body { font-size: 14.5px; line-height: 1.65; }
.analisis-body h2 { font-size: 16.5px; margin: 20px 0 8px; border-bottom: 2px solid var(--accent-soft); padding-bottom: 6px; font-family: var(--serif); color: var(--navy); }
.analisis-body h3, .analisis-body h4 { margin: 14px 0 6px; font-family: var(--serif); color: var(--navy); }
.analisis-body p { margin: 6px 0; }
.analisis-body ul, .analisis-body ol { margin: 6px 0; padding-left: 22px; }
.analisis-body blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--accent); color: var(--muted); background: #f0f3f9; border-radius: 0 8px 8px 0; }
.analisis-body code { background: #e9edf5; padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.analisis-body pre { background: #101b2e; color: #dbe6f7; padding: 12px; border-radius: 9px; overflow-x: auto; }
.analisis-body hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }

/* ===== Varios ===== */
.vacio { text-align: center; color: var(--muted); padding: 36px 12px; }
.vacio .vacio-ico { font-size: 40px; margin-bottom: 10px; display: block; }
.spin {
  display: inline-block; width: 17px; height: 17px;
  border: 2px solid rgba(32, 80, 196, .2); border-top-color: var(--accent);
  border-radius: 50%; animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
.aviso-legal {
  font-size: 12px; color: var(--muted); background: #f7f8fb;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; margin-top: 14px;
  line-height: 1.55;
}

/* ===== Pestañas internas ===== */
.tabs-interno { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs-interno button {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  padding: 8px 17px; border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: all .16s;
}
.tabs-interno button:hover { border-color: var(--accent); color: var(--accent); }
.tabs-interno button.activo {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 12px rgba(32, 80, 196, .3);
}

/* ===== Calculadoras ===== */
.campo { margin-bottom: 10px; }
.campo label { margin: 8px 0 4px; }
.ayuda { font-size: 12.5px; color: var(--muted); margin: 4px 0 8px; }
.check { display: flex; align-items: center; gap: 9px; margin: 7px 0; font-size: 13.5px; }
.check input { width: auto; }
.nota-legal {
  font-size: 12px; color: var(--muted); background: #f7f8fb;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; margin-top: 14px;
  line-height: 1.6;
}
.resultado {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; border-radius: 13px; padding: 18px 20px; margin: 14px 0;
  box-shadow: 0 10px 26px rgba(14, 27, 49, .25);
  border: 1px solid rgba(255, 255, 255, .06);
}
.r-etiq { font-size: 12px; color: #b9c8e4; letter-spacing: .3px; }
.r-monto { font-size: 28px; font-weight: 800; margin: 3px 0; letter-spacing: -.3px; }
.r-sub { font-size: 13px; color: #c9d6ee; }
.linea-resultado {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.linea-resultado:last-child { border-bottom: none; }
.linea-resultado .m { font-weight: 700; white-space: nowrap; }
.linea-resultado .ley { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.detalle-tabla { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.detalle-tabla th, .detalle-tabla td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; }
.detalle-tabla th { background: #f7f8fc; font-size: 12px; font-weight: 650; }
.detalle-tabla tr:nth-child(even) td { background: #fafbfe; }
details.mas { margin-top: 10px; }
details.mas summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 650; }

/* ===== Agenda / listas ===== */
.titulo-seccion { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; margin: 18px 0 9px; }
.lista-item {
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px; margin-bottom: 9px; cursor: pointer;
  transition: box-shadow .16s, border-color .16s, transform .12s;
}
.lista-item:hover { border-color: #c8d3e8; box-shadow: var(--shadow); transform: translateY(-1px); }
.lista-item .badge { font-size: 21px; }
.lista-item .cuerpo { flex: 1; min-width: 0; }
.lista-item .t { font-weight: 650; font-size: 14.5px; }
.lista-item .s { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.lista-item .der { text-align: right; flex: none; }
.lista-item .f { font-weight: 650; font-size: 13px; }
.lista-item .d { margin-top: 3px; }
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .2px;
}
.chip.ok { background: #e4f4ea; color: var(--ok); }
.chip.warn { background: #fbf3e0; color: var(--warn); }
.chip.err { background: #fdeceb; color: var(--err); }
.chip.info { background: var(--accent-soft); color: var(--accent); }
.chip.gris { background: #eef1f6; color: var(--muted); }
.lista-vacia { text-align: center; color: var(--muted); padding: 32px 10px; }
.lista-vacia .ic { font-size: 36px; display: block; margin-bottom: 8px; }
.detalle-fila { display: flex; gap: 10px; padding: 5px 0; font-size: 14px; }
.detalle-fila .k { color: var(--muted); min-width: 72px; }
.detalle-fila .v { flex: 1; word-break: break-word; }
.detalle-acciones { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* ===== Notas ===== */
.nota-texto { white-space: pre-wrap; font-size: 14px; line-height: 1.65; }
.btn.grabando { background: var(--err); color: #fff; box-shadow: 0 4px 12px rgba(192, 57, 43, .3); }

/* ===== Grabador ===== */
.grab-panel {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(135deg, #f7f8fc, #eef1f8);
  border: 1px solid var(--line);
  border-radius: 13px; padding: 18px 20px; margin: 12px 0 4px;
}
.grab-btn {
  width: 74px; height: 74px; flex: none; border-radius: 50%;
  border: none; cursor: pointer; font-size: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(32, 80, 196, .35);
  transition: transform .15s, box-shadow .15s;
}
.grab-btn:hover { transform: scale(1.05); }
.grab-btn.grabando {
  background: linear-gradient(135deg, #d6453a, #a93226);
  box-shadow: 0 0 0 0 rgba(214, 69, 58, .45);
  animation: latido 1.6s infinite;
}
@keyframes latido {
  0% { box-shadow: 0 0 0 0 rgba(214, 69, 58, .45); }
  70% { box-shadow: 0 0 0 16px rgba(214, 69, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(214, 69, 58, 0); }
}
.grab-info { flex: 1; }
.grab-tiempo { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--navy); letter-spacing: 1px; }
.grab-estado { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.grab-estado.grab-encendido { color: var(--err); font-weight: 700; }

/* Guía Judicial */
#gres .lista-item .t { font-size: 14px; }
#gres .lista-item .s { font-size: 12px; }
@media (max-width: 900px) {
  #view .card [style*="grid-template-columns"] { grid-template-columns: 1fr 1fr !important; }
}
