/* IncliU — hoja de estilos sin dependencias de compilación (no requiere Node/Vite en el servidor). */
:root {
  --green-900: #0b3d25;
  --green-700: #116b3f;
  --green-600: #15804b;
  --green-50: #eef7f1;
  --ink: #1d2530;
  --muted: #5b6573;
  --line: #d9dee5;
  --bg: #f5f7f9;
  --card: #ffffff;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --warn: #8a5300;
  --warn-bg: #fff4e0;
  --info-bg: #e8f1fb;
  --info: #174a85;
  --radius: 10px;
  --focus: 0 0 0 3px #f2b705;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5;
}
a { color: var(--green-700); }
a:hover { color: var(--green-900); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Estructura */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--green-900); color: #fff; padding: 1.25rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.25rem; color: #fff; text-decoration: none; margin-bottom: .25rem; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: #fff; color: var(--green-900); display: grid; place-items: center; font-weight: 800; }
.brand-sub { font-size: .78rem; color: #cfe5d8; margin: 0 0 1.25rem; }
.nav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #a9cdb8; margin: 1.2rem .5rem .4rem; }
.nav a { display: block; color: #eaf5ee; text-decoration: none; padding: .5rem .75rem; border-radius: 8px; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--green-900); font-weight: 600; }
.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 2rem; background: #fff; border-bottom: 1px solid var(--line); }
.topbar .who { font-size: .92rem; color: var(--muted); }
.topbar .who strong { color: var(--ink); }
.content { padding: 1.75rem 2rem 3rem; max-width: 1400px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.lead { color: var(--muted); margin: .25rem 0 0; }

/* Componentes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.stat .value { font-size: 2rem; font-weight: 700; color: var(--green-900); }
.stat .label { color: var(--muted); font-size: .9rem; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--green-700); background: var(--green-700); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--green-900); color: #fff; }
.btn-secondary { background: #fff; color: var(--green-700); }
.btn-secondary:hover { background: var(--green-50); color: var(--green-900); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #8c1c13; }
.btn-sm { padding: .3rem .65rem; font-size: .88rem; }
.btn-link { background: none; border: 0; color: var(--green-700); padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.alert { padding: .85rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--green-50); border-color: #b9dcc7; color: var(--green-900); }
.alert-error { background: var(--danger-bg); border-color: #f5c2bd; color: var(--danger); }
.alert-warn { background: var(--warn-bg); border-color: #f3d29b; color: var(--warn); }
.alert-info { background: var(--info-bg); border-color: #bcd3ee; color: var(--info); }
.alert ul { margin: .25rem 0 0; padding-left: 1.2rem; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef1f4; color: #39424e; white-space: nowrap; }
.badge-green { background: var(--green-50); color: var(--green-900); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-amber { background: var(--warn-bg); color: var(--warn); }
.badge-blue { background: var(--info-bg); color: var(--info); }

/* Tablas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f0f3f6; font-weight: 600; font-size: .85rem; color: #39424e; }
tbody tr:hover { background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 2rem; }

/* Formularios */
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field-full { grid-column: 1 / -1; }
label, .label { font-weight: 600; font-size: .9rem; }
.hint { font-size: .82rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid #b8c0ca; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green-700); outline: none; box-shadow: var(--focus); }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
.check input { width: 18px; height: 18px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .35rem; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; }
.error-text { color: var(--danger); font-size: .85rem; }
.filters { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }

/* Detalle */
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; }
dl.meta dt { color: var(--muted); font-size: .9rem; }
dl.meta dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 3px solid var(--green-600); padding: .2rem 0 .9rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 3px solid var(--green-600); }
.log-entry { border: 1px solid var(--line); border-radius: 8px; padding: .85rem 1rem; margin-bottom: .75rem; }
.log-entry header { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.small { font-size: .85rem; color: var(--muted); }
details > summary { cursor: pointer; font-weight: 600; color: var(--green-700); }
pre.json { background: #f6f8fa; padding: .5rem; border-radius: 6px; font-size: .78rem; white-space: pre-wrap; word-break: break-word; margin: .25rem 0; max-width: 420px; }

/* Desgloses y barras apiladas (cifras que suman un total) */
.bar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: #eef1f4; margin: .5rem 0 .9rem; }
.bar span { display: block; height: 100%; }
.bar-green, .dot-green { background: #15804b; }
.bar-amber, .dot-amber { background: #e0a100; }
.bar-red, .dot-red { background: #c4321f; }
.bar-gray, .dot-gray { background: #b8c0ca; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: baseline; }
table.breakdown td, table.breakdown th { padding: .45rem .5rem; }
table.breakdown tfoot th { border-top: 2px solid var(--ink); background: none; font-size: .93rem; }
table.report th.group { text-align: center; border-left: 1px solid var(--line); }
table.report tfoot th { background: #e3e8ee; border-top: 2px solid var(--ink); font-size: .93rem; color: var(--ink); }
table.report tr.faculty-row th { background: var(--green-50); color: var(--green-900); font-size: .9rem; }
table.report tr.subtotal td { font-weight: 600; background: #fafbfc; }
.result-count { margin: 0 0 .75rem; color: var(--muted); }
.result-count strong { color: var(--ink); font-size: 1.1rem; }
code { background: #f0f3f6; padding: .05rem .35rem; border-radius: 4px; font-size: .88em; }

/* Paginación */
.pagination { display: flex; gap: .3rem; list-style: none; padding: 0; margin: 1rem 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-block; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: #fff; }
.pagination .active span { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.pagination .disabled span { color: #9aa3ad; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(135deg, var(--green-900), var(--green-600)); }
.auth .card { width: 100%; max-width: 420px; padding: 2rem; }
.auth .brand { color: var(--green-900); }
.auth .brand-mark { background: var(--green-900); color: #fff; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content, .topbar { padding-left: 1rem; padding-right: 1rem; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .app { display: block; }
}
