
:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --ink: #17212f;
  --muted: #667085;
  --line: #d7dee8;
  --brand: #0b5d55;
  --brand-2: #1f6f8b;
  --soft: #eaf5f3;
  --accent: #b7791f;
  --danger-soft: #fff7ed;
  --shadow: 0 10px 28px rgba(23, 33, 47, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(11, 93, 85, .08), rgba(243, 246, 248, 0) 260px),
    var(--bg);
}
a { color: inherit; }
.site-header {
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 18px rgba(23, 33, 47, .06);
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 24px 14px;
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: 0 10px 22px rgba(11, 93, 85, .24);
}
h1 { margin: 0; font-size: 25px; line-height: 1.18; letter-spacing: 0; }
.system-name { margin-top: 3px; color: var(--muted); font-size: 14px; }
.context-pill {
  border: 1px solid #b7d9d2;
  color: var(--brand);
  background: var(--soft);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.top-nav {
  margin-top: 15px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.top-nav a {
  text-decoration: none;
  color: #254152;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.top-nav a.active, .top-nav a:hover {
  border-color: #9bcfc6;
  color: var(--brand);
  background: var(--soft);
  transform: translateY(-1px);
}
.nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}
.hero {
  background: linear-gradient(135deg, #ffffff 0%, #f6fbfa 100%);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.hero h2 { margin: 0; font-size: 24px; }
.hero p { margin: 8px 0 0; color: var(--muted); max-width: 900px; line-height: 1.5; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric, .panel, .module-card, .record-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
}
.metric strong { display: block; font-size: 25px; margin-bottom: 4px; color: var(--brand); }
.metric span, .muted { color: var(--muted); font-size: 13px; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(230px, 1fr)); gap: 14px; }
.module-card { min-height: 190px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 2px 14px rgba(23,33,47,.04); position: relative; overflow: hidden; }
.module-card::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); opacity: .75; }
.module-head { display: flex; align-items: center; gap: 10px; }
.module-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--brand);
  border: 1px solid #b7d9d2;
}
.module-icon svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.module-card h3 { margin: 0; font-size: 18px; }
.module-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.module-card ul { margin: 0 0 0 18px; padding: 0; color: #475467; font-size: 13px; line-height: 1.55; }
.module-card .open-link, .actions a, button {
  align-self: flex-start;
  text-decoration: none;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-radius: 7px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.section-title { margin: 0 0 12px; font-size: 18px; }
.list { display: grid; gap: 8px; max-height: 720px; overflow: auto; padding-right: 3px; }
.person-link, .simple-item {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.person-link:hover { border-color: #8ec9c0; background: #fbfffe; }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 10px; }
.tab { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfcfe; min-height: 82px; }
.tab strong { display: block; margin-bottom: 5px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; grid-template-columns: 1fr 180px auto; gap: 10px; align-items: end; margin-bottom: 14px; }
label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 76px; resize: vertical; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { border-bottom: 1px solid var(--line); padding: 9px; text-align: left; vertical-align: top; font-size: 13px; }
th { background: #eef3f7; color: #344054; }
.ok { background: var(--soft); border: 1px solid #99d8cf; color: #134e4a; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }
.error { background: var(--danger-soft); border: 1px solid #fdba74; color: #9a3412; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }
.year { background: #fff8db; border-color: #d6a32d; font-weight: 700; }
@media (max-width: 980px) {
  .brand-row { align-items: flex-start; flex-direction: column; }
  .context-pill { white-space: normal; }
  main, .header-inner { padding-left: 16px; padding-right: 16px; }
  .metrics, .module-grid, .grid, .tabs, .filters { grid-template-columns: 1fr; }
  .list { max-height: none; }
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}
@media (max-width: 980px) {
  .footer-inner { padding-left: 16px; padding-right: 16px; }
}

.metric {
  position: relative;
  overflow: hidden;
}
.metric::before {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  right: -10px;
  top: -10px;
  background: rgba(11, 93, 85, .09);
}

.form-stack { display: grid; gap: 9px; }
.with-space { margin-top: 20px; }
.permissions-wrap { max-height: 720px; }
.permissions-table { min-width: 1600px; }
.permissions-table th { white-space: nowrap; text-align: center; }
.permissions-table td:first-child, .permissions-table th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 220px; }
.permissions-table thead th:first-child { background: #eef3f7; z-index: 2; }
.permissions-table small { color: var(--muted); font-size: 11px; }
.check-cell { text-align: center; }
.check-cell input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-grid { display:grid; grid-template-columns:repeat(3,minmax(180px,1fr)); gap:12px; }
.personal-form .panel { margin-bottom:14px; }
.personal-form label { font-weight:700; color:var(--ink); }
.personal-form label input,.personal-form label select,.personal-form label textarea { margin-top:5px; font-weight:400; }
.plaza-row { border-top:1px solid var(--line); padding-top:12px; margin-top:12px; }
.inline-form { display:grid; grid-template-columns:1fr 160px auto auto; gap:10px; align-items:end; }
.inline-form .open-link { align-self:end; text-align:center; }
@media (max-width: 980px) { .form-grid,.inline-form { grid-template-columns:1fr; } }
.inline-form { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
.inline-form button, .inline-form .open-link { align-self:end; }
@media (max-width: 980px) { .inline-form { grid-template-columns:1fr; } }
.ajax-status { display:none; margin:0 0 12px; padding:10px 12px; border-radius:8px; }
.ajax-status:not(:empty) { display:block; background:#eef3f7; }
.ajax-status.ok { display:block; }
.ajax-status.error { display:block; }

/* Importacion XLSX - Personal */
.xlsx-import-panel{margin-bottom:1rem}.xlsx-import-actions{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap}.xlsx-import-actions input[type=file]{max-width:100%;padding:.65rem;border:1px solid #d6d6d6;border-radius:.55rem;background:#fff}.xlsx-result{margin-top:1rem}.xlsx-summary{padding:.8rem 1rem;margin-bottom:.8rem;background:#f6f6f6;border-radius:.55rem}.xlsx-result table td:last-child{font-weight:600}
