/* SGDOC DMC · Hoja de estilos
   Paleta tomada del logo DMC Mining Services: gris #9B9C9E y amarillo #FEC93D */

:root {
  --ink: #1d1f22;
  --ink-2: #44474c;
  --muted: #74777c;
  --line: #e2e1dc;
  --line-2: #ecebe7;
  --bg: #f2f2ef;
  --card: #ffffff;
  --side: #232528;
  --side-2: #2d3034;
  --side-ink: #b9babd;
  --brand-gray: #9b9c9e;
  --yellow: #fec93d;
  --yellow-2: #f2b81c;
  --yellow-soft: #fff5d6;

  --st1: #1d7a48;  --st1-bg: #e4f3ea;
  --st2: #a96300;  --st2-bg: #fff0d4;
  --st3: #bf3328;  --st3-bg: #fbe5e2;
  --st6: #6b6e73;  --st6-bg: #ebebe8;
  --blue: #2c5a86; --blue-bg: #e4edf6;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 22, 25, .05), 0 2px 10px rgba(20, 22, 25, .04);
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; margin: 0; letter-spacing: .1px; }
.mono { font-family: var(--mono); font-size: .88em; letter-spacing: -.2px; }
.muted { color: var(--muted); }
.ico { flex: none; vertical-align: middle; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ---------- Estructura ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid #000;
}
.brand { padding: 22px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand img { width: 128px; display: block; }
.brand-sub {
  margin-top: 10px; font-family: var(--font-head); font-size: 12px; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--yellow);
}
.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-sec {
  margin: 16px 10px 6px; font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: #77797d;
}
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 7px;
  text-decoration: none; color: var(--side-ink); font-weight: 500; position: relative;
}
.nav-link:hover { background: var(--side-2); color: #fff; }
.nav-link.active { background: var(--side-2); color: #fff; }
.nav-link.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--yellow);
}
.nav-link.active .ico { color: var(--yellow); }
.nav-link span { flex: 1; }
.nav-link.small { font-size: 14px; padding: 7px 10px; }
.nav-count {
  font-style: normal; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.08);
  color: #d9dadc; padding: 1px 8px; border-radius: 20px;
}
.nav-count.hot { background: var(--st3); color: #fff; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); display: flex; flex-direction: column; gap: 6px; }
.next-mail {
  display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 8px 10px; border-radius: 7px;
  background: rgba(254, 201, 61, .08); color: #d8d9db;
}
.next-mail b { color: var(--yellow); font-weight: 600; }
.me { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 7px; text-decoration: none; }
.me:hover { background: var(--side-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-gray); color: var(--side);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none;
}
.me-txt { display: flex; flex-direction: column; min-width: 0; }
.me-txt b { color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt small { color: #8d8f93; font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 16px 32px; background: var(--card);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 23px; line-height: 1.15; }
.topbar-sub { font-size: 13px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.today { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.bell {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink-2); text-decoration: none;
}
.bell.on { color: var(--st3); border-color: #f0c9c4; background: var(--st3-bg); }
.bell i {
  position: absolute; top: -5px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--st3); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--card);
}
.content { padding: 26px 32px 40px; flex: 1; }
.app-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 32px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line);
}
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.only-mobile { display: none !important; }
.sidebar-backdrop { display: none; }

/* ---------- Tarjetas y bloques ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2);
}
.card-h h2 { font-size: 18px; flex: 1; display: flex; align-items: center; gap: 9px; }
.card-h .sub { font-size: 13px; color: var(--muted); }
.card-b { padding: 18px 20px; }
.card + .card, .stack > * + * { margin-top: 20px; }
:is(.grid-2, .grid-3, .grid-main, .alert-cols) > .card { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.section-title { font-size: 13px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted); margin: 28px 0 12px; font-family: var(--font); font-weight: 600; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  text-decoration: none; display: block; position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--k, var(--brand-gray)); }
.kpi:hover { border-color: #cfcec8; }
.kpi .k-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.kpi .k-label b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--k); color: #fff; font-size: 11px; letter-spacing: 0; }
.kpi .k-num { font-family: var(--font-head); font-size: 38px; font-weight: 600; line-height: 1.1; margin-top: 4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi .k-foot { font-size: 13px; color: var(--muted); }
.kpi.k1 { --k: var(--st1); } .kpi.k2 { --k: var(--st2); } .kpi.k3 { --k: var(--st3); } .kpi.k6 { --k: var(--st6); } .kpi.k0 { --k: var(--yellow); }

/* Paneles de alerta */
.alert-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.alert-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.alert-card .ah { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; }
.alert-card .ah .ai { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.alert-card .ah h3 { font-size: 17px; }
.alert-card .ah p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.alert-card .an { margin-left: auto; font-family: var(--font-head); font-size: 32px; font-weight: 600; line-height: 1; }
.alert-card.red .ai { background: var(--st3-bg); color: var(--st3); } .alert-card.red .an { color: var(--st3); }
.alert-card.amber .ai { background: var(--st2-bg); color: var(--st2); } .alert-card.amber .an { color: var(--st2); }
.alert-card.blue .ai { background: var(--blue-bg); color: var(--blue); } .alert-card.blue .an { color: var(--blue); }
.alert-list { list-style: none; margin: 0; padding: 0 8px 8px; flex: 1; }
.alert-list li a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 10px; border-radius: 7px; text-decoration: none;
}
.alert-list li a:hover { background: #f7f7f4; }
.alert-list .al-code { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-list .al-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; grid-column: 1; }
.alert-list .al-meta { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; }
.alert-card.red .al-meta { color: var(--st3); } .alert-card.amber .al-meta { color: var(--st2); } .alert-card.blue .al-meta { color: var(--blue); }
.alert-foot { border-top: 1px solid var(--line-2); padding: 10px 18px; font-size: 14px; }
.alert-foot a { font-weight: 600; text-decoration: none; }
.alert-foot a:hover { text-decoration: underline; }
.alert-empty { padding: 6px 18px 18px; font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.alert-empty .ico { color: var(--st1); }

/* Barra por área */
.area-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 44px; gap: 12px; align-items: center; padding: 7px 0; font-size: 14px; }
.area-row + .area-row { border-top: 1px dashed var(--line-2); }
.area-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack-bar { display: flex; height: 12px; border-radius: 3px; overflow: hidden; background: var(--line-2); gap: 2px; }
.stack-bar span { display: block; height: 100%; }
.sb-1 { background: var(--st1); } .sb-2 { background: #e09a2a; } .sb-3 { background: var(--st3); } .sb-6 { background: #b6b7b9; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Leyenda de reglas */
.rules { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.rules li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.rules li .badge, .rules li .chip { flex: none; margin-top: 1px; }
.rules p { margin: 0; color: var(--ink-2); }

/* ---------- Badges y chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 20px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1.3;
}
.badge b {
  display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; font-size: 11px; color: #fff;
}
.st-1 { background: var(--st1-bg); color: var(--st1); } .st-1 b { background: var(--st1); }
.st-2 { background: var(--st2-bg); color: var(--st2); } .st-2 b { background: var(--st2); }
.st-3 { background: var(--st3-bg); color: var(--st3); } .st-3 b { background: var(--st3); }
.st-6 { background: var(--st6-bg); color: var(--st6); } .st-6 b { background: var(--st6); }
.badge-big { font-size: 14px; padding: 5px 13px 5px 5px; }
.badge-big b { width: 24px; height: 24px; font-size: 13px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 2px 8px;
  border-radius: 5px; white-space: nowrap; line-height: 1.5;
}
.chip-red { background: var(--st3); color: #fff; }
.chip-amber { background: var(--yellow); color: #3a2a00; }
.chip-green { background: var(--st1-bg); color: var(--st1); }
.chip-muted { background: var(--line-2); color: var(--ink-2); }
.chip-blue { background: var(--blue-bg); color: var(--blue); }
.chip-blue-o { border: 1px solid #b9cde2; color: var(--blue); padding: 1px 7px; }
.chip-role { background: var(--line-2); color: var(--ink-2); }
.chip-role.superadmin { background: var(--side); color: var(--yellow); }
.chip-role.admin { background: var(--yellow-soft); color: #7a5600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 14px var(--font);
  text-decoration: none; cursor: pointer; white-space: nowrap; line-height: 1.2;
}
.btn:hover { border-color: #c9c8c2; background: #fafaf8; }
.btn-primary { background: var(--yellow); border-color: var(--yellow-2); color: #1d1f22; }
.btn-primary:hover { background: var(--yellow-2); border-color: #d9a20f; }
.btn-dark { background: var(--side); border-color: var(--side); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; }
.btn-danger { color: var(--st3); border-color: #efc7c2; }
.btn-danger:hover { background: var(--st3-bg); border-color: var(--st3); }
.btn-ok { background: var(--st1); border-color: var(--st1); color: #fff; }
.btn-ok:hover { background: #166239; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: underline; font: inherit; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 18px; }

/* ---------- Filtros y tablas ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.filters .f { display: flex; flex-direction: column; gap: 4px; }
.filters .f label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; }
.filters .f-search { flex: 1 1 240px; }
.filters .f:not(.f-search) { flex: 0 1 150px; min-width: 120px; }
.search-box { position: relative; }
.search-box .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input[type=search], .search-box input { padding-left: 36px; }
.result-info { padding: 10px 16px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 600;
  padding: 10px 12px; background: #fafaf8; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover td { background: #fbfbf8; }
.tbl tr.row-link { cursor: pointer; }
.tbl .t-title { font-weight: 500; min-width: 260px; }
.tbl .t-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.tbl .t-title a { text-decoration: none; }
.tbl .t-title a:hover { text-decoration: underline; }
.tbl .t-code { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.tbl .t-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.file-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; background: var(--card);
}
.file-btn:hover { background: var(--yellow); border-color: var(--yellow-2); }
.file-btn.locked { color: #a9abae; background: #f6f6f4; cursor: not-allowed; }
.row-cancel td { color: #9a9ca0; }
.row-cancel .t-title { text-decoration: line-through; text-decoration-color: #c3c4c6; }

/* ---------- Formularios ---------- */
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d6d5cf; border-radius: 8px; background: #fff;
  font: 15px var(--font); color: var(--ink); min-height: 40px;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #c39213; box-shadow: 0 0 0 3px rgba(254, 201, 61, .35); }
input[readonly] { background: #f6f6f3; color: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; grid-column: span 6; min-width: 0; }
.field.c3 { grid-column: span 3; } .field.c4 { grid-column: span 4; } .field.c8 { grid-column: span 8; } .field.c12 { grid-column: span 12; } .field.c2 { grid-column: span 2; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .req { color: var(--st3); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--side); }
.form-sec { grid-column: span 12; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line-2); font-family: var(--font-head); font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.form-sec:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--line-2); background: #fbfbf9; border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.estatus-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.estatus-pick label {
  border: 1.5px solid var(--line); border-radius: 9px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; color: var(--muted); line-height: 1.35;
}
.estatus-pick input { position: absolute; opacity: 0; pointer-events: none; }
.estatus-pick .badge, .estatus-pick .chip { align-self: flex-start; }
.estatus-pick label { position: relative; }
.estatus-pick label:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: #fcfcfa; }
.estatus-pick label:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(254, 201, 61, .5); }
.dropzone {
  border: 2px dashed #d0cfc8; border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); background: #fbfbf9;
  position: relative; transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--yellow-2); background: var(--yellow-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone b { color: var(--ink); }
.dropzone .dz-file { margin-top: 8px; font-weight: 600; color: var(--ink); }

/* ---------- Ficha de documento ---------- */
.doc-head { padding: 22px 24px; display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.doc-head .dh-main { flex: 1; min-width: 260px; }
.doc-head .dh-code { font-family: var(--mono); font-size: 13.5px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.doc-head h2 { font-size: 26px; line-height: 1.2; margin: 6px 0 12px; }
.meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.meta-grid > div { padding: 14px 24px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); min-width: 0; }
.meta-grid > div:nth-child(4n) { border-right: 0; }
.meta-grid dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; }
.meta-grid dd { margin: 3px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.status-box { border-radius: var(--radius); padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.status-box .ico { margin-top: 2px; }
.status-box h3 { font-size: 18px; }
.status-box p { margin: 4px 0 0; font-size: 14px; }
.sb-red { background: var(--st3-bg); color: #7d1d15; border: 1px solid #f0c4be; }
.sb-amber { background: var(--st2-bg); color: #6a3f00; border: 1px solid #f3d59b; }
.sb-green { background: var(--st1-bg); color: #10492a; border: 1px solid #b7dfc6; }
.sb-gray { background: var(--st6-bg); color: #46484c; border: 1px solid #dcdcd8; }
.sb-blue { background: var(--blue-bg); color: #1d3e5f; border: 1px solid #c3d5e8; }
.plazo-bar { margin-top: 14px; }
.plazo-track { display: grid; gap: 3px; }
.plazo-track span { height: 10px; border-radius: 2px; background: rgba(0,0,0,.08); }
.plazo-track span.done { background: var(--st2); }
.plazo-track span.warn { outline: 2px solid rgba(191, 51, 40, .45); outline-offset: -2px; }
.plazo-track.over span.done { background: var(--st3); }
.plazo-labels { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; opacity: .85; }
.file-card { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fbfbf9; }
.file-card .fi { width: 44px; height: 52px; border-radius: 6px; background: var(--side); color: var(--yellow); display: grid; place-items: center; font: 700 11px var(--font); letter-spacing: .5px; flex: none; }
.file-card .fn { font-weight: 600; overflow-wrap: anywhere; }
.file-card .fm { font-size: 13px; color: var(--muted); }
.file-card .fx { flex: 1; min-width: 0; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.hist li:first-child { border-top: 0; }
.hist .hx { flex: 1; min-width: 0; }
.hist .hx small { display: block; color: var(--muted); font-size: 12.5px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-gray); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline small { display: block; color: var(--muted); font-size: 12px; }
.note { font-size: 13.5px; color: var(--ink-2); background: #f7f7f4; border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; }

/* ---------- Mensajes ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 9px; margin-bottom: 16px; font-size: 14.5px; border: 1px solid; }
.flash > div { flex: 1; }
.flash-ok { background: var(--st1-bg); border-color: #b7dfc6; color: #10492a; }
.flash-error { background: var(--st3-bg); border-color: #f0c4be; color: #7d1d15; }
.flash-aviso { background: var(--st2-bg); border-color: #f3d59b; color: #6a3f00; }
.flash-info { background: var(--blue-bg); border-color: #c3d5e8; color: #1d3e5f; }
.flash-x { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0 2px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h2 { color: var(--ink); margin: 12px 0 6px; }
.empty-state .btn { margin-top: 14px; }
.secret { font-family: var(--mono); font-size: 18px; background: var(--side); color: var(--yellow); padding: 8px 14px; border-radius: 7px; display: inline-block; letter-spacing: 1px; user-select: all; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); background: var(--card);
}
.login-art {
  background: var(--side); color: #d5d6d8; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-art::before {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 22px),
    radial-gradient(ellipse at 110% 120%, rgba(254, 201, 61, .22), transparent 55%);
}
.login-art > * { position: relative; }
.login-art img { width: 210px; }
.login-art h2 { font-size: 44px; line-height: 1.05; color: #fff; max-width: 520px; font-weight: 600; }
.login-art h2 em { font-style: normal; color: var(--yellow); }
.login-art p { max-width: 480px; font-size: 16px; color: #a9abae; }
.login-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.login-legend .badge { background: rgba(255,255,255,.07); color: #e3e4e6; }
.login-art .foot { font-size: 12.5px; color: #85878b; }
.login-box { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 80px); }
.login-box .lb-logo { width: 150px; margin-bottom: 28px; display: none; }
.login-box h1 { font-size: 30px; }
.login-box > p { color: var(--muted); margin: 6px 0 26px; }
.login-box form { display: flex; flex-direction: column; gap: 16px; max-width: 380px; }
.login-box .btn { padding: 12px 18px; font-size: 15px; }
.login-box .credit { margin-top: 36px; font-size: 12.5px; color: var(--muted); }

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .alert-cols { grid-template-columns: 1fr; }
  .grid-main { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-grid > div:nth-child(4n) { border-right: 1px solid var(--line-2); }
  .meta-grid > div:nth-child(2n) { border-right: 0; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
  .icon-btn.only-mobile { display: inline-grid !important; }
  .legend.only-mobile { display: flex !important; }
  .hide-mobile { display: none !important; }
  .topbar { padding: 12px 16px; }
  .topbar-title h1 { font-size: 20px; }
  .content { padding: 18px 16px 32px; }
  .app-foot { padding: 12px 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .k-num { font-size: 32px; }
  .field, .field.c3, .field.c4, .field.c8, .field.c2 { grid-column: span 12; }
  .estatus-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-box .lb-logo { display: block; }
  .area-row { grid-template-columns: 110px minmax(0, 1fr) 34px; }
  .filters .f { flex: 1 1 140px; }
}
@media (max-width: 700px) {
  .tbl-docs thead { display: none; }
  .tbl-docs, .tbl-docs tbody { display: block; }
  .tbl-docs tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 16px;
    grid-template-areas: "code code file" "title title title" "est alert alert"; border-bottom: 1px solid var(--line-2);
  }
  .tbl-docs td { padding: 0; border: 0; min-width: 0; }
  .tbl-docs .c-item, .tbl-docs .c-timb { display: none; }
  .tbl-docs .c-code { grid-area: code; align-self: center; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
  .tbl-docs .c-file { grid-area: file; }
  .tbl-docs .c-title { grid-area: title; min-width: 0; }
  .tbl-docs .c-est { grid-area: est; }
  .tbl-docs .c-alert { grid-area: alert; align-self: center; }
  .tbl-docs tbody tr:hover td { background: none; }
}
@media (max-width: 560px) {
  .meta-grid { grid-template-columns: 1fr; }
  .meta-grid > div { border-right: 0 !important; }
  .doc-head h2 { font-size: 22px; }
  .page-actions { flex-direction: column; align-items: stretch; }
}
@media print {
  .sidebar, .topbar, .app-foot, .filters, .btn, .file-btn { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; }
}
