/* Expedix: azul institucional, crema y dorado (combina con «Mi causa») */
:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --ink: #1e2530;
  --ink-2: #4f5866;
  --ink-3: #8a909a;
  --line: #e4dfd5;
  --brand: #1f3a5f;
  --brand-2: #2a4c78;
  --accent: #86652b;
  --gold: #d4b270;
  --side: #1f3a5f;
  --side-ink: #c9d3e0;
  --danger: #a5503e;
  --danger-bg: #f5e6e0;
  --warn: #9a7330;
  --warn-bg: #f4ecdd;
  --ok: #5e7a5a;
  --ok-bg: #e7ede3;
  --info-bg: #ebe8e2;
  --inhabil: #ede8e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(31, 58, 95, .06);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --serif: "Poppins", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1724;
    --surface: #16202f;
    --surface-2: #1d2a3c;
    --ink: #e8eaee;
    --ink-2: #b5bcc7;
    --ink-3: #7f8896;
    --line: #263347;
    --brand: #d4b270;
    --brand-2: #e0c38a;
    --accent: #d4b270;
    --gold: #d4b270;
    --side: #0b121d;
    --side-ink: #aab4c2;
    --danger: #d88c78;
    --danger-bg: #3a2621;
    --warn: #d3ae6a;
    --warn-bg: #372f21;
    --ok: #9db894;
    --ok-bg: #26301f;
    --info-bg: #2c2a26;
    --inhabil: #2a2723;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar / nav ---------- */
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px 22px; }
.brand-name { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.brand-sub { font-size: 12px; color: var(--ink-3); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button {
  display: flex; align-items: center; gap: 12px;
  background: none; border: 0; padding: 10px 12px; border-radius: 10px;
  cursor: pointer; color: var(--ink-2); text-align: left; font-weight: 500;
}
.nav button .ico { width: 20px; text-align: center; font-size: 17px; }
.nav button:hover { background: var(--surface-2); }
.nav button.active { background: var(--brand); color: var(--surface); }

.main { flex: 1; min-width: 0; padding: 28px 32px 60px; max-width: 1100px; }

@media (max-width: 760px) {
  .sidebar {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0;
    width: 100%; height: auto; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); z-index: 20;
  }
  .brand { display: none; }
  .nav { flex-direction: row; justify-content: space-around; }
  .nav button { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; flex: 1; align-items: center; }
  .nav button .ico { font-size: 19px; }
  .main { padding: 18px 16px 100px; }
}

/* ---------- Generic ---------- */
.view { display: none; }
.view.active { display: block; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
h1 { font-family: var(--serif); font-size: 28px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .num { font-size: 30px; font-weight: 700; font-family: var(--serif); }
.stat .lbl { color: var(--ink-2); font-size: 13px; }
.stat.danger .num { color: var(--danger); }
.stat.warn .num { color: var(--warn); }

/* ---------- Forms ---------- */
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
input[type=text], input[type=date], input[type=time], input[type=number], input[type=email], input[type=tel], input[type=search], select, textarea {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 9px 11px;
  font-size: 15px; font-weight: 400; color: var(--ink); width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: 0; }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 600; }
.item .meta { font-size: 13px; color: var(--ink-3); }
.item.done .title { text-decoration: line-through; color: var(--ink-3); }
.item.clickable { cursor: pointer; border-radius: 10px; }
.item.clickable:hover { background: var(--surface-2); }

.datebox {
  width: 52px; flex-shrink: 0; text-align: center; border-radius: 10px; padding: 5px 0;
  background: var(--surface-2); border: 1px solid var(--line);
}
.datebox .d { font-size: 20px; font-weight: 700; line-height: 1.1; }
.datebox .m { font-size: 11px; text-transform: uppercase; color: var(--ink-3); letter-spacing: .04em; }
.datebox.danger { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.datebox.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.badge.danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.info { background: var(--info-bg); color: var(--ink-2); border-color: transparent; }

.empty { padding: 26px 10px; text-align: center; color: var(--ink-3); }

.exp-card { cursor: pointer; transition: transform .08s ease; }
.exp-card:hover { transform: translateY(-1px); }
.exp-card .car { font-weight: 700; font-size: 15px; margin-bottom: 4px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.toolbar select { width: auto; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; word-break: break-word; }

.notice {
  background: var(--info-bg); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--ink-2);
}
.notice.warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- Result box (plazos) ---------- */
.result {
  border-radius: var(--radius); padding: 18px; background: var(--brand); color: var(--surface);
}
.result .big { font-family: var(--serif); font-size: 26px; font-weight: 700; margin: 4px 0 6px; }
.result .sub { opacity: .85; font-size: 14px; }
@media (prefers-color-scheme: dark) { .result { color: #1a1f29; } }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head .mes { font-family: var(--serif); font-size: 20px; font-weight: 700; flex: 1; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { text-align: center; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 4px 0; }
.cal .day {
  min-height: 74px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  padding: 5px 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.cal .day.out { opacity: .4; }
.cal .day.inh { background: var(--inhabil); }
.cal .day.today { border: 2px solid var(--accent); }
.cal .day.sel { outline: 2px solid var(--brand); }
.cal .day .n { font-size: 13px; font-weight: 700; }
.cal .day .tag { font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .dots { display: flex; gap: 3px; flex-wrap: wrap; }
.cal .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.cal .dot.vencimiento { background: var(--danger); }
.cal .dot.audiencia { background: var(--accent); }
.cal .dot.tarea { background: var(--ink-3); }
@media (max-width: 560px) {
  .cal .day { min-height: 50px; padding: 4px; }
  .cal .day .tag { display: none; }
}
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); margin-top: 10px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Modal ---------- */
dialog {
  border: 0; padding: 0; border-radius: 18px; width: min(620px, calc(100vw - 24px));
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(15, 20, 30, .45); }
.modal-card { padding: 22px; display: flex; flex-direction: column; gap: 16px; max-height: 88vh; overflow: auto; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 760px) { .toast { bottom: 90px; } }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tabs button.active { background: var(--brand); color: var(--surface); border-color: var(--brand); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table td, .table th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Guardado en la nube ---------- */
.sync-pill {
  position: fixed; top: 12px; right: 14px; z-index: 30;
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); box-shadow: var(--shadow);
}
.sync-pill.ok { color: var(--ok); }
.sync-pill.guardando, .sync-pill.cargando { color: var(--ink-2); }
.sync-pill.offline { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
@media (max-width: 760px) { .sync-pill { top: 8px; right: 8px; font-size: 11px; padding: 4px 8px; } .main { padding-top: 40px; } }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth[hidden], .app[hidden] { display: none; }
.auth-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px;
}
.auth-card input[type=password] {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 9px 11px; font-size: 15px; width: 100%; color: var(--ink);
}
.auth-error { background: var(--danger-bg); color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.auth-links a { color: var(--ink-2); }

/* ---------- Modelos ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px dashed var(--accent); background: transparent; color: var(--ink-2); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
textarea.editor {
  min-height: 55vh; font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.6; padding: 14px 16px;
}
.preview { margin-top: 6px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
dialog:has(textarea.editor) { width: min(860px, calc(100vw - 24px)); }

/* ---------- Área Legal ---------- */
.nav button.sub { padding: 6px 12px 6px 30px; font-size: 13px; font-weight: 500; }
.nav button.sub .ico { display: none; }
@media (max-width: 760px) { .nav button.sub { display: none; } }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid-3 { grid-template-columns: 1fr; } }
.col-legal h2 { font-size: 16px; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.mini-stats .rojo { color: var(--danger); font-weight: 700; }
.item .badge { flex-shrink: 0; }
.clickable-body { cursor: pointer; }
.sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-top: 6px; }
textarea.auto { min-height: 110px; }
textarea.editor-sm { min-height: 240px; font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.6; }
.chip.tag.on, .chip.dist.on { background: var(--brand); color: var(--surface); border-style: solid; border-color: var(--brand); }
.badge.dist { background: #efe6d2; color: #7a5b17; border-color: transparent; }
@media (prefers-color-scheme: dark) { .badge.dist { background: #3a3122; color: #e8cf96; } }
details.norma { border-bottom: 1px solid var(--line); padding: 10px 2px; }
details.norma summary { cursor: pointer; }
ul.links { padding-left: 18px; margin: 6px 0 0; }
ul.links li { margin: 4px 0; }

/* Kanban Casa Grande */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (max-width: 900px) { .kanban { grid-template-columns: 1fr; } }
.kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.kcol.over { outline: 2px dashed var(--accent); }
.kcol-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; }
.kcards { display: flex; flex-direction: column; gap: 8px; min-height: 30px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: grab; box-shadow: var(--shadow); }
.kcard.vencida { border-color: var(--danger); }
.kcard.dragging { opacity: .5; }
.kcard .title { font-weight: 600; }
.kmove { display: flex; justify-content: space-between; margin-top: 6px; }
.kadd { width: 100%; margin-top: 8px; }

/* Archivos */
.dropzone { border: 1.5px dashed var(--line); border-radius: 10px; padding: 12px; text-align: center; margin-bottom: 6px; }
.dropzone.over { border-color: var(--accent); background: var(--surface-2); }
.file-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 8px; background: var(--info-bg); color: var(--ink-2); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.texto-doc { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 50vh; overflow: auto; font-family: Georgia, serif; font-size: 14px; line-height: 1.55; }
mark { background: #ffe58a; color: #1d2433; border-radius: 3px; padding: 0 2px; }
.frag { margin-top: 4px; color: var(--ink-2); }
@media (max-width: 760px) { .nav button span:last-child { white-space: nowrap; font-size: 10.5px; } }

/* ---------- Ficha del caso: escritura amplia + secciones plegables ---------- */
.caso-resumen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.caso-resumen .sep { color: var(--ink-3); }
.caso-resumen a.badge { text-decoration: none; }
.card.objeto { margin-bottom: 16px; }
textarea.objeto-ta { min-height: 64px; font-size: 15px; line-height: 1.5; }
.workspace { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
@media (max-width: 900px) { .workspace { grid-template-columns: 1fr; } }
.ws-card { display: flex; flex-direction: column; }
.ws-head { margin-bottom: 8px; }
textarea.ws-ta { flex: 1; min-height: 62vh; font-family: var(--serif); font-size: 16px; line-height: 1.7; padding: 14px 16px; }
@media (max-width: 760px) { textarea.ws-ta { min-height: 50vh; } }
.secciones { display: flex; flex-direction: column; gap: 8px; }
details.seccion { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
details.seccion > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.seccion > summary::-webkit-details-marker { display: none; }
details.seccion > summary::before { content: "▸"; color: var(--ink-3); transition: transform .15s; }
details.seccion[open] > summary::before { transform: rotate(90deg); }
details.seccion > summary .cnt { font-weight: 500; font-size: 13px; color: var(--ink-3); }
.seccion-body { padding: 0 16px 14px; }
.det-body > .row > h2 { display: none; }
@media (prefers-reduced-motion: reduce) { details.seccion > summary::before { transition: none; } }

/* ---------- Inicio: accesos rápidos ---------- */
.accesos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .accesos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.acceso { display: flex; gap: 12px; align-items: center; text-align: left; cursor: pointer; border: 1px solid var(--line); font: inherit; color: inherit; }
.acceso:hover { background: var(--surface-2); }
.acceso .ico { font-size: 22px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex-shrink: 0; }
.acceso strong { display: block; }
.acceso.primary { background: var(--brand); color: var(--surface); border-color: var(--brand); }
.acceso.primary .muted { color: var(--surface); opacity: .8; }
.acceso.primary .ico { background: rgba(255,255,255,.15); }

/* ---------- Honorarios ---------- */
.hon-barra { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 14px 0 6px; }
.hon-barra > div { height: 100%; background: var(--ok); border-radius: 999px; }
tr.clickable-row { cursor: pointer; }
tr.clickable-row:hover td { background: var(--surface-2); }
tr.clickable-row.sel td { background: var(--info-bg); }
.hon-tabla td { font-variant-numeric: tabular-nums; }
.stat .num { font-variant-numeric: tabular-nums; }
textarea.cuaderno-ta { min-height: 45vh; }

/* ---------- Japandi: calma visual ---------- */
h1 { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-weight: 600; }
.card { box-shadow: none; border: 1px solid var(--line); }
.main { padding: 36px 44px 72px; }
.btn { border-radius: 8px; font-weight: 500; }
.badge { font-weight: 500; }
.badge.dist { background: #ece4d6; color: #6f5f48; }
@media (prefers-color-scheme: dark) { .badge.dist { background: #353026; color: #d8c8a8; } }
.stat .num { font-weight: 600; }
.nav button.active { background: var(--surface-2); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
.sidebar { background: var(--bg); }
input[type=text], input[type=date], input[type=time], input[type=number], input[type=email], input[type=tel], input[type=search], select, textarea { background: var(--surface); }
textarea.ws-ta, textarea.editor-sm, .texto-doc { font-family: var(--font); }
mark { background: #eadfc6; color: #2f2d2a; }
a { color: var(--accent); text-underline-offset: 2px; }

/* ---------- Modo enfoque ---------- */
.enfoque-btn { margin-top: 18px; width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; color: var(--ink-2); cursor: pointer; font: inherit; font-size: 13px; }
.enfoque-btn:hover { background: var(--surface-2); }
body.enfoque .sidebar { width: 64px; padding: 20px 8px; }
body.enfoque .brand > div, body.enfoque .nav button span:last-child, body.enfoque .nav button.sub, body.enfoque .enfoque-btn span:last-child { display: none; }
body.enfoque .brand { justify-content: center; padding: 0 0 22px; }
body.enfoque .nav button { justify-content: center; padding: 10px 0; }
body.enfoque .enfoque-btn { justify-content: center; padding: 8px 0; }
body.enfoque .main { max-width: 920px; margin: 0 auto; }
body.enfoque .sync-pill, body.enfoque .page-head .muted.small, body.enfoque .notice, body.enfoque .acceso .small, body.enfoque #view-honorarios .grid-4 { display: none; }
body.enfoque .card { background: transparent; }
body.enfoque details.seccion { background: transparent; border-color: transparent; border-bottom-color: var(--line); border-radius: 0; }
@media (max-width: 760px) {
  .enfoque-btn { display: none; }
  body.enfoque .sidebar { width: 100%; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  body.enfoque .nav button { padding: 6px 4px; }
}

/* ---------- Buscador e intereses ---------- */
.bs-input { font-size: 18px; padding: 14px 16px; }
.result-int { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.result-int strong { font-size: 17px; font-variant-numeric: tabular-nums; }

/* ---------- JUS ---------- */
.jus-valor { font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.jus-calc { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
.jus-calc .igual { padding-bottom: 10px; color: var(--ink-3); }
@media (max-width: 560px) { .jus-calc { grid-template-columns: 1fr; } .jus-calc .igual { display: none; } }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 7px 14px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--brand); color: var(--surface); }
.firma-prev { width: 220px; height: 90px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; background: #fff; }
.firma-prev img { max-width: 200px; max-height: 80px; }
.firma-prev.vacia { background: var(--surface-2); }
#view-honorarios .grid-4 .stat .num { font-size: clamp(18px, 1.9vw, 26px); white-space: nowrap; overflow-wrap: anywhere; }
/* Área Legal con cuatro áreas (Fideicomiso, Casa Grande, DRIVE, Casos) */
@media (max-width: 1300px) { #lgCols.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { #lgCols.grid-4 { grid-template-columns: 1fr; } }

/* ---------- Expedix: barra lateral azul con detalles dorados ---------- */
.sidebar { background: var(--side); border-right: 0; }
.sidebar .brand-name { color: #fff; letter-spacing: .01em; }
.sidebar .brand-sub { color: var(--side-ink); }
.nav button { color: var(--side-ink); }
.nav button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav button.active { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.enfoque-btn { color: var(--side-ink); border-color: rgba(255, 255, 255, .15); background: transparent; }
h1 { font-weight: 600; color: var(--brand); }
h2 { font-weight: 600; }
.btn.primary, .acceso.primary { color: #fff; }
@media (prefers-color-scheme: dark) {
  h1 { color: var(--ink); }
  .btn.primary, .acceso.primary { color: #0f1724; }
}
.card { box-shadow: var(--shadow); }
a { color: var(--brand); }
@media (prefers-color-scheme: dark) { a { color: var(--gold); } }
@media (max-width: 760px) {
  .sidebar { border-top: 0; box-shadow: 0 -2px 12px rgba(0, 0, 0, .12); }
  .nav button.active { box-shadow: inset 0 3px 0 var(--gold); }
}

/* ---------- Bienvenida guiada ---------- */
.bienvenida { border-color: var(--gold); }
.bv-barra { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 8px 0 14px; }
.bv-barra span { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .3s; }
.bv-paso { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.bv-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; background: var(--brand); color: #fff; }
.bv-paso.ok .bv-num { background: var(--ok-bg); color: var(--ok); }
.bv-paso.ok .bv-tit { color: var(--ink-3); text-decoration: line-through; }
.bv-cuerpo { flex: 1; min-width: 0; }
.bv-tit { font-weight: 600; margin-bottom: 2px; }
@media (prefers-color-scheme: dark) { .bv-num { color: #0f1724; } }

/* ---------- Tablero de Inicio y filtros rápidos ---------- */
.tablero { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .tablero { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tab-stat { text-align: left; cursor: pointer; font: inherit; color: inherit; border-left: 3px solid var(--brand); transition: transform .15s, box-shadow .15s; }
.tab-stat:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(31, 58, 95, .1); }
.tab-stat.warn { border-left-color: var(--warn); }
.tab-stat.danger { border-left-color: var(--danger); }
.tab-stat .num { font-size: 28px; font-weight: 600; line-height: 1.1; }
.tab-stat .lbl { font-size: 13px; color: var(--ink-2); }
.chips.rapidos { margin: 0 0 14px; }
.chips.rapidos .chip { border-style: solid; }
.chips.rapidos .chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (prefers-color-scheme: dark) { .chips.rapidos .chip.on { color: #0f1724; } }
.chips.rapidos .cnt { opacity: .7; margin-left: 4px; font-weight: 600; }
.resp-chip { font-size: 12px; color: var(--ink-2); margin: -2px 0 4px; }

/* ---------- Diligencias ---------- */
.dil-inst h2 { font-size: 15px; }
.item.dil { align-items: flex-start; }
.dil-check { width: 30px; height: 30px; padding: 0; border-radius: 50%; flex: none; font-weight: 700; color: var(--ok); }
.item.dil.done .dil-check { background: var(--ok-bg); border-color: var(--ok); }
.item.dil.done .title { text-decoration: line-through; color: var(--ink-3); }
.rojo { color: var(--danger); font-weight: 600; }
.dl-semana { flex-wrap: nowrap; }
@media (max-width: 560px) { .dl-semana strong { font-size: 13px; } }

/* ---------- Papeles: lo que no ve un pasante o diligenciador ---------- */
body.sin-honorarios details[data-det="hon"], body.sin-honorarios #fxHonLink, body.sin-honorarios #qCobro, body.sin-honorarios .solo-hon, body.sin-honorarios #nav button[data-view="honorarios"] { display: none !important; }
body.diligenciador #nav button:not([data-view="diligencias"]):not([data-view="ajustes"]) { display: none !important; }
body.diligenciador .solo-equipo { display: none !important; }

/* ---------- Compromiso de confidencialidad ---------- */
.conf-texto { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); font-size: 14px; }
.conf-texto p { margin: 0 0 8px; }
.ok-txt { color: var(--ok); font-weight: 600; }

/* ---------- Movimientos del expediente ---------- */
.movs { border-left: 2px solid var(--line); margin-left: 6px; }
.mov { display: flex; gap: 12px; padding: 8px 0 10px 14px; position: relative; align-items: flex-start; }
.mov::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.mov-fecha { font-size: 12px; font-weight: 600; color: var(--brand); min-width: 74px; padding-top: 2px; }
.mov-cuerpo { flex: 1; min-width: 0; }
.mov-tipo { font-weight: 600; font-size: 14px; }
.mov-det { font-size: 14px; color: var(--ink-2); white-space: pre-wrap; margin: 2px 0 4px; }
@media (prefers-color-scheme: dark) { .mov-fecha { color: var(--gold); } }
